Merge remote-tracking branch 'origin/master'
已重命名2个文件
已删除2个文件
已修改51个文件
已添加71个文件
| | |
| | | DepotConf depotConf = coreCommonService.getCacheDepotConf( |
| | | param.getCompanyId(), param.getDepotId()); |
| | | |
| | | // è·ååæºä¿¡æ¯ |
| | | DeviceSer deviceSer = coreSerService.getCacheSer(param.getCompanyId(), |
| | | depotConf.getGasSer()); |
| | | // é»è®¤è·åç²®æ
åæºä¿¡æ¯ |
| | | DeviceSer deviceSer = coreSerService.getCacheSer(param.getCompanyId(), depotConf.getGrainSer()); |
| | | // è¥æ°ä½åæºé
ç½®ä¸ä¸ºç©ºï¼åè·åæ°ä½çåæº |
| | | if(StringUtils.isNotEmpty(depotConf.getGasSer())){ |
| | | deviceSer = coreSerService.getCacheSer(param.getCompanyId(), depotConf.getGasSer()); |
| | | } |
| | | |
| | | CheckGasRequest request = new CheckGasRequest(); |
| | | request.setDepotId(param.getDepotId()); |
| | |
| | | DepotConf depotConf = coreCommonService.getCacheDepotConf( |
| | | param.getCompanyId(), param.getDepotId()); |
| | | |
| | | // è·ååæºä¿¡æ¯ |
| | | DeviceSer deviceSer = coreSerService.getCacheSer(param.getCompanyId(), |
| | | depotConf.getGrainSer()); |
| | | // é»è®¤è·åç²®æ
åæºä¿¡æ¯ |
| | | DeviceSer deviceSer = coreSerService.getCacheSer(param.getCompanyId(), depotConf.getGrainSer()); |
| | | // è¥æ°ä½åæºé
ç½®ä¸ä¸ºç©ºï¼åè·åæ°ä½çåæº |
| | | if(StringUtils.isNotEmpty(depotConf.getGasSer())){ |
| | | deviceSer = coreSerService.getCacheSer(param.getCompanyId(), depotConf.getGasSer()); |
| | | } |
| | | |
| | | CheckGasRequest request = new CheckGasRequest(); |
| | | request.setDepotId(param.getDepotId()); |
| | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | import com.ld.igds.models.Device; |
| | | import com.ld.igds.temp.dto.TempParam; |
| | |
| | | */ |
| | | List<Device> getCacheDeviceBySerId(String companyId, String serId); |
| | | |
| | | /** |
| | | * æ ¹æ®ä»åºç¼ç è·å设å¤ä¿¡æ¯ |
| | | * @param companyId |
| | | * @param depotId |
| | | * @return |
| | | */ |
| | | Set<String> getCacheDeviceSerByDepotId(String companyId, String depotId); |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®åæºä¿¡æ¯è·åè®¾å¤ |
| | |
| | | import com.ld.igds.constant.DeviceStatus; |
| | | import com.ld.igds.constant.DeviceType; |
| | | |
| | | import com.ld.igds.io.request.ExeDevice; |
| | | import com.ld.igds.models.Depot; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | return list; |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public Set<String> getCacheDeviceSerByDepotId(String companyId, String depotId) { |
| | | String patten = RedisConst.buildKey(companyId, RedisConst.KEY_DEVICE_LIST); |
| | | |
| | | Set<String> keys = redisUtil.keys(patten); |
| | | if (null == keys) return null; |
| | | |
| | | List<Device> list = new ArrayList<>(); |
| | | for (String key : keys) { |
| | | list.addAll((List<Device>) redisUtil.get(key)); |
| | | } |
| | | if (list.isEmpty()) { |
| | | return null; |
| | | } |
| | | Set<String> result = new HashSet<>(); |
| | | for (Device device : list) { |
| | | if(depotId.equals(device.getDepotId())){ |
| | | result.add(device.getSerId()); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public Device getCacheDeviceById(String companyId, String id) { |
| | | String key = RedisConst.buildDeviceKey(companyId, RedisConst.KEY_DEVICE, id); |
| | |
| | | public static final String GRAIN_START_POINT_TOP = "top"; //é¡¶é¨ |
| | | public static final String GRAIN_START_POINT_BELOW = "below"; //åºé¨ |
| | | |
| | | /** |
| | | * è¡å±è½¬æ¢(é»è®¤ä¸è½¬æ¢) |
| | | */ |
| | | public static final String GRAIN_CONVERT_DEFAULT = "default"; //é»è®¤ |
| | | public static final String GRAIN_CONVERT_CLOCKWISE = "clockwise"; //顺æ¶é |
| | | public static final String GRAIN_CONVERT_ANTICLOCKWISE = "anticlockwise"; //éæ¶é |
| | | |
| | | |
| | | //çä»é¥å½¢-æ éªè¯ |
| | | public static final String CABLE_CONE_0 = "0"; |
| | |
| | | public class ConfigGasImg { |
| | | |
| | | /** |
| | | * å¾ççå°è£
è§åï¼ä»åºç¼ç .img.png --ç
§ç |
| | | * å¾ççå°è£
è§åï¼ååºç¼ç .img.png --é»è®¤ç
§ç |
| | | * gas.mapImg.5318_001.img=5318_001.png |
| | | * å¾ççå°è£
è§åï¼gas.mapImg.companyId_ä»åºç¼ç .img.png --ç
§ç |
| | | * å¾ççå°è£
è§åï¼gas.mapImg.companyId_ååºç¼ç .img.png --é»è®¤ç
§ç |
| | | */ |
| | | private Map<String, GasImg> mapImg; |
| | | |
| | |
| | | Map<String, GasImg> result = new HashMap<>(); |
| | | Map<String, GasImg> all = this.getMapImg(); |
| | | if (null == depotList || null == all) return result; |
| | | String companyId = depotList.get(0).getCompanyId(); |
| | | GasImg temp; |
| | | for (Depot d : depotList) { |
| | | temp = all.get(d.getId()); |
| | | //å
ä»é
ç½®ä¸è·å |
| | | temp = all.get(companyId + "_" + d.getId()); |
| | | |
| | | if (null == temp) { |
| | | temp = all.get(deptId); |
| | | } |
| | | |
| | | result.put(d.getId(), temp); |
| | | } |
| | | return result; |
| | |
| | | import com.ld.igds.models.Depot; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Id; |
| | | |
| | | /** |
| | | * @Desc: ç¨äºä½ä¸ºä¸ææ¡çæ°æ®å°è£
ï¼åªå
å«åºç¡ä¿¡æ¯ |
| | | * @author: andy.jia |
| | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * å±è¡è½¬æ¢--顺æ¶é |
| | | * |
| | | * @param temps |
| | | * @param cable |
| | | * @return |
| | | */ |
| | | public List<Double> convertRight(List<Double> temps, String cable) { |
| | | String[] attCable = cable.split("-"); |
| | | int cableZ = Integer.valueOf(attCable[0]); |
| | | int cableY = Integer.valueOf(attCable[1]); |
| | | int cableX = Integer.valueOf(attCable[2]); |
| | | List<Double> list = new ArrayList<>(); |
| | | |
| | | int index; |
| | | for (int x = 1; x <= cableX; x++) { |
| | | for(int z = cableZ; z >= 1; z--){ |
| | | for (int y = 1; y <= cableY; y++) { |
| | | index = z*y*x -1; |
| | | list.add(temps.get(index)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * å±è¡è½¬æ¢--éæ¶é |
| | | * |
| | | * @param temps |
| | | * @param cable |
| | | * @return |
| | | */ |
| | | public List<Double> convertLeft(List<Double> temps, String cable) { |
| | | String[] attCable = cable.split("-"); |
| | | int cableZ = Integer.valueOf(attCable[0]); |
| | | int cableY = Integer.valueOf(attCable[1]); |
| | | int cableX = Integer.valueOf(attCable[2]); |
| | | List<Double> list = new ArrayList<>(); |
| | | |
| | | int index; |
| | | for (int x = 1; x <= cableX; x++) { |
| | | for (int z = 1; z <= cableZ; z++) { |
| | | for (int y = cableY; y >= cableY; y--) { |
| | | index = z*y*x -1; |
| | | list.add(temps.get(index)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | } |
| | |
| | | TCP_BHZH_INOUT_V1("TCP_BHZH_INOUT_V1", "馿µ·æºè½åºå
¥åºæ§å¶å¨åè®®"), |
| | | TCP_BEIBO_GRAIN_V1("TCP_BEIBO_GRAIN_V1", "è´åç²®æ
åæºæå¡ç«¯åè®®"), |
| | | FZZY_OPENAPI_HTTP("FZZY_OPENAPI_HTTP", "飿£è´è¿API-HTTPåè®®"), |
| | | MODBUS_TCP("MODBUS_TCP", "Modbus-TCPåè®®"); |
| | | TCP_MODBUS("TCP_MODBUS", "Modbus-TCPåè®®"); |
| | | |
| | | |
| | | private String code; |
| | |
| | | @PropertyDef(label = "æ°ä½åæº") |
| | | private String gasSer; |
| | | |
| | | @Column(name = "PEST_SER_", length = 40) |
| | | @PropertyDef(label = "è«å®³åæº") |
| | | private String pestSer; |
| | | |
| | | @Column(name = "VERB_SER_", length = 40) |
| | | @PropertyDef(label = "éé£åæº") |
| | | private String verbSer; |
| | | |
| | | @Column(name = "GRAIN_FREQ_", length = 4) |
| | | @PropertyDef(label = "ç²®æ
ä¿åé¢ç", description = "é»è®¤ä¸å¤©å¤æ¬¡") |
| | | private String grainFreq = GrainFrequence.FREQ_01.getCode(); |
| | |
| | | private int cableEnd; |
| | | |
| | | @Column(name = "START_ORIENTATION_", length = 20) |
| | | @PropertyDef(label = "çµç¼å¼å§æ¹ä½", description = "é»è®¤å³è¾¹(å³è¾¹ãå³ä¸ã左边ãå·¦ä¸)") |
| | | @PropertyDef(label = "çµç¼èµ·å§æ¹ä½", description = "é»è®¤å³è¾¹(å³è¾¹ãå³ä¸ã左边ãå·¦ä¸)") |
| | | private String startOrientation = Constant.GRAIN_START_ORIENTATION_RIGHT; |
| | | |
| | | @Column(name = "START_DIRECTION_", length = 20) |
| | | @PropertyDef(label = "çµç¼å¼å§æ¹å", description = "é»è®¤çºµå(纵åãæ¨ªå)") |
| | | @PropertyDef(label = "çµç¼èµ·å§æ¹å", description = "é»è®¤çºµå(纵åãæ¨ªå)") |
| | | private String startDirection = Constant.GRAIN_START_DIRECTION_PORTRAIT; |
| | | |
| | | @Column(name = "START_POINT_", length = 20) |
| | | @PropertyDef(label = "çµç¼å¼å§ç¹ä½", description = "é»è®¤é¡¶é¨(é¡¶é¨ãåºé¨)") |
| | | @PropertyDef(label = "çµç¼èµ·å§ç¹ä½", description = "é»è®¤é¡¶é¨(é¡¶é¨ãåºé¨)") |
| | | private String startPoint = Constant.GRAIN_START_POINT_TOP; |
| | | |
| | | @Column(name = "START_CONVERT_", length = 20) |
| | | @PropertyDef(label = "å±è¡è½¬æ¢", description = "é»è®¤ä¸è½¬æ¢(é»è®¤ã顺æ¶éãéæ¶é)") |
| | | private String startConvert = Constant.GRAIN_CONVERT_DEFAULT; |
| | | |
| | | @Column(name = "TEMP_MAX_") |
| | | @PropertyDef(label = "温度ä¸é") |
| | |
| | | @Column(name = "PEST_MAX_") |
| | | @PropertyDef(label = "è«å®³ä¸é") |
| | | private Double pestMax; |
| | | |
| | | |
| | | // ä»åºåç§° |
| | | @Transient |
| | |
| | | @PropertyDef(label = "设å¤åç", description = "设å¤åçï¼æ²¡æå¯ä¸å¡«å:KW/H") |
| | | private Double power; |
| | | |
| | | @Column(name = "MODBUS_",length = 100) |
| | | @PropertyDef(label = "Modbusé
ç½®") |
| | | private String modbus; |
| | | // @Column(name = "MODBUS_",length = 100) |
| | | // @PropertyDef(label = "Modbusé
ç½®") |
| | | // private String modbus; |
| | | |
| | | @Column(name = "REMARK_", length = 250) |
| | | @PropertyDef(label = "夿³¨", description = "夿³¨ä¿¡æ¯") |
| | |
| | | @PropertyDef(label = "å
³è设å¤éé", description = "é对åééé
置设å¤ï¼å¦æ··æµé£å£ç飿ºãè½´æµé£å£ç飿º") |
| | | private String link; |
| | | |
| | | @Column(name = "LINK_MODBUS_",length = 100) |
| | | @PropertyDef(label = "å
³è设å¤Modbus") |
| | | private String linkModbus; |
| | | // @Column(name = "LINK_MODBUS_",length = 100) |
| | | // @PropertyDef(label = "å
³è设å¤Modbus") |
| | | // private String linkModbus; |
| | | |
| | | @Column(name = "EXT1_", length = 20) |
| | | @PropertyDef(label = "æ©å±å段1", description = "æ ¹æ®ä¸å¡éè¦èªå®ä¹åå¨å¼") |
| | |
| | | |
| | | @PropertyDef(label = "æ ·åæ°é", required = true) |
| | | @Column(name = "ypsl", precision = 20, scale = 6) |
| | | private double ypsl; |
| | | private Double ypsl; |
| | | |
| | | @PropertyDef(label = "代表æ°é") |
| | | @Column(name = "dbsl", precision = 20, scale = 6) |
| | | private double dbsl; |
| | | private Double dbsl; |
| | | |
| | | @PropertyDef(label = "æ ·åç级") |
| | | @Column(name = "ypdj", length = 2) |
| | |
| | | </Children> |
| | | </FieldSet> |
| | | <FieldSet> |
| | | <Property name="caption">ç²®æ
æ£æµé
ç½®</Property> |
| | | <Property name="caption">ç²®æ¸©æ£æµé
ç½®</Property> |
| | | <Buttons/> |
| | | <Children> |
| | | <AutoForm layoutConstraint="padding:5"> |
| | |
| | | <AutoFormElement> |
| | | <Property name="name">tempMax</Property> |
| | | <Property name="property">tempMax</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">thSer</Property> |
| | | <Property name="property">thSer</Property> |
| | | <Property name="trigger">autoMappingDropDown2</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">thConf</Property> |
| | | <Property name="property">thConf</Property> |
| | | <Property name="label">粮温ä¸é</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="property">startOrientation</Property> |
| | | <Property name="name">startOrientation</Property> |
| | | <Property name="editable">false</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="property">startDirection</Property> |
| | | <Property name="name">startDirection</Property> |
| | | <Property name="editable">false</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="property">startPoint</Property> |
| | | <Property name="name">startPoint</Property> |
| | | <Property name="editable">false</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="property">startConvert</Property> |
| | | <Property name="name">startConvert</Property> |
| | | <Property name="editable">false</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="property">cableCone</Property> |
| | |
| | | <AutoFormElement> |
| | | <Property name="name">grainFreq</Property> |
| | | <Property name="property">grainFreq</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">thSer</Property> |
| | | <Property name="property">thSer</Property> |
| | | <Property name="trigger">autoMappingDropDown2</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">thConf</Property> |
| | | <Property name="property">thConf</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <Button> |
| | |
| | | <Property name="property">ph3Max</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <Button> |
| | | <ClientEvent name="onClick">var depotId = view.get("#dsMain.data:#").get("depotId");
 |
| | | var path = "com.ld.igds.modbus.GasModbus.d?depotId="+depotId;
 |
| | | view.get("#iframModbus").set("path",path);
 |
| | | view.get("#dialogModbus").show();</ClientEvent> |
| | | <Property name="caption">Modbusé
ç½®</Property> |
| | | <Property name="tip">é对Modbusåè®®çé
ç½®</Property> |
| | | <Property name="iconClass">fa fa-refresh</Property> |
| | | </Button> |
| | | </AutoForm> |
| | | </Children> |
| | | </FieldSet> |
| | |
| | | <Property name="cols">*,*,*</Property> |
| | | <Property name="labelSeparator">ï¼</Property> |
| | | <Property name="labelWidth">100</Property> |
| | | <AutoFormElement> |
| | | <Property name="name">pestSer</Property> |
| | | <Property name="property">pestSer</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">pestStart</Property> |
| | | <Property name="property">pestStart</Property> |
| | |
| | | <Property name="property">pestMax</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <Button> |
| | | <ClientEvent name="onClick">var depotId = view.get("#dsMain.data:#").get("depotId");
 |
| | | var path = "com.ld.igds.modbus.PestModbus.d?depotId="+depotId;
 |
| | | view.get("#iframModbus").set("path",path);
 |
| | | view.get("#dialogModbus").show();</ClientEvent> |
| | | <Property name="caption">Modbusé
ç½®</Property> |
| | | <Property name="tip">é对Modbusåè®®çé
ç½®</Property> |
| | | <Property name="iconClass">fa fa-refresh</Property> |
| | | </Button> |
| | | </AutoForm> |
| | | </Children> |
| | | </FieldSet> |
| | |
| | | <Property name="cols">*,*,*</Property> |
| | | <Property name="labelSeparator">ï¼</Property> |
| | | <Property name="labelWidth">100</Property> |
| | | <AutoFormElement> |
| | | <Property name="name">verbSer</Property> |
| | | <Property name="property">verbSer</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">esSer</Property> |
| | | <Property name="property">esSer</Property> |
| | |
| | | <Property name="service">depotPR#ajaxGetAllCache</Property> |
| | | <Property name="executingMessage">åå§åæ°æ®â¦â¦</Property> |
| | | </AjaxAction> |
| | | <Dialog id="dialogModbus"> |
| | | <Property name="width">80%</Property> |
| | | <Property name="height">95%</Property> |
| | | <Property name="caption">Modbus-TCPé
ç½®</Property> |
| | | <Buttons/> |
| | | <Children> |
| | | <IFrame id="iframModbus"> |
| | | <Property name="path">com.ld.igds.modbus.GasModbus.d</Property> |
| | | </IFrame> |
| | | </Children> |
| | | <Tools/> |
| | | </Dialog> |
| | | </View> |
| | | </ViewConfig> |
| | |
| | | } |
| | | |
| | | /** |
| | | * å±è¡è½¬æ¢ |
| | | * ${dorado.getDataProvider("depotPR#triggerStartConvert").getResult()} |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<DicTrigger> triggerStartConvert() { |
| | | List<DicTrigger> list = new ArrayList<DicTrigger>(); |
| | | list.add(new DicTrigger(Constant.GRAIN_CONVERT_DEFAULT, "é»è®¤")); |
| | | list.add(new DicTrigger(Constant.GRAIN_CONVERT_CLOCKWISE, "顺æ¶é")); |
| | | list.add(new DicTrigger(Constant.GRAIN_CONVERT_ANTICLOCKWISE, "éæ¶é")); |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * çä»é¥å½¢ |
| | | * ${dorado.getDataProvider("depotPR#triggerCableCone").getResult()} |
| | | * |
| | |
| | | </DataType> |
| | | </Model> |
| | | <View layout="padding:5;regionPadding:5"> |
| | | <ClientEvent name="onReady">view.get("#dataSetC").insert();</ClientEvent> |
| | | <ClientEvent name="onReady">view.get("#dataSetC").insert();
 |
| | | 
 |
| | | openModbusDevice = function(){
 |
| | | view.get("#dialogModbus").show();
 |
| | | }</ClientEvent> |
| | | <Property name="packages">font-awesome,css-common</Property> |
| | | <DataSet id="dsDevice"> |
| | | <Property name="dataProvider">devicePR#loadDeviceByContion</Property> |
| | |
| | | </DataColumn> |
| | | <DataColumn name="link"> |
| | | <Property name="property">link</Property> |
| | | <Property name="caption">å
³è设å¤</Property> |
| | | <Property name="caption">飿ºç¼ç </Property> |
| | | <Property name="align">center</Property> |
| | | </DataColumn> |
| | | <DataColumn name="serId"> |
| | |
| | | <DataColumn name="remark"> |
| | | <Property name="property">remark</Property> |
| | | <Property name="align">center</Property> |
| | | </DataColumn> |
| | | <DataColumn> |
| | | <ClientEvent name="onRenderCell">arg.dom.innerHTML ="<a href='javascripe:;' onclick='openModbusDevice()'>Modbusé
ç½®</a>";
 |
| | | arg.progressDefault = false;</ClientEvent> |
| | | <Property name="name">id</Property> |
| | | <Property name="property">id</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="caption">æä½</Property> |
| | | <Editor/> |
| | | </DataColumn> |
| | | </DataGrid> |
| | | <ToolBar layoutConstraint="bottom"> |
| | |
| | | <Property name="property">power</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">modbus</Property> |
| | | <Property name="property">modbus</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">linkModbus</Property> |
| | | <Property name="property">linkModbus</Property> |
| | | <Property name="label">飿ºModbus</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <Label layoutConstraint="colSpan:2"> |
| | | <Property name="text">modbusè§åï¼å¼å°å-å
³å°å-åå°å-å¼å°ä½-å
³å°ä½-弿
é-å
³æ
éï¼æ å°åç¨N代æ¿</Property> |
| | | <Property name="style"> |
| | | <Property name="padding-left">100px</Property> |
| | | <Property name="color">blue</Property> |
| | | </Property> |
| | | </Label> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">remark</Property> |
| | | <Property name="property">remark</Property> |
| | |
| | | <Property name="successMessage">å·æ°æåï¼</Property> |
| | | <Property name="confirmMessage">ç¡®å®è¦å·æ°ç¼åä¹ï¼</Property> |
| | | </AjaxAction> |
| | | <Dialog id="dialogModbus"> |
| | | <Property name="width">100%</Property> |
| | | <Property name="height">95%</Property> |
| | | <Property name="caption">设å¤MOBUS-TCPç¸å
³é
ç½®</Property> |
| | | <Buttons/> |
| | | <Children> |
| | | <IFrame id="iframeModbusDevice"> |
| | | <Property name="path">com.ld.igds.modbus.DeviceModbus.d</Property> |
| | | </IFrame> |
| | | </Children> |
| | | <Tools/> |
| | | </Dialog> |
| | | </View> |
| | | </ViewConfig> |
| | |
| | | package com.ld.igds.view.service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.hibernate.Session; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.bstek.bdf2.core.orm.hibernate.HibernateDao; |
| | | import com.bstek.dorado.data.provider.Page; |
| | | import com.ld.igds.common.CoreDeviceService; |
| | | import com.ld.igds.models.Device; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.hibernate.Session; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * @author Andy |
| | | * |
| | | */ |
| | | @Component |
| | | public class DeviceService extends HibernateDao { |
| | | |
| | | |
| | | @Autowired |
| | | private CoreDeviceService coreDeviceService; |
| | | |
| | | /** |
| | | * å è½½ææè®¾å¤æ°æ® |
| | | * <p> |
| | | * Title: loadDevice |
| | | * </p> |
| | | * <p> |
| | | * Description: |
| | | * </p> |
| | | * |
| | | */ |
| | | public List<Device> loadDevice(Map<String, Object> parameter) { |
| | | if (parameter == null || parameter.size() <= 0) |
| | | return null; |
| | | |
| | | Map<String, Object> p = new HashMap<String, Object>(); |
| | | String hql = " from " + Device.class.getName() |
| | | + " where companyId = :companyId "; |
| | | |
| | | String companyId = (String) parameter.get("companyId"); |
| | | if(null == companyId){ |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | p.put("companyId", companyId); |
| | | @Resource |
| | | private CoreDeviceService coreDeviceService; |
| | | |
| | | String depotId = (String) parameter.get("depotId"); |
| | | if (StringUtils.isNotEmpty(depotId)) { |
| | | hql += " and depotId =:depotId"; |
| | | p.put("depotId", depotId); |
| | | } |
| | | /** |
| | | * å è½½ææè®¾å¤æ°æ® |
| | | * <p> |
| | | * Title: loadDevice |
| | | * </p> |
| | | * <p> |
| | | * Description: |
| | | * </p> |
| | | */ |
| | | public List<Device> loadDevice(Map<String, Object> parameter) { |
| | | if (parameter == null || parameter.size() <= 0) |
| | | return null; |
| | | |
| | | String type = (String) parameter.get("type"); |
| | | if (StringUtils.isNotEmpty(type)) { |
| | | hql += " and type =:type"; |
| | | p.put("type", type); |
| | | } |
| | | Map<String, Object> p = new HashMap<String, Object>(); |
| | | String hql = " from " + Device.class.getName() |
| | | + " where companyId = :companyId "; |
| | | |
| | | String serId = (String) parameter.get("serId"); |
| | | if (StringUtils.isNotEmpty(serId)) { |
| | | hql += " and serId =:serId"; |
| | | p.put("serId", serId); |
| | | } |
| | | String companyId = (String) parameter.get("companyId"); |
| | | if (null == companyId) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | p.put("companyId", companyId); |
| | | |
| | | hql += " order by type,id"; |
| | | return this.query(hql, p); |
| | | } |
| | | String depotId = (String) parameter.get("depotId"); |
| | | if (StringUtils.isNotEmpty(depotId)) { |
| | | hql += " and depotId =:depotId"; |
| | | p.put("depotId", depotId); |
| | | } |
| | | |
| | | public void loadDeviceByContion(Page<Device> page, |
| | | Map<String, Object> parameter) throws Exception { |
| | | Map<String, Object> p = new HashMap<String, Object>(); |
| | | String hql = " from " + Device.class.getName() |
| | | + " where companyId = :companyId "; |
| | | p.put("companyId", ContextUtil.getCompanyId()); |
| | | |
| | | if(null == parameter)parameter = new HashMap<String, Object>(); |
| | | String type = (String) parameter.get("type"); |
| | | if (StringUtils.isNotEmpty(type)) { |
| | | hql += " and type =:type"; |
| | | p.put("type", type); |
| | | } |
| | | |
| | | String depotId = (String) parameter.get("depotId"); |
| | | if (StringUtils.isNotEmpty(depotId)) { |
| | | hql += " and depotId =:depotId"; |
| | | p.put("depotId", depotId); |
| | | } |
| | | String serId = (String) parameter.get("serId"); |
| | | if (StringUtils.isNotEmpty(serId)) { |
| | | hql += " and serId =:serId"; |
| | | p.put("serId", serId); |
| | | } |
| | | |
| | | String type = (String) parameter.get("type"); |
| | | if (StringUtils.isNotEmpty(type)) { |
| | | hql += " and type =:type"; |
| | | p.put("type", type); |
| | | } |
| | | hql += " order by type,id"; |
| | | return this.query(hql, p); |
| | | } |
| | | |
| | | String serId = (String) parameter.get("serId"); |
| | | if (StringUtils.isNotEmpty(serId)) { |
| | | hql += " and serId =:serId"; |
| | | p.put("serId", serId); |
| | | } |
| | | public void loadDeviceByContion(Page<Device> page, |
| | | Map<String, Object> parameter) throws Exception { |
| | | Map<String, Object> p = new HashMap<String, Object>(); |
| | | String hql = " from " + Device.class.getName() |
| | | + " where companyId = :companyId "; |
| | | p.put("companyId", ContextUtil.getCompanyId()); |
| | | |
| | | String countSql = "select count(*) " + hql; |
| | | hql += " order by serId,id asc"; |
| | | this.pagingQuery(page, hql, countSql, p); |
| | | } |
| | | if (null == parameter) parameter = new HashMap<String, Object>(); |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤ä¿¡æ¯ |
| | | * <p> |
| | | * Title: upDepotDevice |
| | | * </p> |
| | | * <p> |
| | | * Description: |
| | | * </p> |
| | | * |
| | | * @param depotDevice |
| | | */ |
| | | String depotId = (String) parameter.get("depotId"); |
| | | if (StringUtils.isNotEmpty(depotId)) { |
| | | hql += " and depotId =:depotId"; |
| | | p.put("depotId", depotId); |
| | | } |
| | | |
| | | public void upDepotDevice(Device depotDevice) { |
| | | Session session = null; |
| | | try { |
| | | session = this.getSessionFactory().openSession(); |
| | | session.update(depotDevice); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | String type = (String) parameter.get("type"); |
| | | if (StringUtils.isNotEmpty(type)) { |
| | | hql += " and type =:type"; |
| | | p.put("type", type); |
| | | } |
| | | |
| | | } |
| | | String serId = (String) parameter.get("serId"); |
| | | if (StringUtils.isNotEmpty(serId)) { |
| | | hql += " and serId =:serId"; |
| | | p.put("serId", serId); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¾å¤ |
| | | * <p> |
| | | * Title: delDepotDevice |
| | | * </p> |
| | | * <p> |
| | | * Description: |
| | | * </p> |
| | | */ |
| | | public void delDepotDevice(Device depotDevice) { |
| | | Session session = null; |
| | | try { |
| | | session = this.getSessionFactory().openSession(); |
| | | session.delete(depotDevice); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | } |
| | | String countSql = "select count(*) " + hql; |
| | | hql += " order by serId,id asc"; |
| | | this.pagingQuery(page, hql, countSql, p); |
| | | } |
| | | |
| | | public void delDepotDevice(String id) { |
| | | Session session = null; |
| | | try { |
| | | session = this.getSessionFactory().openSession(); |
| | | String hql = " delete from " + Device.class.getName() |
| | | + " where id=:id"; |
| | | session.createQuery(hql).setString("id", id).executeUpdate(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | } |
| | | /** |
| | | * ä¿®æ¹è®¾å¤ä¿¡æ¯ |
| | | * <p> |
| | | * Title: upDepotDevice |
| | | * </p> |
| | | * <p> |
| | | * Description: |
| | | * </p> |
| | | * |
| | | * @param depotDevice |
| | | */ |
| | | |
| | | public String saveOrUpdate(Device device, String id) { |
| | | if (null != id) { |
| | | this.delDepotDevice(id); |
| | | return null; |
| | | } |
| | | Session session = null; |
| | | try { |
| | | session = this.getSessionFactory().openSession(); |
| | | if (null != device.getId()) { |
| | | session.update(device); |
| | | } else { |
| | | device.setCompanyId(ContextUtil.getCompanyId()); |
| | | device.setId(ContextUtil.buildDeviceId(device.getCompanyId(), |
| | | device.getDepotId(), device.getPassCode())); |
| | | session.save(device); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | return null; |
| | | } |
| | | public void upDepotDevice(Device depotDevice) { |
| | | Session session = null; |
| | | try { |
| | | session = this.getSessionFactory().openSession(); |
| | | session.update(depotDevice); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | |
| | | public void addDepotDevice(Device depotDevice) { |
| | | Session session = null; |
| | | try { |
| | | session = this.getSessionFactory().openSession(); |
| | | depotDevice.setCompanyId(ContextUtil.getCompanyId()); |
| | | depotDevice.setId(ContextUtil.buildDeviceId( |
| | | depotDevice.getCompanyId(), depotDevice.getDepotId(), |
| | | depotDevice.getPassCode())); |
| | | session.save(depotDevice); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void refreshCache(String companyId) { |
| | | coreDeviceService.refreshCache(companyId); |
| | | } |
| | | /** |
| | | * å é¤è®¾å¤ |
| | | * <p> |
| | | * Title: delDepotDevice |
| | | * </p> |
| | | * <p> |
| | | * Description: |
| | | * </p> |
| | | */ |
| | | public void delDepotDevice(Device depotDevice) { |
| | | Session session = null; |
| | | try { |
| | | session = this.getSessionFactory().openSession(); |
| | | session.delete(depotDevice); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | } |
| | | |
| | | public Device getDeviceById(String id){ |
| | | Map<String, Object> p = new HashMap<String, Object>(); |
| | | String hql = " from " + Device.class.getName() |
| | | + " where companyId = :companyId and id=:id"; |
| | | public void delDepotDevice(String id) { |
| | | Session session = null; |
| | | try { |
| | | session = this.getSessionFactory().openSession(); |
| | | String hql = " delete from " + Device.class.getName() |
| | | + " where id=:id"; |
| | | session.createQuery(hql).setString("id", id).executeUpdate(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | } |
| | | |
| | | String companyId = ContextUtil.getCompanyId(); |
| | | p.put("companyId", companyId); |
| | | p.put("id", id); |
| | | List<Device> list = this.query(hql,p); |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | public String saveOrUpdate(Device device, String id) { |
| | | if (null != id) { |
| | | this.delDepotDevice(id); |
| | | return null; |
| | | } |
| | | Session session = null; |
| | | try { |
| | | session = this.getSessionFactory().openSession(); |
| | | if (null != device.getId()) { |
| | | session.update(device); |
| | | } else { |
| | | device.setCompanyId(ContextUtil.getCompanyId()); |
| | | device.setId(ContextUtil.buildDeviceId(device.getCompanyId(), |
| | | device.getDepotId(), device.getPassCode())); |
| | | session.save(device); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public List<Device> loadDeviceByType(Map<String, Object> parameter) { |
| | | if (parameter == null || parameter.size() <= 0) |
| | | return null; |
| | | public void addDepotDevice(Device depotDevice) { |
| | | Session session = null; |
| | | try { |
| | | session = this.getSessionFactory().openSession(); |
| | | depotDevice.setCompanyId(ContextUtil.getCompanyId()); |
| | | depotDevice.setId(ContextUtil.buildDeviceId( |
| | | depotDevice.getCompanyId(), depotDevice.getDepotId(), |
| | | depotDevice.getPassCode())); |
| | | session.save(depotDevice); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | } |
| | | |
| | | Map<String, Object> p = new HashMap<String, Object>(); |
| | | String hql = " from " + Device.class.getName() |
| | | + " where companyId = :companyId "; |
| | | public void refreshCache(String companyId) { |
| | | coreDeviceService.refreshCache(companyId); |
| | | } |
| | | |
| | | String companyId = (String) parameter.get("companyId"); |
| | | if(null == companyId){ |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | p.put("companyId", companyId); |
| | | public Device getDeviceById(String id) { |
| | | Map<String, Object> p = new HashMap<String, Object>(); |
| | | String hql = " from " + Device.class.getName() |
| | | + " where companyId = :companyId and id=:id"; |
| | | |
| | | String depotId = (String) parameter.get("depotId"); |
| | | if (StringUtils.isNotEmpty(depotId)) { |
| | | hql += " and depotId =:depotId"; |
| | | p.put("depotId", depotId); |
| | | } |
| | | String companyId = ContextUtil.getCompanyId(); |
| | | p.put("companyId", companyId); |
| | | p.put("id", id); |
| | | List<Device> list = this.query(hql, p); |
| | | if (list != null && list.size() > 0) { |
| | | return list.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | String type = (String) parameter.get("type"); |
| | | if (StringUtils.isNotEmpty(type)) { |
| | | hql += " and type =:type"; |
| | | p.put("type", type); |
| | | } |
| | | public List<Device> loadDeviceByType(Map<String, Object> parameter) { |
| | | if (parameter == null || parameter.size() <= 0) |
| | | return null; |
| | | |
| | | String serId = (String) parameter.get("serId"); |
| | | if (StringUtils.isNotEmpty(serId)) { |
| | | hql += " and serId =:serId"; |
| | | p.put("serId", serId); |
| | | } |
| | | String tag = (String) parameter.get("tag"); |
| | | // tag = 1 æ¥è¯¢é£æºç±»åç设å¤ï¼tag = 2 æ¥è¯¢ç
§æè®¾å¤ï¼å¦åæ¯å
¶ä½çå
¶å®è®¾å¤ |
| | | if (StringUtils.isNotEmpty(tag) && "1".equals(tag)) { |
| | | hql += " and type in (:types)"; |
| | | p.put("types", new String[] {"02","03","04","0C","0D"}); |
| | | }else if (StringUtils.isNotEmpty(tag) && "2".equals(tag)) { |
| | | hql += " and type =:type"; |
| | | p.put("type", "06"); |
| | | }else{ |
| | | hql += " and type not in (:types)"; |
| | | p.put("types", new String[] {"02","03","04","0C","0D"}); |
| | | } |
| | | hql += " order by type,id"; |
| | | return this.query(hql, p); |
| | | } |
| | | Map<String, Object> p = new HashMap<String, Object>(); |
| | | String hql = " from " + Device.class.getName() |
| | | + " where companyId = :companyId "; |
| | | |
| | | String companyId = (String) parameter.get("companyId"); |
| | | if (null == companyId) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | p.put("companyId", companyId); |
| | | |
| | | String depotId = (String) parameter.get("depotId"); |
| | | if (StringUtils.isNotEmpty(depotId)) { |
| | | hql += " and depotId =:depotId"; |
| | | p.put("depotId", depotId); |
| | | } |
| | | |
| | | String type = (String) parameter.get("type"); |
| | | if (StringUtils.isNotEmpty(type)) { |
| | | hql += " and type =:type"; |
| | | p.put("type", type); |
| | | } |
| | | |
| | | String serId = (String) parameter.get("serId"); |
| | | if (StringUtils.isNotEmpty(serId)) { |
| | | hql += " and serId =:serId"; |
| | | p.put("serId", serId); |
| | | } |
| | | String tag = (String) parameter.get("tag"); |
| | | // tag = 1 æ¥è¯¢é£æºç±»åç设å¤ï¼tag = 2 æ¥è¯¢ç
§æè®¾å¤ï¼å¦åæ¯å
¶ä½çå
¶å®è®¾å¤ |
| | | if (StringUtils.isNotEmpty(tag) && "1".equals(tag)) { |
| | | hql += " and type in (:types)"; |
| | | p.put("types", new String[]{"02", "03", "04", "0C", "0D"}); |
| | | } else if (StringUtils.isNotEmpty(tag) && "2".equals(tag)) { |
| | | hql += " and type =:type"; |
| | | p.put("type", "06"); |
| | | } else { |
| | | hql += " and type not in (:types)"; |
| | | p.put("types", new String[]{"02", "03", "04", "0C", "0D"}); |
| | | } |
| | | hql += " order by type,id"; |
| | | return this.query(hql, p); |
| | | } |
| | | |
| | | } |
| | |
| | | <Property name="keyProperty">id</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | <Property name="required">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="name"> |
| | | <Property></Property> |
| | | <Property name="label">åç§°</Property> |
| | | <Property name="required">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="passCode"> |
| | | <Property name="dataType">int</Property> |
| | | <Property name="label">设å¤ç¼å·</Property> |
| | | <Property name="required">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="link"> |
| | | <Property></Property> |
| | |
| | | <Property name="keyProperty">id</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | <Property name="required">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="type"> |
| | | <Property></Property> |
| | |
| | | <PropertyDef name="locationName"> |
| | | <Property></Property> |
| | | <Property name="label">ä½ç½®</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="modbus"> |
| | | <Property></Property> |
| | | <Property name="label">Modbusé
ç½®</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="linkModbus"> |
| | | <Property/> |
| | | <Property name="label">å
³è设å¤Modbus</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="ext1"> |
| | | <Property></Property> |
| | |
| | | <Property name="dataType">Double</Property> |
| | | <Property name="label">è«å®³ä¸é</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="videoIn"> |
| | | <Property></Property> |
| | | <Property name="label">å
é¨è§é¢</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("securityPR#listCamera").getResult()}</Property> |
| | | <Property name="keyProperty">id</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="quantitySer"> |
| | | <Property></Property> |
| | | <Property name="label">æ°éæ£æµåæº</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceSerPR2#getSerCacheByType").getResult("99")}</Property> |
| | | <Property name="keyProperty">id</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="thSer"> |
| | | <Property></Property> |
| | | <Property name="label">æ¸©æ¹¿åº¦åæº</Property> |
| | |
| | | <Property name="mapValues">${dorado.getDataProvider("depotPR#triggerStartPoint").getResult()}</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="startConvert"> |
| | | <Property name="label">å±è¡è½¬æ¢</Property> |
| | | <Property name="mapping"> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | <Property name="mapValues">${dorado.getDataProvider("depotPR#triggerStartConvert").getResult()}</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="depotName"> |
| | | <Property></Property> |
| | | </PropertyDef> |
| | |
| | | <PropertyDef name="gasSer"> |
| | | <Property></Property> |
| | | <Property name="label">æ°ä½åæº</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}</Property> |
| | | <Property name="keyProperty">id</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="pestSer"> |
| | | <Property/> |
| | | <Property name="label">æ°ä½åæº</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}</Property> |
| | | <Property name="keyProperty">id</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="verbSer"> |
| | | <Property/> |
| | | <Property name="label">éé£åæº</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}</Property> |
| | | <Property name="keyProperty">id</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | </DataType> |
| | | <DataType name="dtDicSlogan"> |
| | |
| | | <if test="data.gasEnd != null ">GAS_END_ = #{data.gasEnd},</if> |
| | | <if test="data.pestStart != null ">PEST_START_ = #{data.pestStart},</if> |
| | | <if test="data.pestEnd != null ">PEST_END_ = #{data.pestEnd},</if> |
| | | <if test="data.pestSer != null ">PEST_SER_ = #{pestSer},</if> |
| | | <if test="data.verbSer != null ">VERB_SER_ = #{verbSer},</if> |
| | | </set> |
| | | where COMPANY_ID_ = #{data.companyId} AND DEPOT_ID_ = #{data.depotId} |
| | | </update> |
| | |
| | | g.LOCATION_ AS location, |
| | | g.STATUS_ AS status, |
| | | g.POWER_ AS power, |
| | | g.MODBUS_ AS modbus, |
| | | g.LINK_ AS link, |
| | | g.EXT1_ AS ext1, |
| | | g.EXT2_ AS ext2, |
| | |
| | | "æ§è¡å¤±è´¥ï¼æ²¡æé
ç½®é讯åè®®ã"); |
| | | } |
| | | |
| | | if (Constant.YN_N.equals(deviceSer.getStatus())) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "æ§è¡å¤±è´¥ï¼è½èåæºä¸å¨çº¿ã"); |
| | | } |
| | | // if (Constant.YN_N.equals(deviceSer.getStatus())) { |
| | | // return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | // "æ§è¡å¤±è´¥ï¼è½èåæºä¸å¨çº¿ã"); |
| | | // } |
| | | |
| | | RemoteEsService remoteEsService = remoteManager.getRemoteEsService(deviceSer.getProtocol()); |
| | | |
| | |
| | | htmlStr = htmlStr.replace("remark", bill.getRemark()); |
| | | htmlStr = htmlStr.replace("moneyName", bill.getMoneyName()); |
| | | |
| | | htmlStr = htmlStr.replace("unitName", bill.getUnitName()); |
| | | htmlStr = htmlStr.replace("time", bill.getRegisterTime()); |
| | | htmlStr = htmlStr.replace("handleStart", ""); |
| | | htmlStr = htmlStr.replace("handleEnd", ""); |
| | | |
| | | htmlStr = htmlStr.replaceAll("weightUser", |
| | | bill.getWeightUser() == null ? "" : bill.getWeightUser()); |
| | | htmlStr = htmlStr.replaceAll("handleUser", |
| | |
| | | htmlStr = htmlStr.replace("settleMoney", bill.getSettleMoney() + ""); |
| | | htmlStr = htmlStr.replace("wet", bill.getWet() + ""); |
| | | htmlStr = htmlStr.replace("impurity", bill.getImpurity() + ""); |
| | | |
| | | htmlStr = htmlStr.replace("unitName", bill.getUnitName()); |
| | | htmlStr = htmlStr.replace("time", bill.getRegisterTime()); |
| | | htmlStr = htmlStr.replace("handleStart", ""); |
| | | htmlStr = htmlStr.replace("handleEnd", ""); |
| | | |
| | | htmlStr = htmlStr.replaceAll("weightUser", |
| | | bill.getWeightUser() == null ? "" : bill.getWeightUser()); |
| | |
| | | } |
| | | bill.setSettleMoney(data.getSettleMoney() == null ? "" : data.getSettleMoney() + ""); |
| | | bill.setRemark(data.getRemarks() == null ? "" : data.getRemarks()); |
| | | |
| | | bill.setDeSum(data.getDeCheck() + data.getDeOther() + data.getDeHandle() + data.getDePackage()); |
| | | |
| | | if(InoutConstant.TYPE_IN.equals(data.getType())){ |
| | | bill.setWeightUser(data.getFullWeightUser()); |
| | |
| | | List<String> strings3 = result.subList(6, 8); |
| | | System.out.println(strings3); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | if (DepotType.TYPE_02.getCode().equals(depotType) || DepotType.TYPE_04.getCode().equals(depotType)) { |
| | | view.setViewName("admin/n2/n2-hand2"); |
| | | } else { |
| | | if ("5013".equals(user.getCompanyId()) || "5016".equals(user.getCompanyId())) { |
| | | if ("5013".equals(user.getCompanyId()) || "5016".equals(user.getCompanyId()) || "5325".equals(user.getCompanyId())) { |
| | | view.setViewName("admin/n2/n2-hand-5013"); |
| | | } else { |
| | | view.setViewName("admin/n2/n2-hand1"); |
| | |
| | | view.addObject("n2ImgMap", n2ImgMap); |
| | | |
| | | view.setViewName("admin/n2/n2-hand1"); |
| | | if ("5013".equals(user.getCompanyId()) || "5016".equals(user.getCompanyId())) { |
| | | if ("5013".equals(user.getCompanyId()) || "5016".equals(user.getCompanyId()) || "5325".equals(user.getCompanyId())) { |
| | | view.setViewName("admin/n2/n2-hand-5013"); |
| | | } |
| | | return view; |
| | |
| | | package com.ld.igds.protocol.bhzn; |
| | | |
| | | import com.ld.igds.data.ConfigData; |
| | | import com.ld.igds.protocol.bhzn.grainv1.server.BhznGrainV1ServerEngine; |
| | | import com.ld.igds.protocol.bhzn.grainv2.server.BhznGrainV2ServerEngine; |
| | | import com.ld.igds.protocol.bhzn.verb.server.BhznVerbServerEngine; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private ConfigData configData; |
| | | @Autowired |
| | | private BhznGrainV2ServerEngine bhznGrainServerEngine; |
| | | private BhznGrainV2ServerEngine bhznGrainServerEngine2; |
| | | @Autowired |
| | | private BhznGrainV1ServerEngine bhznGrainServerEngine1; |
| | | @Autowired |
| | | private BhznVerbServerEngine bhznVerbServerEngine; |
| | | @Override |
| | | public void run(String... strings) throws Exception { |
| | | |
| | | if (configData.getActive().indexOf("pro") >= 0) { |
| | | bhznGrainServerEngine.start(BhznGrainV2ServerEngine.PORT); |
| | | bhznVerbServerEngine.start(BhznVerbServerEngine.PORT); |
| | | bhznGrainServerEngine1.start(BhznGrainV1ServerEngine.PORT); |
| | | // bhznVerbServerEngine.start(BhznVerbServerEngine.PORT); |
| | | } |
| | | if (configData.getActive().indexOf("dev") >= 0) { |
| | | bhznGrainServerEngine.start(BhznGrainV2ServerEngine.PORT); |
| | | bhznVerbServerEngine.start(BhznVerbServerEngine.PORT); |
| | | bhznGrainServerEngine1.start(BhznGrainV1ServerEngine.PORT); |
| | | //bhznVerbServerEngine.start(BhznVerbServerEngine.PORT); |
| | | } |
| | | } |
| | | } |
| | |
| | | public GrainResponse checkGrain(CheckGrainRequest request) { |
| | | try { |
| | | // çæç²®æ
ä¿¡æ¯ |
| | | String hexStr = CommandBuild.getInstance().getMsgCheck(request.getSerId(), request.getDepotId()); |
| | | |
| | | String hexStr = ""; |
| | | if("5323".equals(request.getCompanyId())){ |
| | | if("0P01".equals(request.getDepotId())){ |
| | | hexStr = CommandBuild.getInstance().getMsgCheck(request.getSerId(), "1"); |
| | | }else if("0P02".equals(request.getDepotId())){ |
| | | hexStr = CommandBuild.getInstance().getMsgCheck(request.getSerId(), "1"); |
| | | }else if("0P03".equals(request.getDepotId())){ |
| | | hexStr = CommandBuild.getInstance().getMsgCheck(request.getSerId(), "2"); |
| | | }else if("0P04".equals(request.getDepotId())){ |
| | | hexStr = CommandBuild.getInstance().getMsgCheck(request.getSerId(), "2"); |
| | | }else if("0P05".equals(request.getDepotId())){ |
| | | hexStr = CommandBuild.getInstance().getMsgCheck(request.getSerId(), "3"); |
| | | }else if("0P06".equals(request.getDepotId())){ |
| | | hexStr = CommandBuild.getInstance().getMsgCheck(request.getSerId(), "4"); |
| | | }else if("0P07".equals(request.getDepotId())){ |
| | | hexStr = CommandBuild.getInstance().getMsgCheck(request.getSerId(), "4"); |
| | | }else if("0P08".equals(request.getDepotId())){ |
| | | hexStr = CommandBuild.getInstance().getMsgCheck(request.getSerId(), "4"); |
| | | } |
| | | }else{ |
| | | hexStr = CommandBuild.getInstance().getMsgCheck(request.getSerId(), request.getDepotId()); |
| | | } |
| | | |
| | | // //é讯使ç¨çæ¯ä¸»æºé讯 |
| | | // DeviceSer mainSer = coreSerService.getCacheSer(ContextUtil.getDefaultCompanyId(), BhznGrainV1ServerUtils.DEFAULT_MAC_ID); |
| | |
| | | import com.ld.igds.common.dto.THDto; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.constant.Constant; |
| | | import com.ld.igds.constant.DepotType; |
| | | import com.ld.igds.grain.GrainUtil; |
| | | import com.ld.igds.grain.dto.GrainItemInfo; |
| | | import com.ld.igds.io.notify.NotifyGrainInvoker; |
| | | import com.ld.igds.models.DepotConf; |
| | | import com.ld.igds.models.DeviceSer; |
| | | import com.ld.igds.models.DicSysConf; |
| | | import com.ld.igds.models.Grain; |
| | | import com.ld.igds.models.*; |
| | | import com.ld.igds.order.ExeOrderService; |
| | | import com.ld.igds.order.data.ExeRequest; |
| | | import com.ld.igds.protocol.bhzn.grainv1.msg.builder.CommandBuild; |
| | |
| | | //DO NOTHING |
| | | |
| | | log.info("主æº------->>å¹³å°ï¼æ³¨åä¿¡æ¯æ¥æ={}", message); |
| | | DeviceSer ser = coreSerService.getCacheSerBySn(ContextUtil.getDefaultCompanyId(),message.getAddr()); |
| | | DeviceSer ser = coreSerService.getCacheSerBySn("5323",message.getAddr()); |
| | | if(ser!= null ){ |
| | | ser.setIp(message.getIp()); |
| | | ser.setPort(message.getPort()); |
| | |
| | | |
| | | //æ ¹æ®åæºå°åè·ååæºä¿¡æ¯ |
| | | |
| | | DeviceSer ser = coreSerService.getCacheSer(ContextUtil.getDefaultCompanyId(), message.getAddr()); |
| | | DeviceSer ser = coreSerService.getCacheSer("5323", message.getAddr()); |
| | | if (ser == null) { |
| | | replayGrain(message); |
| | | log.error("主æº-------->>å¹³å°ï¼è§£æç²®æ
å¤±è´¥ï¼æªè·åå°ç³»ç»ç²®æ
主æºé
ç½®ï¼" + message.getAddr()); |
| | |
| | | log.error("åæº------>>>å¹³å°ï¼" + info); |
| | | return; |
| | | } |
| | | |
| | | Depot depot = commonService.getDepotById(depotConf.getCompanyId(),depotConf.getDepotId()); |
| | | if (null == depot) { |
| | | String info = "ç²®æ
è§£æå¤±è´¥:åæº=" + ser.getName() + "没æè·åå°ç²®æ
åæ°é
ç½®ä»åºã"; |
| | | log.error("åæº------>>>å¹³å°ï¼" + info); |
| | | return; |
| | | } |
| | | // ç²®æ
çæ¹æ¬¡å·éæ°æ ¹æ®é¢çè°æ´ |
| | | String batchId = ContextUtil.getBatchIdByFireq(depotConf.getGrainFreq()); |
| | | |
| | | // å¤ææ°æ®ææ²¡ææ¶å宿´ |
| | | String[] attCable = depotConf.getCableRule().split("-"); |
| | | int cableZ = Integer.valueOf(attCable[0]); |
| | | int cableY = Integer.valueOf(attCable[1]); |
| | | int cableX = Integer.valueOf(attCable[2]); |
| | | int cableZ = 1; |
| | | int cableY = 1; |
| | | int cableX = 1; |
| | | |
| | | if(DepotType.TYPE_01.equals(depot.getDepotType())){ |
| | | cableZ = Integer.valueOf(attCable[0]); |
| | | cableY = Integer.valueOf(attCable[1]); |
| | | cableX = Integer.valueOf(attCable[2]); |
| | | }else{ |
| | | cableZ = Integer.valueOf(depotConf.getCableCir()); |
| | | cableY = Integer.valueOf(attCable[0]); |
| | | cableX = 1; |
| | | } |
| | | int sumPoint = cableZ * cableY * cableX; |
| | | |
| | | //è·åå½åç²®æ
æ¸©åº¦æ¥æ |
| | |
| | | |
| | | private void analysisGrain2(DeviceSer ser, IoMessage message, ExeRequest exeRequest, DepotConf depotConf, DicSysConf sysConf, String batchId, String grainStr) { |
| | | // è·å宿´çç²®æ
å
ä¿¡æ¯ |
| | | Depot depot = commonService.getDepotById(depotConf.getCompanyId(),depotConf.getDepotId()); |
| | | if (null == depot) { |
| | | String info = "ç²®æ
è§£æå¤±è´¥:åæº=" + ser.getName() + "没æè·åå°ç²®æ
åæ°é
ç½®ä»åºã"; |
| | | log.error("åæº------>>>å¹³å°ï¼" + info); |
| | | return; |
| | | } |
| | | String[] attCable = depotConf.getCableRule().split("-"); |
| | | int cableZ = Integer.valueOf(attCable[0]); |
| | | int cableY = Integer.valueOf(attCable[1]); |
| | | int cableX = Integer.valueOf(attCable[2]); |
| | | int cableZ = 1; |
| | | int cableY = 1; |
| | | int cableX = 1; |
| | | |
| | | if(DepotType.TYPE_01.equals(depot.getDepotType())){ |
| | | cableZ = Integer.valueOf(attCable[0]); |
| | | cableY = Integer.valueOf(attCable[1]); |
| | | cableX = Integer.valueOf(attCable[2]); |
| | | }else{ |
| | | cableZ = Integer.valueOf(depotConf.getCableCir()); |
| | | cableY = Integer.valueOf(attCable[0]); |
| | | cableX = 1; |
| | | } |
| | | |
| | | // æ ¹æ®å±è¡åè·åæå®é¿åº¦ |
| | | int start = 4 * (depotConf.getCableStart() - ser.getCableStart()) |
| | |
| | | private void addPoint1(List<Double> temps, |
| | | DepotConf depotConf, DeviceSer ser, ExeRequest exeRequest, |
| | | THDto thDto, DicSysConf sysConf, String batchId) { |
| | | |
| | | Depot depot = commonService.getDepotById(depotConf.getCompanyId(),depotConf.getDepotId()); |
| | | if (null == depot) { |
| | | String info = "ç²®æ
è§£æå¤±è´¥:åæº=" + ser.getName() + "没æè·åå°ç²®æ
åæ°é
ç½®ä»åºã"; |
| | | log.error("åæº------>>>å¹³å°ï¼" + info); |
| | | return; |
| | | } |
| | | //æ ¹æ®çµç¼èµ·å§æ¹ä½åå¸çº¿æ¹åï¼å¯¹ç²®æ
æ°æ®è¿è¡è°æ´ |
| | | if (null != depotConf.getStartOrientation()) { |
| | | temps = reversalGrainPoint(temps, depotConf); |
| | |
| | | } |
| | | |
| | | String[] attCable = depotConf.getCableRule().split("-"); |
| | | int cableZ = Integer.valueOf(attCable[0]); |
| | | int cableY = Integer.valueOf(attCable[1]); |
| | | int cableX = Integer.valueOf(attCable[2]); |
| | | int cableZ = 1; |
| | | int cableY = 1; |
| | | int cableX = 1; |
| | | |
| | | if(DepotType.TYPE_01.equals(depot.getDepotType())){ |
| | | cableZ = Integer.valueOf(attCable[0]); |
| | | cableY = Integer.valueOf(attCable[1]); |
| | | cableX = Integer.valueOf(attCable[2]); |
| | | }else{ |
| | | cableZ = Integer.valueOf(depotConf.getCableCir()); |
| | | cableY = Integer.valueOf(attCable[0]); |
| | | cableX = 1; |
| | | } |
| | | |
| | | |
| | | Grain grain = new Grain(); |
| | | grain.setDepotId(depotConf.getDepotId()); |
| | | grain.setCompanyId(depotConf.getCompanyId()); |
| | | grain.setCable(depotConf.getCableRule()); |
| | | grain.setCableCir(depotConf.getCableCir()); |
| | | grain.setBatchId(batchId); |
| | | grain.setTempIn(Constant.ERROR_TEMP); |
| | | grain.setHumidityIn(Constant.ERROR_TEMP); |
| | |
| | | private void analysisTh(IoMessage message) { |
| | | try { |
| | | THDto th = new THDto(); |
| | | th.setCompanyId(ContextUtil.getDefaultCompanyId()); |
| | | th.setCompanyId("5323"); |
| | | String data = message.getContent(); |
| | | String houseNo = data.substring(0, 2); |
| | | String t = data.substring(4, 8); |
| | |
| | | package com.ld.igds.protocol.bhzn.grainv1.server; |
| | | |
| | | import com.ld.igds.common.CoreCommonService; |
| | | import com.ld.igds.common.CoreSerService; |
| | | import com.ld.igds.constant.Constant; |
| | | import com.ld.igds.models.DeviceSer; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import com.ld.igds.view.service.DeviceSerService; |
| | | import com.ld.io.api.IoSession; |
| | | import com.ld.io.api.IoSessionListener; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Autowired |
| | | private CoreSerService coreSerService; |
| | | |
| | | /** |
| | | * 设å¤å建å¨çº¿ï¼éè¦æ³¨æå½å使ç¨ä¸»æºæ¨¡å¼ï¼ä¸»æºä¸çº¿é»è®¤ææç¸åSNé
ç½®çåæºå
¨é¨ä¸çº¿ |
| | | * |
| | |
| | | session.setBusinessKey(BhznGrainV1ServerUtils.getServerKey(session.getAddress(), session.getPort())); |
| | | |
| | | //项ç®éç¨æ çº¿ä¸»æºæ¨¡å¼ï¼ç´æ¥è·åé»è®¤è®¾å¤ |
| | | DeviceSer deviceSer = coreSerService.getCacheSer(ContextUtil.getDefaultCompanyId(), BhznGrainV1ServerUtils.DEFAULT_MAC_ID); |
| | | |
| | | DeviceSer deviceSer = coreSerService.getCacheSerBySn("5323", BhznGrainV1ServerUtils.DEFAULT_MAC_ID); |
| | | if (null == deviceSer) return; |
| | | |
| | | coreSerService.onlineBySn(session.getAddress(), session.getPort(), deviceSer.getSn(), Constant.YN_Y); |
| | | //æ´æ°ç¼å |
| | | coreSerService.refreshCache(deviceSer.getCompanyId()); |
| | |
| | | try{ |
| | | log.info("BHZNæ§å¶LEDå¼å§"); |
| | | BHZNClientEngine test = new BHZNClientEngine( |
| | | "12.10.0.187", 58258); |
| | | "192.168.0.210", 58258); |
| | | test.start(); |
| | | Thread.sleep(3000L); |
| | | |
| | |
| | | |
| | | log.info("* ========================"); |
| | | log.info("* "); |
| | | log.info("* æ°éçæµæå¡å¯å¨ï¼ç«¯å£å·={}", port); |
| | | log.info("* èæ±æ°éçæµæå¡å¯å¨ï¼ç«¯å£å·={}", port); |
| | | log.info("* "); |
| | | log.info("* ========================"); |
| | | |
| | |
| | | private CoreGasService gasService; |
| | | @Autowired |
| | | private CoreCommonService commonService; |
| | | @Autowired |
| | | private ExeOrderService exeOrderService; |
| | | |
| | | @Autowired |
| | | private NotifyWebInvoker notifyInvoker; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <RuleSet version="1.1"><PackageInfos> |
| | | <PackageInfo name="dorado-core" version="7.6.0.2.190128.1750"/> |
| | | <PackageInfo name="bdf2-orm" version="2.1.0"/> |
| | | <PackageInfo name="bdf2-core" version="2.0.9"/> |
| | | <PackageInfo name="dorado-uploader" version="1.0.20-SNAPSHOT"/> |
| | | <PackageInfo name="bdf2-job" version="2.0.5-SNAPSHOT"/> |
| | | <PackageInfo name="dorado-intro" version="0.2.1.140715.2255"/> |
| | | <PackageInfo name="bdf2-swfviewer" version="2.0.6-SNAPSHOT"/> |
| | | <PackageInfo name="bdf2-export" version="2.0.8"/> |
| | | <PackageInfo name="dorado-vidor"/></PackageInfos><Rule name="Auxiliary"><Children><Child rule="Import" name="Import"></Child><Child rule="GroupStart" name="GroupStart"></Child><Child rule="GroupEnd" name="GroupEnd"></Child><Child rule="PlaceHolder" name="PlaceHolder"></Child><Child rule="PlaceHolderStart" name="PlaceHolderStart"></Child><Child rule="PlaceHolderEnd" name="PlaceHolderEnd"></Child></Children></Rule><Rule name="Import" scope="public" sortFactor="9001" category="Auxiliary" icon="/com/bstek/dorado/idesupport/icons/Import.png"><PrimitiveProps> |
| | | <Prop name="id"/> |
| | | <Prop name="src"/></PrimitiveProps></Rule><Rule name="GroupStart" scope="public" sortFactor="9002" category="Auxiliary" icon="/com/bstek/dorado/idesupport/icons/GroupStart.png"><PrimitiveProps> |
| | | <Prop name="id"/></PrimitiveProps></Rule><Rule name="GroupEnd" scope="public" sortFactor="9003" category="Auxiliary" icon="/com/bstek/dorado/idesupport/icons/GroupEnd.png"></Rule><Rule name="PlaceHolder" scope="public" sortFactor="9004" category="Auxiliary" icon="/com/bstek/dorado/idesupport/icons/PlaceHolder.png"><PrimitiveProps> |
| | | <Prop name="id"/></PrimitiveProps></Rule><Rule name="PlaceHolderStart" parents="PlaceHolder" scope="public" sortFactor="9005" category="Auxiliary" icon="/com/bstek/dorado/idesupport/icons/PlaceHolderStart.png"></Rule><Rule name="PlaceHolderEnd" scope="public" sortFactor="9006" category="Auxiliary" icon="/com/bstek/dorado/idesupport/icons/PlaceHolderEnd.png"></Rule><Rule name="Model" icon="/com/bstek/dorado/view/manager/Model.png"><Children><Child rule="AbstractDataType" name="DataType" aggregated="true"></Child><Child rule="AbstractDataProvider" name="DataProvider" aggregated="true"></Child><Child rule="AbstractDataResolver" name="DataResolver" aggregated="true"></Child></Children></Rule><Rule name="AbstractDataType" abstract="true" nodeName="DataType" type="com.bstek.dorado.data.type.AbstractDataType"><PrimitiveProps> |
| | | <Prop name="name"/></PrimitiveProps><Props> |
| | | <Prop name="creationType" type="java.lang.Class"/> |
| | | <Prop name="matchType" type="java.lang.Class"/><Prop name="metaData" type="java.util.Map" compositeType="Open"></Prop> |
| | | <Prop name="tags"/></Props></Rule><Rule name="AbstractDataProvider" abstract="true" nodeName="DataProvider" type="com.bstek.dorado.data.provider.AbstractDataProvider"><PrimitiveProps> |
| | | <Prop name="impl"/> |
| | | <Prop name="parent"/> |
| | | <Prop name="scope" enumValues="instant,thread,singleton,session,request"/> |
| | | <Prop name="listener"/> |
| | | <Prop name="overwrite" type="boolean"/> |
| | | <Prop name="name"/></PrimitiveProps><Props> |
| | | <Prop name="interceptor"/><Prop name="metaData" type="java.util.Map" compositeType="Open"></Prop> |
| | | <Prop name="parameter" editor="pojo" type="java.lang.Object"/></Props></Rule><Rule name="AbstractDataResolver" abstract="true" nodeName="DataResolver" type="com.bstek.dorado.data.resolver.AbstractDataResolver"><PrimitiveProps> |
| | | <Prop name="impl"/> |
| | | <Prop name="parent"/> |
| | | <Prop name="scope" enumValues="instant,thread,singleton,session,request"/> |
| | | <Prop name="listener"/> |
| | | <Prop name="overwrite" type="boolean"/> |
| | | <Prop name="name"/></PrimitiveProps><Props> |
| | | <Prop name="interceptor"/><Prop name="metaData" type="java.util.Map" compositeType="Open"></Prop> |
| | | <Prop name="parameter" type="java.lang.Object"/></Props></Rule><Rule name="ViewConfig" label="ViewConfig" type="com.bstek.dorado.view.manager.ViewConfig" icon="/com/bstek/dorado/view/manager/ViewConfig.png"><PrimitiveProps> |
| | | <Prop name="listener"/> |
| | | <Prop name="template"/></PrimitiveProps><Props><Prop name="metaData" type="java.util.Map" compositeType="Open"></Prop> |
| | | <Prop name="scope" defaultValue="thread" enumValues="instant,thread,singleton,session,request"/></Props><Children><Child name="Arguments"><Rule name="Arguments" nodeName="Arguments" icon="/com/bstek/dorado/view/manager/Arguments.png"><Children><Child name="Argument" aggregated="true"><Rule name="Argument" nodeName="Argument" icon="/com/bstek/dorado/view/manager/Argument.png"><PrimitiveProps> |
| | | <Prop name="name"/></PrimitiveProps><Props> |
| | | <Prop name="value" type="java.lang.Object"/></Props></Rule></Child></Children></Rule></Child><Child name="Context"><Rule name="Context" nodeName="Context" icon="/com/bstek/dorado/view/manager/ViewContext.png"><Children><Child name="Attribute" aggregated="true"><Rule name="Attribute" nodeName="Attribute" icon="/com/bstek/dorado/view/manager/Attribute.png"><PrimitiveProps> |
| | | <Prop name="name"/></PrimitiveProps><Props> |
| | | <Prop name="value" type="java.lang.Object"/></Props></Rule></Child></Children></Rule></Child><Child rule="Model" name="Model"></Child><Child rule="View" name="View"></Child></Children></Rule><Rule name="LayoutHolder"><Children><Child rule="AnchorLayout" name="anchor"></Child><Child rule="DockLayout" name="dock"></Child><Child rule="HboxLayout" name="hbox"></Child><Child rule="VboxLayout" name="vbox"></Child><Child rule="FormLayout" name="form"></Child><Child rule="NativeLayout" name="native"></Child></Children></Rule><Rule name="View" parents="Container" abstract="true" type="com.bstek.dorado.view.View" scope="private" clientTypes="desktop"><PrimitiveProps> |
| | | <Prop name="listener"/></PrimitiveProps><Props><Prop name="cache" type="com.bstek.dorado.view.ViewCache" compositeType="Fixed"> |
| | | <Prop name="maxAge" type="long"/> |
| | | <Prop name="mode" enumValues="none,clientSide"/></Prop> |
| | | <Prop name="javaScriptFile"/> |
| | | <Prop name="packages"/> |
| | | <Prop name="pageTemplate"/> |
| | | <Prop name="pageUri"/> |
| | | <Prop name="renderMode" defaultValue="onCreate" enumValues="onCreate,onDataLoaded,manual"/> |
| | | <Prop name="skin"/> |
| | | <Prop name="styleSheetFile"/> |
| | | <Prop name="title" highlight="1"/></Props><ClientEvents> |
| | | <ClientEvent name="onLoadData" parameters="self,arg"/> |
| | | <ClientEvent name="onComponentRegistered" parameters="self,arg"/> |
| | | <ClientEvent name="onComponentUnregistered" parameters="self,arg"/></ClientEvents><Children><Child rule="Component" name="Children" aggregated="true"></Child></Children></Rule><Rule name="DataType" parents="EntityDataTypeSupport" label="DataType" type="com.bstek.dorado.data.type.DefaultEntityDataType" scope="public" sortFactor="1" robots="datatype-reflection|èªå¨å建PropertyDefs" icon="/com/bstek/dorado/data/type/DefaultEntityDataType.png" reserve="default"><Children><Child rule="BasePropertyDef" name="PropertyDef" aggregated="true"></Child><Child rule="Reference" name="Reference" aggregated="true"></Child></Children></Rule><Rule name="NonAggregationDataType" parents="AbstractDataType" abstract="true" type="com.bstek.dorado.data.type.NonAggregationDataType"></Rule><Rule name="EntityDataTypeSupport" parents="NonAggregationDataType" abstract="true" nodeName="DataType" type="com.bstek.dorado.data.type.EntityDataTypeSupport"><PrimitiveProps> |
| | | <Prop name="impl"/> |
| | | <Prop name="parent"/> |
| | | <Prop name="listener"/> |
| | | <Prop name="overwrite" type="boolean"/></PrimitiveProps><Props> |
| | | <Prop name="cachable" type="java.lang.Boolean"/> |
| | | <Prop name="acceptUnknownProperty" type="boolean"/> |
| | | <Prop name="acceptValidationState" defaultValue="ok" enumValues="info,ok,warn,error"/> |
| | | <Prop name="autoCreatePropertyDefs" type="boolean"/> |
| | | <Prop name="defaultDisplayProperty"/> |
| | | <Prop name="userData" editor="any" type="java.lang.Object"/></Props><ClientEvents> |
| | | <ClientEvent name="onEntityToText" parameters="self,arg"/> |
| | | <ClientEvent name="onAttributeChange" parameters="self,arg"/> |
| | | <ClientEvent name="beforeInsert" parameters="self,arg"/> |
| | | <ClientEvent name="beforeDataChange" parameters="self,arg"/> |
| | | <ClientEvent name="onDataChange" parameters="self,arg"/> |
| | | <ClientEvent name="beforeCurrentChange" parameters="self,arg"/> |
| | | <ClientEvent name="onCurrentChange" parameters="self,arg"/> |
| | | <ClientEvent name="beforeStateChange" parameters="self,arg"/> |
| | | <ClientEvent name="beforeRemove" parameters="self,arg"/> |
| | | <ClientEvent name="onMessageChange" parameters="self,arg"/> |
| | | <ClientEvent name="onStateChange" parameters="self,arg"/> |
| | | <ClientEvent name="onRemove" parameters="self,arg"/> |
| | | <ClientEvent name="onEntityLoad" parameters="self,arg"/> |
| | | <ClientEvent name="onInsert" parameters="self,arg"/></ClientEvents></Rule><Rule name="BasePropertyDef" parents="com.bstek.dorado.data.type.property.PropertyDefSupport" label="PropertyDef" nodeName="PropertyDef" type="com.bstek.dorado.data.type.property.BasePropertyDef" scope="protected" icon="/com/bstek/dorado/data/type/property/BasePropertyDef.png"><Props> |
| | | <Prop name="propertyPath"/></Props></Rule><Rule name="PropertyDef" abstract="true" type="com.bstek.dorado.data.type.property.PropertyDef"><PrimitiveProps> |
| | | <Prop name="name"/></PrimitiveProps><Props> |
| | | <Prop name="acceptUnknownMapKey" type="boolean"/> |
| | | <Prop name="dataType" highlight="1" type="com.bstek.dorado.data.type.DataType"/> |
| | | <Prop name="defaultValue" type="java.lang.Object"/> |
| | | <Prop name="displayFormat"/> |
| | | <Prop name="ignored" type="boolean"/> |
| | | <Prop name="label" highlight="1"/><Prop name="mapping" type="com.bstek.dorado.data.type.property.Mapping" compositeType="Fixed"> |
| | | <Prop name="keyProperty"/> |
| | | <Prop name="mapValues" editor="collection[pojo]" type="java.lang.Object"/> |
| | | <Prop name="valueProperty"/></Prop><Prop name="metaData" type="java.util.Map" compositeType="Open"></Prop> |
| | | <Prop name="readOnly" type="boolean"/> |
| | | <Prop name="required" type="boolean"/> |
| | | <Prop name="submittable" defaultValue="true" type="boolean"/> |
| | | <Prop name="tags"/> |
| | | <Prop name="userData" editor="any" type="java.lang.Object"/> |
| | | <Prop name="visible" defaultValue="true" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onGet" parameters="self,arg"/> |
| | | <ClientEvent name="onSet" parameters="self,arg"/> |
| | | <ClientEvent name="onValidate" parameters="self,arg"/> |
| | | <ClientEvent name="onGetText" parameters="self,arg"/></ClientEvents><Children><Child rule="Validator" name="Validators" aggregated="true"></Child></Children></Rule><Rule name="Validator" abstract="true" nodeName="Validator" type="com.bstek.dorado.data.type.validator.Validator" icon="/com/bstek/dorado/view/type/property/validator/Validator.png"><PrimitiveProps> |
| | | <Prop name="name"/></PrimitiveProps></Rule><Rule name="Reference" parents="LazyPropertyDef" label="Reference" type="com.bstek.dorado.data.type.property.Reference" icon="/com/bstek/dorado/data/type/property/Reference.png"><Props> |
| | | <Prop name="activeOnNewEntity" type="boolean"/> |
| | | <Prop name="dataProvider" highlight="1" type="com.bstek.dorado.data.provider.DataProvider"/> |
| | | <Prop name="pageSize" type="int"/> |
| | | <Prop name="parameter" highlight="1" editor="pojo" type="java.lang.Object"/></Props><ClientEvents> |
| | | <ClientEvent name="beforeLoadData" parameters="self,arg"/> |
| | | <ClientEvent name="onLoadData" parameters="self,arg"/></ClientEvents></Rule><Rule name="PropertyDefSupport" parents="PropertyDef" abstract="true" type="com.bstek.dorado.data.type.property.PropertyDefSupport"></Rule><Rule name="LazyPropertyDef" parents="PropertyDefSupport" abstract="true" type="com.bstek.dorado.data.type.property.LazyPropertyDef"><Props> |
| | | <Prop name="activeAtClient" defaultValue="true" type="boolean"/> |
| | | <Prop name="cacheMode" enumValues="noCache,serverSide,clientSide,bothSides"/></Props></Rule><Rule name="com.bstek.dorado.data.type.property.PropertyDefSupport" parents="PropertyDef" abstract="true" type="com.bstek.dorado.data.type.property.PropertyDefSupport"></Rule><Rule name="DirectDataProvider" parents="AbstractDataProvider" label="DirectDataProvider" type="com.bstek.dorado.data.provider.DirectDataProvider" scope="public" sortFactor="2" icon="/com/bstek/dorado/data/provider/DirectDataProvider.png" reserve="direct"><PrimitiveProps> |
| | | <Prop name="type" defaultValue="direct" fixed="true" visible="false"/></PrimitiveProps><Props> |
| | | <Prop name="result" editor="pojo" type="java.lang.Object"/></Props></Rule><Rule name="DirectDataResolver" parents="AbstractDataResolver" label="DirectDataResolver" type="com.bstek.dorado.data.resolver.DirectDataResolver" scope="public" sortFactor="3" icon="/com/bstek/dorado/data/resolver/DirectDataResolver.png" reserve="direct"><PrimitiveProps> |
| | | <Prop name="type" defaultValue="direct" fixed="true" visible="false"/></PrimitiveProps></Rule><Rule name="AbstractValidator" parents="Validator" abstract="true" nodeName="Validator" type="com.bstek.dorado.view.type.property.validator.AbstractValidator" icon="/com/bstek/dorado/view/type/property/validator/Validator.png"><Props> |
| | | <Prop name="name"/> |
| | | <Prop name="defaultResultState" defaultValue="error" enumValues="info,ok,warn,error"/> |
| | | <Prop name="revalidateOldValue" defaultValue="true" type="boolean"/> |
| | | <Prop name="runAt" enumValues="server,client,both"/></Props></Rule><Rule name="RequiredValidator" parents="BaseValidator" label="RequiredValidator" type="com.bstek.dorado.view.type.property.validator.RequiredValidator" scope="public" sortFactor="4" reserve="required"><PrimitiveProps> |
| | | <Prop name="type" defaultValue="required" fixed="true" visible="false"/></PrimitiveProps><Props> |
| | | <Prop name="acceptZeroOrFalse" type="boolean"/> |
| | | <Prop name="trimBeforeValid" defaultValue="true" type="boolean"/></Props></Rule><Rule name="BaseValidator" parents="AbstractValidator" abstract="true" type="com.bstek.dorado.view.type.property.validator.BaseValidator"><Props> |
| | | <Prop name="resultMessage"/></Props></Rule><Rule name="LengthValidator" parents="BaseValidator" label="LengthValidator" type="com.bstek.dorado.view.type.property.validator.LengthValidator" scope="public" sortFactor="5" reserve="length"><PrimitiveProps> |
| | | <Prop name="type" defaultValue="length" fixed="true" visible="false"/></PrimitiveProps><Props> |
| | | <Prop name="maxLength" defaultValue="-1" type="int"/> |
| | | <Prop name="minLength" defaultValue="-1" type="int"/></Props></Rule><Rule name="CharLengthValidator" parents="BaseValidator" label="CharLengthValidator" type="com.bstek.dorado.view.type.property.validator.CharLengthValidator" scope="public" sortFactor="6" reserve="charLength"><PrimitiveProps> |
| | | <Prop name="type" defaultValue="charLength" fixed="true" visible="false"/></PrimitiveProps><Props> |
| | | <Prop name="maxLength" type="int"/> |
| | | <Prop name="minLength" type="int"/></Props></Rule><Rule name="RangeValidator" parents="BaseValidator" label="RangeValidator" type="com.bstek.dorado.view.type.property.validator.RangeValidator" scope="public" sortFactor="7" reserve="range"><PrimitiveProps> |
| | | <Prop name="type" defaultValue="range" fixed="true" visible="false"/></PrimitiveProps><Props> |
| | | <Prop name="maxValue" defaultValue="-1" type="double"/> |
| | | <Prop name="maxValueValidateMode" defaultValue="ignore" enumValues="allowEquals,notAllowEquals,ignore"/> |
| | | <Prop name="minValue" defaultValue="-1" type="double"/> |
| | | <Prop name="minValueValidateMode" defaultValue="ignore" enumValues="allowEquals,notAllowEquals,ignore"/></Props></Rule><Rule name="EnumValidator" parents="BaseValidator" label="EnumValidator" type="com.bstek.dorado.view.type.property.validator.EnumValidator" scope="public" sortFactor="8" reserve="enum"><PrimitiveProps> |
| | | <Prop name="type" defaultValue="enum" fixed="true" visible="false"/></PrimitiveProps><Props> |
| | | <Prop name="enumValues" highlight="1" editor="collection[value]" type="java.util.List"/></Props></Rule><Rule name="RegExpValidator" parents="BaseValidator" label="RegExpValidator" type="com.bstek.dorado.view.type.property.validator.RegExpValidator" scope="public" sortFactor="9" reserve="regExp"><PrimitiveProps> |
| | | <Prop name="type" defaultValue="regExp" fixed="true" visible="false"/></PrimitiveProps><Props> |
| | | <Prop name="blackRegExp"/> |
| | | <Prop name="validateMode" enumValues="whiteBlack,blackWhite"/> |
| | | <Prop name="whiteRegExp"/></Props></Rule><Rule name="AjaxValidator" parents="AbstractAjaxValidator" label="AjaxValidator" type="com.bstek.dorado.view.type.property.validator.AjaxValidator" scope="public" sortFactor="10" reserve="ajax"><PrimitiveProps> |
| | | <Prop name="type" defaultValue="ajax" fixed="true" visible="false"/></PrimitiveProps><Props> |
| | | <Prop name="ajaxAction" reference="AjaxAction:id"/> |
| | | <Prop name="service" highlight="1"/></Props><ClientEvents> |
| | | <ClientEvent name="beforeExecute" parameters="self,arg"/></ClientEvents></Rule><Rule name="AbstractAjaxValidator" parents="AbstractValidator" abstract="true" type="com.bstek.dorado.view.type.property.validator.AbstractAjaxValidator"><Props> |
| | | <Prop name="async" defaultValue="true" type="boolean"/> |
| | | <Prop name="executingMessage"/></Props></Rule><Rule name="CustomValidator" parents="AbstractValidator" label="CustomValidator" type="com.bstek.dorado.view.type.property.validator.CustomValidator" scope="public" sortFactor="11" reserve="custom"><PrimitiveProps> |
| | | <Prop name="type" defaultValue="custom" fixed="true" visible="false"/></PrimitiveProps><ClientEvents> |
| | | <ClientEvent name="onValidate" parameters="self,arg"/></ClientEvents></Rule><Rule name="AnchorLayout" parents="Layout" label="AnchorLayout" nodeName="anchor" type="com.bstek.dorado.view.widget.layout.AnchorLayout" sortFactor="1001"></Rule><Rule name="Layout" abstract="true" type="com.bstek.dorado.view.widget.layout.Layout"><Props> |
| | | <Prop name="className"/> |
| | | <Prop name="padding" type="int"/></Props></Rule><Rule name="AnchorLayoutConstraint" parents="LayoutConstraintSupport" label="AnchorLayoutConstraint" type="com.bstek.dorado.view.widget.layout.AnchorLayoutConstraint"><Props> |
| | | <Prop name="anchorBottom" enumValues="auto,none,container,previous"/> |
| | | <Prop name="anchorLeft" enumValues="auto,none,container,previous"/> |
| | | <Prop name="anchorRight" enumValues="auto,none,container,previous"/> |
| | | <Prop name="anchorTop" enumValues="auto,none,container,previous"/> |
| | | <Prop name="bottom"/> |
| | | <Prop name="heightOffset" type="int"/> |
| | | <Prop name="left"/> |
| | | <Prop name="leftOffset" type="int"/> |
| | | <Prop name="right"/> |
| | | <Prop name="top"/> |
| | | <Prop name="topOffset" type="int"/> |
| | | <Prop name="widthOffset" type="int"/></Props></Rule><Rule name="LayoutConstraintSupport" abstract="true" type="com.bstek.dorado.view.widget.layout.LayoutConstraintSupport"><Props> |
| | | <Prop name="padding" type="int"/></Props></Rule><Rule name="DockLayout" parents="Layout" label="DockLayout" nodeName="dock" type="com.bstek.dorado.view.widget.layout.DockLayout" sortFactor="1002"><Props> |
| | | <Prop name="regionPadding" type="int"/></Props></Rule><Rule name="DockLayoutConstraint" parents="LayoutConstraintSupport" label="DockLayoutConstraint" type="com.bstek.dorado.view.widget.layout.DockLayoutConstraint"><Props> |
| | | <Prop name="type" highlight="1" enumValues="left,top,right,bottom,center"/></Props></Rule><Rule name="HboxLayout" parents="AbstractBoxLayout" label="HBoxLayout" nodeName="hbox" type="com.bstek.dorado.view.widget.layout.HBoxLayout" sortFactor="1003"><Props> |
| | | <Prop name="align" defaultValue="center" enumValues="top,center,bottom"/></Props></Rule><Rule name="AbstractBoxLayout" parents="Layout" abstract="true" type="com.bstek.dorado.view.widget.layout.AbstractBoxLayout"><Props> |
| | | <Prop name="pack" defaultValue="start" enumValues="start,center,end"/> |
| | | <Prop name="padding" defaultValue="2" type="int"/> |
| | | <Prop name="regionPadding" defaultValue="2" type="int"/> |
| | | <Prop name="stretch" defaultValue="true" type="boolean"/></Props></Rule><Rule name="HboxLayoutConstraint" parents="LayoutConstraintSupport" label="HBoxLayoutConstraintSupport" type="com.bstek.dorado.view.widget.layout.HBoxLayoutConstraintSupport"><Props> |
| | | <Prop name="align" defaultValue="center" enumValues="top,center,bottom"/></Props></Rule><Rule name="VboxLayout" parents="AbstractBoxLayout" label="VBoxLayout" nodeName="vbox" type="com.bstek.dorado.view.widget.layout.VBoxLayout" sortFactor="1004"><Props> |
| | | <Prop name="align" defaultValue="left" enumValues="left,center,right"/> |
| | | <Prop name="lazyRenderChild" type="boolean"/></Props></Rule><Rule name="VboxLayoutConstraint" parents="LayoutConstraintSupport" label="VBoxLayoutConstraintSupport" type="com.bstek.dorado.view.widget.layout.VBoxLayoutConstraintSupport"><Props> |
| | | <Prop name="align" defaultValue="left" enumValues="left,center,right"/></Props></Rule><Rule name="FormLayout" parents="Layout" label="FormLayout" nodeName="form" type="com.bstek.dorado.view.widget.layout.FormLayout" sortFactor="1005"><Props> |
| | | <Prop name="colPadding" defaultValue="6" type="int"/> |
| | | <Prop name="cols" highlight="1"/> |
| | | <Prop name="padding" defaultValue="8" type="int"/> |
| | | <Prop name="rowHeight" type="int"/> |
| | | <Prop name="rowPadding" defaultValue="6" type="int"/> |
| | | <Prop name="stretchWidth" type="boolean"/></Props></Rule><Rule name="FormLayoutConstraint" parents="LayoutConstraintSupport" label="FormLayoutConstraint" type="com.bstek.dorado.view.widget.layout.FormLayoutConstraint"><Props> |
| | | <Prop name="align" defaultValue="left" enumValues="left,center,right"/> |
| | | <Prop name="colSpan" type="int"/> |
| | | <Prop name="rowSpan" type="int"/> |
| | | <Prop name="vAlign" defaultValue="top" enumValues="top,center,bottom"/></Props></Rule><Rule name="NativeLayout" parents="Layout" label="NativeLayout" nodeName="native" type="com.bstek.dorado.view.widget.layout.NativeLayout" sortFactor="1006"><Props> |
| | | <Prop name="lazyRenderChild" type="boolean"/> |
| | | <Prop name="style"/></Props></Rule><Rule name="NativeLayoutConstraint" parents="HashMap" label="CommonLayoutConstraint" type="com.bstek.dorado.view.widget.layout.CommonLayoutConstraint"></Rule><Rule name="AbstractMap" abstract="true" type="java.util.AbstractMap"></Rule><Rule name="HashMap" parents="AbstractMap" label="HashMap" type="java.util.HashMap"></Rule><Rule name="DataSet" parents="Component" label="DataSet" nodeName="DataSet" type="com.bstek.dorado.view.widget.data.DataSet" sortFactor="2001" category="General" icon="/com/bstek/dorado/view/widget/data/DataSet.png" autoGenerateId="true" clientTypes="desktop,touch"><PrimitiveProps> |
| | | <Prop name="listener"/></PrimitiveProps><Props> |
| | | <Prop name="cacheable" type="boolean"/> |
| | | <Prop name="dataProvider" highlight="1" type="com.bstek.dorado.data.provider.DataProvider"/> |
| | | <Prop name="dataType" highlight="1" type="com.bstek.dorado.data.type.DataType"/> |
| | | <Prop name="loadMode" defaultValue="lazy" enumValues="preload,onCreate,onReady,lazy,manual"/> |
| | | <Prop name="pageSize" type="int"/> |
| | | <Prop name="parameter" highlight="1" editor="any" type="java.lang.Object"/> |
| | | <Prop name="readOnly" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onLoadData" parameters="self,arg"/> |
| | | <ClientEvent name="beforeLoadData" parameters="self,arg"/> |
| | | <ClientEvent name="onDataLoad" parameters="self,arg" deprecated="true"/></ClientEvents></Rule><Rule name="Control" parents="com.bstek.dorado.view.widget.Control" label="Control" nodeName="Control" type="com.bstek.dorado.view.widget.DefaultControl" sortFactor="2002" category="General" clientTypes="desktop,touch"></Rule><Rule name="Container" parents="com.bstek.dorado.view.widget.Control" label="Container" type="com.bstek.dorado.view.widget.Container" sortFactor="2003" category="General" icon="/com/bstek/dorado/view/widget/Container.png" clientTypes="desktop,touch"><PrimitiveProps> |
| | | <Prop name="listener"/></PrimitiveProps><Props> |
| | | <Prop name="containerUi" defaultValue="default" enumValues="default,optional1"/> |
| | | <Prop name="contentOverflow" enumValues="visible,hidden,scroll,auto"/> |
| | | <Prop name="contentOverflowX" enumValues="visible,hidden,scroll,auto"/> |
| | | <Prop name="contentOverflowY" enumValues="visible,hidden,scroll,auto"/> |
| | | <Prop name="layout" visible="false" type="com.bstek.dorado.view.widget.layout.Layout"/></Props><Children><Child rule="Component" name="Children" aggregated="true"></Child></Children></Rule><Rule name="HtmlContainer" parents="Container" label="HtmlContainer" type="com.bstek.dorado.view.widget.HtmlContainer" sortFactor="2004" category="General" icon="/com/bstek/dorado/view/widget/HtmlContainer.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="containerExpression"/> |
| | | <Prop name="content" editor="multiLines"/> |
| | | <Prop name="contentFile"/></Props></Rule><Rule name="SubViewHolder" parents="com.bstek.dorado.view.widget.Control" label="SubViewHolder" type="com.bstek.dorado.view.widget.SubViewHolder" sortFactor="2005" category="General" icon="/com/bstek/dorado/view/widget/SubViewHolder.png" clientTypes="desktop,touch"><Props><Prop name="context" type="java.util.Map" compositeType="Open"></Prop> |
| | | <Prop name="loadMode" enumValues="preload,lazy,manual"/> |
| | | <Prop name="subView"/></Props><ClientEvents> |
| | | <ClientEvent name="beforeLoad" parameters="self,arg"/> |
| | | <ClientEvent name="onLoad" parameters="self,arg"/> |
| | | <ClientEvent name="onLoadFailure" parameters="self,arg"/></ClientEvents></Rule><Rule name="Action" parents="Component" label="Action" type="com.bstek.dorado.view.widget.action.Action" sortFactor="2006" category="Action" icon="/com/bstek/dorado/view/widget/action/Action.png" autoGenerateId="true" clientTypes="desktop,touch"><Props> |
| | | <Prop name="caption"/> |
| | | <Prop name="confirmMessage"/> |
| | | <Prop name="disabled" type="boolean"/> |
| | | <Prop name="hotkey" enumValues="f1,f2,ctrl+s,alt+s,shift+s,ctrl+alt+shift+s,return,space,backspace,left,right,up,down"/> |
| | | <Prop name="icon"/> |
| | | <Prop name="iconClass"/> |
| | | <Prop name="parameter" editor="any" type="java.lang.Object"/> |
| | | <Prop name="successMessage"/> |
| | | <Prop name="tip"/></Props><ClientEvents> |
| | | <ClientEvent name="onExecute" parameters="self,arg"/> |
| | | <ClientEvent name="beforeExecute" parameters="self,arg"/> |
| | | <ClientEvent name="onFailure" parameters="self,arg"/> |
| | | <ClientEvent name="onSuccess" parameters="self,arg"/></ClientEvents></Rule><Rule name="AjaxAction" parents="AsyncAction" label="AjaxAction" type="com.bstek.dorado.view.widget.action.AjaxAction" sortFactor="2007" category="Action" icon="/com/bstek/dorado/view/widget/action/AjaxAction.png" autoGenerateId="true" clientTypes="desktop,touch"><Props> |
| | | <Prop name="batchable" defaultValue="true" type="boolean"/> |
| | | <Prop name="service" highlight="1"/> |
| | | <Prop name="supportsEntity" defaultValue="true" type="boolean"/> |
| | | <Prop name="timeout" type="long"/></Props></Rule><Rule name="UpdateAction" parents="AsyncAction" label="UpdateAction" type="com.bstek.dorado.view.widget.action.UpdateAction" sortFactor="2008" category="Action" icon="/com/bstek/dorado/view/widget/action/UpdateAction.png" autoGenerateId="true" clientTypes="desktop,touch"><Props> |
| | | <Prop name="alwaysExecute" type="boolean"/> |
| | | <Prop name="dataResolver" highlight="1" type="com.bstek.dorado.data.resolver.DataResolver"/> |
| | | <Prop name="executingMessage"/></Props><ClientEvents> |
| | | <ClientEvent name="onGetUpdateData" parameters="self,arg"/></ClientEvents><Children><Child rule="UpdateItem" name="UpdateItems" aggregated="true"></Child></Children></Rule><Rule name="FormSubmitAction" parents="Action" label="FormSubmitAction" type="com.bstek.dorado.view.widget.action.FormSubmitAction" sortFactor="2009" category="Action" icon="/com/bstek/dorado/view/widget/action/FormSubmitAction.png" autoGenerateId="true" clientTypes="desktop,touch"><Props> |
| | | <Prop name="action"/> |
| | | <Prop name="method" defaultValue="post" enumValues="post,get"/> |
| | | <Prop name="target"/></Props></Rule><Rule name="LongTask" parents="Action" label="LongTask" type="com.bstek.dorado.view.widget.action.LongTask" sortFactor="2010" category="Action" autoGenerateId="true" clientTypes="desktop,touch"><Props> |
| | | <Prop name="appearence" defaultValue="daemonTask" enumValues="none,daemonTask,mainTask"/> |
| | | <Prop name="disableOnActive" defaultValue="true" type="boolean"/> |
| | | <Prop name="taskName" highlight="1"/></Props><ClientEvents> |
| | | <ClientEvent name="onTaskScheduled" parameters="self,arg"/> |
| | | <ClientEvent name="onTaskEnd" parameters="self,arg"/> |
| | | <ClientEvent name="onLog" parameters="self,arg"/> |
| | | <ClientEvent name="onStateChange" parameters="self,arg"/></ClientEvents></Rule><Rule name="Button" parents="AbstractButton" label="Button" type="com.bstek.dorado.view.widget.base.Button" sortFactor="2011" category="General" icon="/com/bstek/dorado/view/widget/base/Button.png" clientTypes="desktop"><Props> |
| | | <Prop name="caption" highlight="1"/> |
| | | <Prop name="height" visible="false"/> |
| | | <Prop name="icon"/> |
| | | <Prop name="iconClass"/> |
| | | <Prop name="showTrigger" type="boolean"/> |
| | | <Prop name="splitButton" type="boolean"/> |
| | | <Prop name="triggerToggled" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onTriggerClick" parameters="self,arg"/></ClientEvents></Rule><Rule name="SimpleButton" parents="AbstractButton" label="SimpleButton" type="com.bstek.dorado.view.widget.base.SimpleButton" sortFactor="2012" category="General" icon="/com/bstek/dorado/view/widget/base/SimpleButton.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="disabledClassName"/> |
| | | <Prop name="hoverClassName"/> |
| | | <Prop name="mouseDownClassName"/> |
| | | <Prop name="toggledClassName"/></Props></Rule><Rule name="SimpleIconButton" parents="SimpleButton" label="SimpleIconButton" type="com.bstek.dorado.view.widget.base.SimpleIconButton" sortFactor="2013" category="General" icon="/com/bstek/dorado/view/widget/base/SimpleIconButton.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="icon" highlight="1"/> |
| | | <Prop name="iconClass"/> |
| | | <Prop name="showTrigger" type="boolean"/></Props></Rule><Rule name="Panel" parents="AbstractPanel" label="Panel" type="com.bstek.dorado.view.widget.base.Panel" sortFactor="2014" category="General" icon="/com/bstek/dorado/view/widget/base/Panel.png" clientTypes="desktop"><Props> |
| | | <Prop name="background"/> |
| | | <Prop name="border" defaultValue="normal" enumValues="none,normal,curve" deprecated="true"/> |
| | | <Prop name="closeAction" defaultValue="hide" enumValues="hide,close"/> |
| | | <Prop name="closeable" type="boolean"/> |
| | | <Prop name="collapseable" defaultValue="false" type="boolean"/> |
| | | <Prop name="icon"/> |
| | | <Prop name="iconClass"/> |
| | | <Prop name="maximizeable" type="boolean"/> |
| | | <Prop name="maximized" type="boolean"/> |
| | | <Prop name="showCaptionBar" type="java.lang.Boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onMaximize" parameters="self,arg"/> |
| | | <ClientEvent name="beforeMaximize" parameters="self,arg"/></ClientEvents><Children><Child name="Tools" fixed="true"><Rule name="Wrapper.Tools" label="Tools" nodeName="Tools" icon="/com/bstek/dorado/view/widget/base/Tools.png"><Children><Child rule="SimpleIconButton" name="Tools" aggregated="true"></Child></Children></Rule></Child></Children></Rule><Rule name="GroupBox" parents="AbstractPanel" label="GroupBox" type="com.bstek.dorado.view.widget.base.GroupBox" sortFactor="2015" category="General" icon="/com/bstek/dorado/view/widget/base/GroupBox.png" clientTypes="desktop"></Rule><Rule name="FieldSet" parents="AbstractPanel" label="FieldSet" type="com.bstek.dorado.view.widget.base.FieldSet" sortFactor="2016" category="General" icon="/com/bstek/dorado/view/widget/base/FieldSet.png" clientTypes="desktop"></Rule><Rule name="IFrame" parents="com.bstek.dorado.view.widget.Control" label="IFrame" type="com.bstek.dorado.view.widget.base.IFrame" sortFactor="2017" category="General" icon="/com/bstek/dorado/view/widget/base/IFrame.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="name"/> |
| | | <Prop name="path"/></Props><ClientEvents> |
| | | <ClientEvent name="onLoad" parameters="self,arg"/></ClientEvents></Rule><Rule name="CardBook" parents="com.bstek.dorado.view.widget.Control" label="CardBook" type="com.bstek.dorado.view.widget.base.CardBook" sortFactor="2018" category="General" icon="/com/bstek/dorado/view/widget/base/CardBook.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="currentControl" deprecated="true" visible="false" type="int"/> |
| | | <Prop name="currentIndex" type="int"/> |
| | | <Prop name="dynaHeight" defaultValue="false" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="beforeCurrentChange" parameters="self,arg"/> |
| | | <ClientEvent name="onCurrentChange" parameters="self,arg"/></ClientEvents><Children><Child rule="com.bstek.dorado.view.widget.Control" name="Controls" aggregated="true"></Child></Children></Rule><Rule name="TabControl" parents="TabBar" label="TabControl" type="com.bstek.dorado.view.widget.base.tab.TabControl" sortFactor="2019" category="General" icon="/com/bstek/dorado/view/widget/base/tab/TabControl.png" clientTypes="desktop"><Props> |
| | | <Prop name="dynaHeight" defaultValue="false" type="boolean"/></Props><Children><Child rule="ControlTab" name="ControlTab" aggregated="true"></Child><Child rule="IFrameTab" name="IFrameTab" aggregated="true"></Child></Children></Rule><Rule name="VerticalTabControl" parents="TabColumn" label="VerticalTabControl" type="com.bstek.dorado.view.widget.base.tab.VerticalTabControl" sortFactor="2020" category="General" icon="/com/bstek/dorado/view/widget/base/tab/VerticalTabControl.png" clientTypes="desktop"><Props> |
| | | <Prop name="tabColumnWidth" defaultValue="200" type="int"/></Props><Children><Child rule="ControlTab" name="ControlTab" aggregated="true"></Child><Child rule="IFrameTab" name="IFrameTab" aggregated="true"></Child></Children></Rule><Rule name="TabBar" parents="AbstractTabControl" label="TabBar" type="com.bstek.dorado.view.widget.base.tab.TabBar" sortFactor="2021" category="General" icon="/com/bstek/dorado/view/widget/base/tab/TabBar.png" clientTypes="desktop"><Props> |
| | | <Prop name="showMenuButton" type="boolean"/> |
| | | <Prop name="tabMinWidth" type="int"/> |
| | | <Prop name="tabPlacement" defaultValue="top" enumValues="top,bottom"/></Props><Children><Child rule="Tab" name="Tab" aggregated="true" public="false"></Child></Children></Rule><Rule name="TabColumn" parents="AbstractTabControl" label="TabColumn" type="com.bstek.dorado.view.widget.base.tab.TabColumn" sortFactor="2022" category="General" icon="/com/bstek/dorado/view/widget/base/tab/TabColumn.png" clientTypes="desktop"><Props> |
| | | <Prop name="tabPlacement" defaultValue="left" enumValues="left,right"/> |
| | | <Prop name="verticalText" type="boolean"/></Props><Children><Child rule="Tab" name="Tab" aggregated="true" public="false"></Child></Children></Rule><Rule name="ToolBar" parents="com.bstek.dorado.view.widget.Control" label="ToolBar" type="com.bstek.dorado.view.widget.base.toolbar.ToolBar" sortFactor="2023" category="General" icon="/com/bstek/dorado/view/widget/base/toolbar/ToolBar.png" clientTypes="desktop"><Props> |
| | | <Prop name="fixRight" type="boolean"/> |
| | | <Prop name="height" visible="false"/> |
| | | <Prop name="showMenuOnHover" defaultValue="false" type="boolean"/></Props><Children><Child rule="com.bstek.dorado.view.widget.base.toolbar.Label" name="ToolBarLabel" aggregated="true"></Child><Child rule="MenuButton" name="MenuButton" aggregated="true"></Child><Child rule="Fill" name="Fill" aggregated="true"></Child><Child rule="com.bstek.dorado.view.widget.base.toolbar.Button" name="ToolBarButton" aggregated="true"></Child><Child rule="com.bstek.dorado.view.widget.base.toolbar.Separator" name="Separator" aggregated="true"></Child><Child rule="com.bstek.dorado.view.widget.Control" name="Items" aggregated="true"></Child></Children></Rule><Rule name="SplitPanel" parents="com.bstek.dorado.view.widget.Control" label="SplitPanel" type="com.bstek.dorado.view.widget.base.SplitPanel" sortFactor="2024" category="General" icon="/com/bstek/dorado/view/widget/base/SplitPanel.png" clientTypes="desktop"><Props> |
| | | <Prop name="animate" type="java.lang.Boolean"/> |
| | | <Prop name="collapseBothSide" defaultValue="false" type="boolean"/> |
| | | <Prop name="collapseable" defaultValue="true" type="boolean"/> |
| | | <Prop name="collapsed" type="boolean"/> |
| | | <Prop name="direction" defaultValue="left" highlight="1" enumValues="left,top,right,bottom"/> |
| | | <Prop name="maxPosition" type="int"/> |
| | | <Prop name="minPosition" type="int"/> |
| | | <Prop name="openPreviewOnHover" defaultValue="false" type="boolean"/> |
| | | <Prop name="position" defaultValue="100" highlight="1"/> |
| | | <Prop name="previewable" type="boolean"/> |
| | | <Prop name="resizeable" defaultValue="true" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onCollapsedChange" parameters="self,arg"/> |
| | | <ClientEvent name="beforeCollapsedChange" parameters="self,arg"/></ClientEvents><Children><Child name="MainControl" fixed="true"><Rule name="Wrapper.MainControl" label="MainControl" nodeName="MainControl" icon="/com/bstek/dorado/view/widget/base/MainControl.png"><Children><Child rule="com.bstek.dorado.view.widget.Control" name="MainControl"></Child></Children></Rule></Child><Child name="SideControl" fixed="true"><Rule name="Wrapper.SideControl" label="SideControl" nodeName="SideControl" icon="/com/bstek/dorado/view/widget/base/SideControl.png"><Children><Child rule="com.bstek.dorado.view.widget.Control" name="SideControl"></Child></Children></Rule></Child></Children></Rule><Rule name="Accordion" parents="com.bstek.dorado.view.widget.Control" label="Accordion" type="com.bstek.dorado.view.widget.base.accordion.Accordion" sortFactor="2025" category="General" icon="/com/bstek/dorado/view/widget/base/accordion/Accordion.png" clientTypes="desktop"><Props> |
| | | <Prop name="animate" type="java.lang.Boolean"/> |
| | | <Prop name="currentSection" type="int"/> |
| | | <Prop name="dynaHeight" defaultValue="false" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="beforeCurrentSectionChange" parameters="self,arg"/> |
| | | <ClientEvent name="onCurrentSectionChange" parameters="self,arg"/></ClientEvents><Children><Child rule="Section" name="Sections" aggregated="true"></Child></Children></Rule><Rule name="Slider" parents="com.bstek.dorado.view.widget.Control" label="Slider" type="com.bstek.dorado.view.widget.base.Slider" sortFactor="2026" category="General" icon="/com/bstek/dorado/view/widget/base/Slider.png" clientTypes="desktop"><Props> |
| | | <Prop name="maxValue" defaultValue="100" type="float"/> |
| | | <Prop name="minValue" type="float"/> |
| | | <Prop name="orientation" defaultValue="horizental" enumValues="horizontal,horizontal,vertical"/> |
| | | <Prop name="precision" type="int"/> |
| | | <Prop name="step" type="float"/> |
| | | <Prop name="value" type="float"/></Props><ClientEvents> |
| | | <ClientEvent name="onValueChange" parameters="self,arg"/> |
| | | <ClientEvent name="beforeValueChange" parameters="self,arg"/></ClientEvents></Rule><Rule name="ProgressBar" parents="AbstractPropertyDataControl" label="ProgressBar" type="com.bstek.dorado.view.widget.base.ProgressBar" sortFactor="2027" category="General" icon="/com/bstek/dorado/view/widget/base/ProgressBar.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="effectEnable" type="boolean"/> |
| | | <Prop name="maxValue" defaultValue="100" type="float"/> |
| | | <Prop name="minValue" type="float"/> |
| | | <Prop name="showText" defaultValue="true" type="boolean"/> |
| | | <Prop name="textPattern" defaultValue="{percent}%"/> |
| | | <Prop name="value"/></Props></Rule><Rule name="Tip" parents="com.bstek.dorado.view.widget.Control,FloatControl" label="Tip" type="com.bstek.dorado.view.widget.base.Tip" sortFactor="2028" category="Floatable" icon="/com/bstek/dorado/view/widget/base/Tip.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="align" enumValues="left,innerleft,center,innerright,top" visible="false"/> |
| | | <Prop name="anchorTarget" visible="false"/> |
| | | <Prop name="animateTarget" visible="false"/> |
| | | <Prop name="animateType" defaultValue="fade" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="arrowAlign" defaultValue="center" enumValues="center,top,right,bottom,left"/> |
| | | <Prop name="arrowDirection" defaultValue="none" enumValues="top,right,bottom,left,none"/> |
| | | <Prop name="arrowOffset" type="int"/> |
| | | <Prop name="autoAdjustPosition" defaultValue="true" type="boolean"/> |
| | | <Prop name="caption"/> |
| | | <Prop name="center" type="boolean"/> |
| | | <Prop name="closeable" type="boolean"/> |
| | | <Prop name="content" type="java.lang.Object"/> |
| | | <Prop name="continuedFocus" defaultValue="true" type="boolean"/> |
| | | <Prop name="floating" defaultValue="true" type="boolean"/> |
| | | <Prop name="floatingClassName"/> |
| | | <Prop name="focusAfterShow" defaultValue="false" type="boolean"/> |
| | | <Prop name="handleOverflow" defaultValue="true" visible="false" type="boolean"/> |
| | | <Prop name="hideAnimateType" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="icon" enumValues="INFO,WARNING,ERROR,QUESTION"/> |
| | | <Prop name="left" type="int"/> |
| | | <Prop name="modal" type="boolean"/> |
| | | <Prop name="modalType" enumValues="dark,transparent"/> |
| | | <Prop name="offsetLeft" type="int"/> |
| | | <Prop name="offsetTop" type="int"/> |
| | | <Prop name="shadowMode" defaultValue="drop" enumValues="drop,sides,frame,none"/> |
| | | <Prop name="showAnimateType" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="showDuration" type="int"/> |
| | | <Prop name="text" editor="multilines"/> |
| | | <Prop name="top" type="int"/> |
| | | <Prop name="vAlign" enumValues="top,innertop,center,innerbottom,bottom" visible="false"/> |
| | | <Prop name="visible" type="java.lang.Boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onClose" parameters="self,arg"/> |
| | | <ClientEvent name="onShow" parameters="self,arg"/> |
| | | <ClientEvent name="beforeHide" parameters="self,arg"/> |
| | | <ClientEvent name="beforeClose" parameters="self,arg"/> |
| | | <ClientEvent name="beforeShow" parameters="self,arg"/> |
| | | <ClientEvent name="onHide" parameters="self,arg"/></ClientEvents></Rule><Rule name="FloatContainer" parents="Container,FloatControl" label="FloatContainer" type="com.bstek.dorado.view.widget.base.FloatContainer" sortFactor="2029" category="Floatable" icon="/com/bstek/dorado/view/widget/base/FloatContainer.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="align" enumValues="left,innerleft,center,innerright,top" visible="false"/> |
| | | <Prop name="anchorTarget" visible="false"/> |
| | | <Prop name="animateTarget" visible="false"/> |
| | | <Prop name="animateType" defaultValue="zoom" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="autoAdjustPosition" defaultValue="true" type="boolean"/> |
| | | <Prop name="center" type="boolean"/> |
| | | <Prop name="continuedFocus" defaultValue="true" type="boolean"/> |
| | | <Prop name="floating" defaultValue="true" type="boolean"/> |
| | | <Prop name="floatingClassName"/> |
| | | <Prop name="focusAfterShow" defaultValue="true" type="boolean"/> |
| | | <Prop name="handleOverflow" defaultValue="true" visible="false" type="boolean"/> |
| | | <Prop name="hideAnimateType" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="left" type="int"/> |
| | | <Prop name="modal" type="boolean"/> |
| | | <Prop name="modalType" enumValues="dark,transparent"/> |
| | | <Prop name="offsetLeft" type="int"/> |
| | | <Prop name="offsetTop" type="int"/> |
| | | <Prop name="shadowMode" defaultValue="sides" enumValues="drop,sides,frame,none"/> |
| | | <Prop name="showAnimateType" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="top" type="int"/> |
| | | <Prop name="vAlign" enumValues="top,innertop,center,innerbottom,bottom" visible="false"/> |
| | | <Prop name="visible" type="java.lang.Boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onClose" parameters="self,arg"/> |
| | | <ClientEvent name="onShow" parameters="self,arg"/> |
| | | <ClientEvent name="beforeHide" parameters="self,arg"/> |
| | | <ClientEvent name="beforeClose" parameters="self,arg"/> |
| | | <ClientEvent name="beforeShow" parameters="self,arg"/> |
| | | <ClientEvent name="onHide" parameters="self,arg"/></ClientEvents></Rule><Rule name="FloatPanel" parents="Panel,FloatControl" label="FloatPanel" type="com.bstek.dorado.view.widget.base.FloatPanel" sortFactor="2030" category="Floatable" icon="/com/bstek/dorado/view/widget/base/FloatPanel.png" clientTypes="desktop"><Props> |
| | | <Prop name="align" enumValues="left,innerleft,center,innerright,top" visible="false"/> |
| | | <Prop name="anchorTarget" visible="false"/> |
| | | <Prop name="animateTarget" visible="false"/> |
| | | <Prop name="animateType" defaultValue="zoom" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="autoAdjustPosition" defaultValue="true" type="boolean"/> |
| | | <Prop name="center" highlight="1" type="boolean"/> |
| | | <Prop name="continuedFocus" defaultValue="true" type="boolean"/> |
| | | <Prop name="floating" defaultValue="true" type="boolean"/> |
| | | <Prop name="floatingClassName"/> |
| | | <Prop name="focusAfterShow" defaultValue="true" type="boolean"/> |
| | | <Prop name="handleOverflow" defaultValue="true" visible="false" type="boolean"/> |
| | | <Prop name="hideAnimateType" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="left" type="int"/> |
| | | <Prop name="modal" highlight="1" type="boolean"/> |
| | | <Prop name="modalType" enumValues="dark,transparent"/> |
| | | <Prop name="offsetLeft" type="int"/> |
| | | <Prop name="offsetTop" type="int"/> |
| | | <Prop name="shadowMode" defaultValue="sides" enumValues="drop,sides,frame,none"/> |
| | | <Prop name="showAnimateType" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="top" type="int"/> |
| | | <Prop name="vAlign" enumValues="top,innertop,center,innerbottom,bottom" visible="false"/> |
| | | <Prop name="visible" type="java.lang.Boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onClose" parameters="self,arg"/> |
| | | <ClientEvent name="onShow" parameters="self,arg"/> |
| | | <ClientEvent name="beforeHide" parameters="self,arg"/> |
| | | <ClientEvent name="beforeClose" parameters="self,arg"/> |
| | | <ClientEvent name="beforeShow" parameters="self,arg"/> |
| | | <ClientEvent name="onHide" parameters="self,arg"/></ClientEvents></Rule><Rule name="Dialog" parents="FloatPanel" label="Dialog" type="com.bstek.dorado.view.widget.base.Dialog" sortFactor="2031" category="Floatable" icon="/com/bstek/dorado/view/widget/base/Dialog.png" clientTypes="desktop"><Props> |
| | | <Prop name="center" defaultValue="true" type="boolean"/> |
| | | <Prop name="closeable" defaultValue="true" type="boolean"/> |
| | | <Prop name="dragOutside" type="boolean"/> |
| | | <Prop name="draggable" defaultValue="true" type="boolean"/> |
| | | <Prop name="maxHeight" type="int"/> |
| | | <Prop name="maxWidth" type="int"/> |
| | | <Prop name="minHeight" type="int"/> |
| | | <Prop name="minWidth" type="int"/> |
| | | <Prop name="minimizeable" type="boolean"/> |
| | | <Prop name="minimized" type="boolean"/> |
| | | <Prop name="modal" defaultValue="true" type="boolean"/> |
| | | <Prop name="resizeable" defaultValue="true" type="boolean"/> |
| | | <Prop name="shadowMode" defaultValue="frame" enumValues="drop,sides,frame,none"/></Props><ClientEvents> |
| | | <ClientEvent name="onMinimize" parameters="self,arg"/> |
| | | <ClientEvent name="beforeMinimize" parameters="self,arg"/></ClientEvents></Rule><Rule name="Menu" parents="com.bstek.dorado.view.widget.Control,FloatControl" label="Menu" type="com.bstek.dorado.view.widget.base.menu.Menu" sortFactor="2032" category="Floatable" icon="/com/bstek/dorado/view/widget/base/menu/Menu.png" autoGenerateId="true" clientTypes="desktop"><Props> |
| | | <Prop name="align" enumValues="left,innerleft,center,innerright,top" visible="false"/> |
| | | <Prop name="anchorTarget" visible="false"/> |
| | | <Prop name="animateTarget" visible="false"/> |
| | | <Prop name="animateType" defaultValue="zoom" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="autoAdjustPosition" defaultValue="true" type="boolean"/> |
| | | <Prop name="center" type="boolean"/> |
| | | <Prop name="continuedFocus" defaultValue="true" type="boolean"/> |
| | | <Prop name="floating" defaultValue="true" type="boolean"/> |
| | | <Prop name="floatingClassName"/> |
| | | <Prop name="focusAfterShow" defaultValue="true" type="boolean"/> |
| | | <Prop name="handleOverflow" defaultValue="true" visible="false" type="boolean"/> |
| | | <Prop name="hideAnimateType" defaultValue="fade" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="iconPosition" defaultValue="left" enumValues="left,top"/> |
| | | <Prop name="left" type="int"/> |
| | | <Prop name="modal" type="boolean"/> |
| | | <Prop name="modalType" enumValues="dark,transparent"/> |
| | | <Prop name="offsetLeft" type="int"/> |
| | | <Prop name="offsetTop" type="int"/> |
| | | <Prop name="shadowMode" defaultValue="sides" enumValues="drop,sides,frame,none"/> |
| | | <Prop name="showAnimateType" defaultValue="slide" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="top" type="int"/> |
| | | <Prop name="vAlign" enumValues="top,innertop,center,innerbottom,bottom" visible="false"/> |
| | | <Prop name="visible" type="java.lang.Boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onClose" parameters="self,arg"/> |
| | | <ClientEvent name="onShow" parameters="self,arg"/> |
| | | <ClientEvent name="beforeHide" parameters="self,arg"/> |
| | | <ClientEvent name="beforeClose" parameters="self,arg"/> |
| | | <ClientEvent name="beforeShow" parameters="self,arg"/> |
| | | <ClientEvent name="onHide" parameters="self,arg"/> |
| | | <ClientEvent name="onHideTopMenu" parameters="self,arg"/></ClientEvents><Children><Child rule="BaseMenuItem" name="Items" aggregated="true"></Child></Children></Rule><Rule name="DatePicker" parents="com.bstek.dorado.view.widget.Control" label="DatePicker" nodeName="DatePicker" type="com.bstek.dorado.view.widget.base.DatePicker" sortFactor="2033" category="General" icon="/com/bstek/dorado/view/widget/base/DatePicker.png" clientTypes="desktop"><Props> |
| | | <Prop name="date" type="java.util.Date"/> |
| | | <Prop name="selectionMode" defaultValue="singleDate" enumValues="singleDate,multiDate"/> |
| | | <Prop name="showClearButton" defaultValue="true" type="boolean"/> |
| | | <Prop name="showConfirmButton" defaultValue="true" type="boolean"/> |
| | | <Prop name="showTimeSpinner" defaultValue="false" type="boolean"/> |
| | | <Prop name="showTodayButton" defaultValue="true" type="boolean"/> |
| | | <Prop name="yearMonthFormat"/></Props><ClientEvents> |
| | | <ClientEvent name="onFilterDate" parameters="self,arg"/> |
| | | <ClientEvent name="onClear" parameters="self,arg"/> |
| | | <ClientEvent name="onCancel" parameters="self,arg"/> |
| | | <ClientEvent name="onConfirm" parameters="self,arg"/> |
| | | <ClientEvent name="onRefreshDateCell" parameters="self,arg"/> |
| | | <ClientEvent name="onPick" parameters="self,arg"/></ClientEvents></Rule><Rule name="YearMonthPicker" parents="com.bstek.dorado.view.widget.Control" label="YearMonthPicker" nodeName="YearMonthPicker" type="com.bstek.dorado.view.widget.base.YearMonthPicker" sortFactor="2034" category="General" icon="/com/bstek/dorado/view/widget/base/YearMonthPicker.png" clientTypes="desktop"><Props> |
| | | <Prop name="month" type="int"/> |
| | | <Prop name="year" type="int"/></Props><ClientEvents> |
| | | <ClientEvent name="onPick" parameters="self,arg"/> |
| | | <ClientEvent name="onCancel" parameters="self,arg"/></ClientEvents></Rule><Rule name="Label" parents="AbstractPropertyDataControl" label="Label" type="com.bstek.dorado.view.widget.form.Label" sortFactor="2035" category="Form" icon="/com/bstek/dorado/view/widget/form/Label.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="text" highlight="1"/> |
| | | <Prop name="ui" enumValues="default,bold,h1,h2,h3"/></Props></Rule><Rule name="DataLabel" parents="AbstractPropertyDataControl" label="DataLabel" type="com.bstek.dorado.view.widget.form.DataLabel" sortFactor="2036" category="Form" icon="/com/bstek/dorado/view/widget/form/DataLabel.png" clientTypes="desktop,touch" deprecated="true"></Rule><Rule name="Link" parents="Label" label="Link" type="com.bstek.dorado.view.widget.form.Link" sortFactor="2037" category="Form" icon="/com/bstek/dorado/view/widget/form/Link.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="href"/> |
| | | <Prop name="target"/></Props></Rule><Rule name="Image" parents="AbstractPropertyDataControl" label="Image" type="com.bstek.dorado.view.widget.form.Image" sortFactor="2038" category="Form" icon="/com/bstek/dorado/view/widget/form/Image.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="blankImage"/> |
| | | <Prop name="image" highlight="1"/> |
| | | <Prop name="packMode" defaultValue="center" enumValues="start,center,end"/> |
| | | <Prop name="stretchMode" defaultValue="keepRatio" enumValues="fitWidth,fitHeight,keepRatio,fill,stretch,none"/></Props></Rule><Rule name="TemplateField" parents="AbstractDataControl" label="TemplateField" type="com.bstek.dorado.view.widget.form.TemplateField" sortFactor="2039" category="Form" icon="/com/bstek/dorado/view/widget/form/TemplateField.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="template" highlight="1" editor="multiLines"/></Props></Rule><Rule name="TextEditor" parents="AbstractTextEditor" label="TextEditor" type="com.bstek.dorado.view.widget.form.TextEditor" sortFactor="2040" category="Form" icon="/com/bstek/dorado/view/widget/form/TextEditor.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="dataType" type="com.bstek.dorado.data.type.DataType"/> |
| | | <Prop name="displayFormat"/><Prop name="mapping" type="com.bstek.dorado.data.type.property.Mapping" compositeType="Fixed"> |
| | | <Prop name="keyProperty"/> |
| | | <Prop name="mapValues" editor="collection[pojo]" type="java.lang.Object"/> |
| | | <Prop name="valueProperty"/></Prop> |
| | | <Prop name="password" visible="false" type="boolean"/> |
| | | <Prop name="typeFormat"/></Props></Rule><Rule name="PasswordEditor" parents="AbstractTextEditor" label="PasswordEditor" type="com.bstek.dorado.view.widget.form.PasswordEditor" sortFactor="2041" category="Form" icon="/com/bstek/dorado/view/widget/form/PasswordEditor.png" clientTypes="desktop,touch"></Rule><Rule name="TextArea" parents="AbstractTextEditor" label="TextArea" type="com.bstek.dorado.view.widget.form.TextArea" sortFactor="2042" category="Form" icon="/com/bstek/dorado/view/widget/form/TextArea.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="maxLength" type="int"/> |
| | | <Prop name="minLength" type="int"/> |
| | | <Prop name="required" type="boolean"/> |
| | | <Prop name="selectTextOnFocus" defaultValue="false" type="boolean"/> |
| | | <Prop name="text" editor="multiLines"/></Props></Rule><Rule name="CheckBox" parents="AbstractDataEditor" label="CheckBox" type="com.bstek.dorado.view.widget.form.CheckBox" sortFactor="2043" category="Form" icon="/com/bstek/dorado/view/widget/form/CheckBox.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="caption"/> |
| | | <Prop name="mixedValue" type="java.lang.Object"/> |
| | | <Prop name="offValue" defaultValue="false" type="java.lang.Object"/> |
| | | <Prop name="onValue" defaultValue="true" type="java.lang.Object"/> |
| | | <Prop name="triState" type="boolean"/> |
| | | <Prop name="value" defaultValue="false" type="java.lang.Object"/></Props><ClientEvents> |
| | | <ClientEvent name="onValueChange" parameters="self,arg"/></ClientEvents></Rule><Rule name="RadioGroup" parents="AbstractDataEditor" label="RadioGroup" type="com.bstek.dorado.view.widget.form.RadioGroup" sortFactor="2044" category="Form" icon="/com/bstek/dorado/view/widget/form/RadioGroup.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="columnCount" defaultValue="3" type="int"/> |
| | | <Prop name="layout" defaultValue="flow" enumValues="vertical,flow,grid"/> |
| | | <Prop name="value" type="java.lang.Object"/></Props><ClientEvents> |
| | | <ClientEvent name="onValueChange" parameters="self,arg"/></ClientEvents><Children><Child rule="RadioButton" name="RadioButtons" aggregated="true"></Child></Children></Rule><Rule name="DataMessage" parents="AbstractPropertyDataControl" label="DataMessage" type="com.bstek.dorado.view.widget.form.DataMessage" sortFactor="2045" category="Form" icon="/com/bstek/dorado/view/widget/form/DataMessage.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="showIconOnly" type="boolean"/> |
| | | <Prop name="showMultiMessage" type="boolean"/></Props></Rule><Rule name="FormProfile" parents="Component" label="FormProfile" type="com.bstek.dorado.view.widget.form.FormProfile" sortFactor="2046" category="Form" icon="/com/bstek/dorado/view/widget/form/FormProfile.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="className"/> |
| | | <Prop name="dataPath" highlight="1"/> |
| | | <Prop name="dataSet" highlight="1" reference="DataSet:id"/> |
| | | <Prop name="editorWidth" type="int"/> |
| | | <Prop name="exClassName"/> |
| | | <Prop name="height"/> |
| | | <Prop name="hintPosition" enumValues="right,bottom"/> |
| | | <Prop name="hintSpacing" type="int"/> |
| | | <Prop name="hintWidth" type="int"/> |
| | | <Prop name="labelAlign" defaultValue="left" enumValues="left,center,right"/> |
| | | <Prop name="labelPosition" defaultValue="left" enumValues="left,top"/> |
| | | <Prop name="labelSeparator"/> |
| | | <Prop name="labelSpacing" type="int"/> |
| | | <Prop name="labelWidth" type="int"/> |
| | | <Prop name="readOnly" type="boolean"/> |
| | | <Prop name="showHint" defaultValue="true" type="boolean"/> |
| | | <Prop name="showHintMessage" type="boolean"/> |
| | | <Prop name="showLabel" defaultValue="true" type="boolean"/> |
| | | <Prop name="trigger" enumValues="triggerClear,autoMappingDropDown1,autoMappingDropDown2,defaultDateDropDown,defaultDateTimeDropDown,defaultYearMonthDropDown,defaultYearDropDown,defaultMonthDropDown" reference="Trigger:id"/> |
| | | <Prop name="type" defaultValue="text" enumValues="text,password,textArea,checkBox,radioGroup"/> |
| | | <Prop name="ui"/> |
| | | <Prop name="width"/></Props></Rule><Rule name="FormElement" parents="com.bstek.dorado.view.widget.Control" label="FormElement" type="com.bstek.dorado.view.widget.form.FormElement" sortFactor="2047" category="Form" icon="/com/bstek/dorado/view/widget/form/FormElement.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="dataPath" highlight="1"/> |
| | | <Prop name="dataSet" highlight="1" reference="DataSet:id"/> |
| | | <Prop name="editable" defaultValue="true" type="boolean"/> |
| | | <Prop name="editorType" highlight="1" enumValues="TextEditor,PasswordEditor,TextArea,CheckBox,RadioGroup,Label,NumberSpinner"/> |
| | | <Prop name="editorWidth" type="int"/> |
| | | <Prop name="formProfile" reference="FormProfile:id"/> |
| | | <Prop name="hint"/> |
| | | <Prop name="hintPosition" defaultValue="right" enumValues="right,bottom"/> |
| | | <Prop name="hintSpacing" type="int"/> |
| | | <Prop name="hintWidth" type="int"/> |
| | | <Prop name="label" highlight="1"/> |
| | | <Prop name="labelAlign" defaultValue="left" enumValues="left,center,right"/> |
| | | <Prop name="labelPosition" defaultValue="left" enumValues="left,top"/> |
| | | <Prop name="labelSeparator"/> |
| | | <Prop name="labelSpacing" type="int"/> |
| | | <Prop name="labelWidth" type="int"/> |
| | | <Prop name="property" highlight="1"/> |
| | | <Prop name="readOnly" type="boolean"/> |
| | | <Prop name="showHint" defaultValue="true" type="boolean"/> |
| | | <Prop name="showHintMessage" type="boolean"/> |
| | | <Prop name="showLabel" defaultValue="true" type="boolean"/> |
| | | <Prop name="trigger" enumValues="triggerClear,autoMappingDropDown1,autoMappingDropDown2,autoOpenMappingDropDown1,autoOpenMappingDropDown2,defaultDateDropDown,defaultDateTimeDropDown,defaultYearMonthDropDown,defaultYearDropDown,defaultMonthDropDown" reference="Trigger:id"/> |
| | | <Prop name="type" enumValues="text,password,textArea,checkBox,radioGroup" visible="false"/></Props><ClientEvents> |
| | | <ClientEvent name="onGetBindingData" parameters="self,arg"/> |
| | | <ClientEvent name="onGetBindingDataType" parameters="self,arg"/></ClientEvents><Children><Child name="Editor" fixed="true"><Rule name="Wrapper.Editor" label="Editor" nodeName="Editor" icon="/com/bstek/dorado/view/widget/form/Editor.png"><Children><Child rule="com.bstek.dorado.view.widget.Control" name="Editor"></Child></Children></Rule></Child></Children></Rule><Rule name="AutoForm" parents="com.bstek.dorado.view.widget.Control" label="AutoForm" type="com.bstek.dorado.view.widget.form.autoform.AutoForm" sortFactor="2048" category="Form" icon="/com/bstek/dorado/view/widget/form/autoform/AutoForm.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="autoCreateElements" type="boolean"/> |
| | | <Prop name="colPadding" type="int"/> |
| | | <Prop name="cols" highlight="1"/> |
| | | <Prop name="createOwnEntity" defaultValue="true" type="boolean"/> |
| | | <Prop name="createPrivateDataSet" type="boolean"/> |
| | | <Prop name="dataPath" highlight="1"/> |
| | | <Prop name="dataSet" highlight="1" reference="DataSet:id"/> |
| | | <Prop name="dataType" type="com.bstek.dorado.data.type.EntityDataType"/> |
| | | <Prop name="editorWidth" type="int"/> |
| | | <Prop name="formProfile" reference="FormProfile:id"/> |
| | | <Prop name="hintPosition" enumValues="right,bottom"/> |
| | | <Prop name="hintSpacing" type="int"/> |
| | | <Prop name="hintWidth" type="int"/> |
| | | <Prop name="labelAlign" defaultValue="left" enumValues="left,center,right"/> |
| | | <Prop name="labelPosition" defaultValue="left" enumValues="left,top"/> |
| | | <Prop name="labelSeparator"/> |
| | | <Prop name="labelSpacing" type="int"/> |
| | | <Prop name="labelWidth" type="int"/> |
| | | <Prop name="padding" type="int"/> |
| | | <Prop name="readOnly" type="boolean"/> |
| | | <Prop name="rowHeight" type="int"/> |
| | | <Prop name="rowPadding" type="int"/> |
| | | <Prop name="showHint" defaultValue="true" type="boolean"/> |
| | | <Prop name="showHintMessage" type="boolean"/> |
| | | <Prop name="showLabel" defaultValue="true" type="boolean"/> |
| | | <Prop name="stretchWidth" type="boolean"/></Props><Children><Child rule="AutoFormElement" name="AutoFormElement" aggregated="true"></Child><Child rule="com.bstek.dorado.view.widget.Control" name="Elements" aggregated="true"></Child></Children></Rule><Rule name="NumberSpinner" parents="Spinner" label="NumberSpinner" type="com.bstek.dorado.view.widget.form.NumberSpinner" sortFactor="2049" category="Form" icon="/com/bstek/dorado/view/widget/form/NumberSpinner.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="max" defaultValue="2147483647" type="int"/> |
| | | <Prop name="min" defaultValue="-2147483648" type="int"/> |
| | | <Prop name="selectTextOnFocus" defaultValue="true" type="boolean"/></Props></Rule><Rule name="DateTimeSpinner" parents="Spinner" label="DateTimeSpinner" type="com.bstek.dorado.view.widget.form.DateTimeSpinner" sortFactor="2050" category="Form" icon="/com/bstek/dorado/view/widget/form/DateTimeSpinner.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="date" type="int"/> |
| | | <Prop name="hours" type="int"/> |
| | | <Prop name="minutes" type="int"/> |
| | | <Prop name="month" type="int"/> |
| | | <Prop name="seconds" type="int"/> |
| | | <Prop name="type" defaultValue="time" enumValues="date,time,dateTime,hours,minutes,dateHours,dateMinutes"/> |
| | | <Prop name="year" type="int"/></Props></Rule><Rule name="CustomSpinner" parents="Spinner" label="CustomSpinner" type="com.bstek.dorado.view.widget.form.CustomSpinner" sortFactor="2051" category="Form" icon="/com/bstek/dorado/view/widget/form/CustomSpinner.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="pattern" highlight="1"/> |
| | | <Prop name="text" visible="false"/> |
| | | <Prop name="value"/></Props></Rule><Rule name="Trigger" parents="Component" label="Trigger" type="com.bstek.dorado.view.widget.form.trigger.Trigger" sortFactor="2052" category="Trigger" icon="/com/bstek/dorado/view/widget/form/trigger/Trigger.png" autoGenerateId="true" clientTypes="desktop,touch"><Props> |
| | | <Prop name="buttonVisible" defaultValue="true" type="boolean"/> |
| | | <Prop name="editable" defaultValue="true" type="boolean"/> |
| | | <Prop name="icon"/> |
| | | <Prop name="iconClass" enumValues="d-trigger-icon-drop,d-trigger-icon-search,d-trigger-icon-date,d-trigger-icon-custom"/></Props><ClientEvents> |
| | | <ClientEvent name="onExecute" parameters="self,arg"/> |
| | | <ClientEvent name="beforeExecute" parameters="self,arg"/></ClientEvents></Rule><Rule name="ListDropDown" parents="RowListDropDown" label="ListDropDown" type="com.bstek.dorado.view.widget.form.trigger.ListDropDown" sortFactor="2053" category="Trigger" icon="/com/bstek/dorado/view/widget/form/trigger/ListDropDown.png" autoGenerateId="true" clientTypes="desktop"><Props> |
| | | <Prop name="items" highlight="1" editor="collection[any]" type="java.util.List"/></Props></Rule><Rule name="DataSetDropDown" parents="RowListDropDown" label="DataSetDropDown" type="com.bstek.dorado.view.widget.form.trigger.DataSetDropDown" sortFactor="2054" category="Trigger" icon="/com/bstek/dorado/view/widget/form/trigger/DataSetDropDown.png" autoGenerateId="true" clientTypes="desktop"><Props> |
| | | <Prop name="dataPath" highlight="1"/> |
| | | <Prop name="dataSet" highlight="1" reference="DataSet:id"/> |
| | | <Prop name="filterMode" defaultValue="serverSide" enumValues="clientSide,serverSide"/> |
| | | <Prop name="filterOnTyping" defaultValue="false" type="boolean"/> |
| | | <Prop name="property" highlight="1"/> |
| | | <Prop name="reloadDataOnOpen" type="boolean"/> |
| | | <Prop name="useDataBinding" defaultValue="true" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onGetBindingData" parameters="self,arg"/> |
| | | <ClientEvent name="onSetFilterParameter" parameters="self,arg"/> |
| | | <ClientEvent name="onGetBindingDataType" parameters="self,arg"/></ClientEvents></Rule><Rule name="AutoMappingDropDown" parents="RowListDropDown" label="AutoMappingDropDown" type="com.bstek.dorado.view.widget.form.trigger.AutoMappingDropDown" sortFactor="2055" category="Trigger" icon="/com/bstek/dorado/view/widget/form/trigger/AutoMappingDropDown.png" autoGenerateId="true" clientTypes="desktop"><Props> |
| | | <Prop name="dynaFilter" defaultValue="true" type="boolean"/> |
| | | <Prop name="property" defaultValue="value"/></Props></Rule><Rule name="DateDropDown" parents="DropDown" label="DateDropDown" type="com.bstek.dorado.view.widget.form.trigger.DateDropDown" sortFactor="2056" category="Trigger" icon="/com/bstek/dorado/view/widget/form/trigger/DateDropDown.png" autoGenerateId="true" clientTypes="desktop"><Props> |
| | | <Prop name="selectionMode" defaultValue="singleDate" enumValues="singleDate,multiDate"/> |
| | | <Prop name="showConfirmButton" defaultValue="true" type="boolean"/> |
| | | <Prop name="showTimeSpinner" type="boolean"/> |
| | | <Prop name="showTodayButton" defaultValue="true" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onRefreshDateCell" parameters="self,arg"/> |
| | | <ClientEvent name="onFilterDate" parameters="self,arg"/></ClientEvents></Rule><Rule name="YearMonthDropDown" parents="DropDown" label="YearMonthDropDown" type="com.bstek.dorado.view.widget.form.trigger.YearMonthDropDown" sortFactor="2057" category="Trigger" icon="/com/bstek/dorado/view/widget/form/trigger/YearMonthDropDown.png" autoGenerateId="true" clientTypes="desktop"></Rule><Rule name="YearDropDown" parents="DropDown" label="YearDropDown" type="com.bstek.dorado.view.widget.form.trigger.YearDropDown" sortFactor="2058" category="Trigger" icon="/com/bstek/dorado/view/widget/form/trigger/YearDropDown.png" autoGenerateId="true" clientTypes="desktop"></Rule><Rule name="MonthDropDown" parents="DropDown" label="MonthDropDown" type="com.bstek.dorado.view.widget.form.trigger.MonthDropDown" sortFactor="2059" category="Trigger" icon="/com/bstek/dorado/view/widget/form/trigger/MonthDropDown.png" autoGenerateId="true" clientTypes="desktop"></Rule><Rule name="CustomDropDown" parents="DropDown" label="CustomDropDown" type="com.bstek.dorado.view.widget.form.trigger.CustomDropDown" sortFactor="2060" category="Trigger" icon="/com/bstek/dorado/view/widget/form/trigger/CustomDropDown.png" autoGenerateId="true" clientTypes="desktop"><Children><Child rule="com.bstek.dorado.view.widget.Control" name="Control"></Child></Children></Rule><Rule name="DataPilot" parents="AbstractDataControl" label="DataPilot" type="com.bstek.dorado.view.widget.datacontrol.DataPilot" sortFactor="2061" category="General" icon="/com/bstek/dorado/view/widget/datacontrol/DataPilot.png" clientTypes="desktop"><Props> |
| | | <Prop name="height" visible="false"/> |
| | | <Prop name="itemCodes" highlight="1" enumValues="pages,|<,<,>,>|,goto,pageSize,info,+,-,x,|"/></Props><ClientEvents> |
| | | <ClientEvent name="onSubControlAction" parameters="self,arg"/> |
| | | <ClientEvent name="onSubControlRefresh" parameters="self,arg"/></ClientEvents></Rule><Rule name="ListBox" parents="AbstractListBox" label="ListBox" type="com.bstek.dorado.view.widget.list.ListBox" sortFactor="2062" category="Collection" icon="/com/bstek/dorado/view/widget/list/ListBox.png" clientTypes="desktop"><Props> |
| | | <Prop name="items" highlight="1" editor="collection[any]" type="java.util.List"/></Props></Rule><Rule name="DataListBox" parents="AbstractListBox" label="DataListBox" type="com.bstek.dorado.view.widget.list.DataListBox" sortFactor="2063" category="Collection" icon="/com/bstek/dorado/view/widget/list/DataListBox.png" clientTypes="desktop"><Props> |
| | | <Prop name="dataPath" highlight="1"/> |
| | | <Prop name="dataSet" highlight="1" reference="DataSet:id"/></Props><ClientEvents> |
| | | <ClientEvent name="onGetBindingData" parameters="self,arg"/> |
| | | <ClientEvent name="onGetBindingDataType" parameters="self,arg"/></ClientEvents></Rule><Rule name="Grid" parents="AbstractGrid" label="Grid" type="com.bstek.dorado.view.widget.grid.Grid" sortFactor="2064" category="Collection" icon="/com/bstek/dorado/view/widget/grid/Grid.png" clientTypes="desktop"><Props> |
| | | <Prop name="items" highlight="1" editor="collection[pojo]" type="java.util.List"/></Props></Rule><Rule name="DataGrid" parents="AbstractGrid" label="DataGrid" type="com.bstek.dorado.view.widget.grid.DataGrid" sortFactor="2065" category="Collection" icon="/com/bstek/dorado/view/widget/grid/DataGrid.png" clientTypes="desktop"><Props> |
| | | <Prop name="appendOnLastEnter" type="boolean"/> |
| | | <Prop name="autoCreateColumns" type="java.lang.Boolean"/> |
| | | <Prop name="dataPath" highlight="1"/> |
| | | <Prop name="dataSet" highlight="1" reference="DataSet:id"/> |
| | | <Prop name="dataType" deprecated="true" type="com.bstek.dorado.data.type.EntityDataType"/> |
| | | <Prop name="filterMode" defaultValue="clientSide" enumValues="clientSide,serverSide"/> |
| | | <Prop name="rowSelectionProperty"/> |
| | | <Prop name="sortMode" defaultValue="clientSide" enumValues="clientSide,serverSide"/> |
| | | <Prop name="supportsPaging" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onGetBindingData" parameters="self,arg"/> |
| | | <ClientEvent name="onGetBindingDataType" parameters="self,arg"/></ClientEvents></Rule><Rule name="Tree" parents="AbstractTree" label="Tree" type="com.bstek.dorado.view.widget.tree.Tree" sortFactor="2066" category="Collection" icon="/com/bstek/dorado/view/widget/tree/Tree.png" clientTypes="desktop"><Children><Child rule="BaseNode" name="Nodes" aggregated="true"></Child></Children></Rule><Rule name="DataTree" parents="AbstractTree" label="DataTree" type="com.bstek.dorado.view.widget.tree.DataTree" sortFactor="2067" category="Collection" icon="/com/bstek/dorado/view/widget/tree/DataTree.png" clientTypes="desktop"><Props> |
| | | <Prop name="currentNodeDataPath"/> |
| | | <Prop name="dataPath" highlight="1"/> |
| | | <Prop name="dataSet" highlight="1" reference="DataSet:id"/></Props><ClientEvents> |
| | | <ClientEvent name="onDataNodeCreate" parameters="self,arg"/> |
| | | <ClientEvent name="onGetBindingDataType" parameters="self,arg"/> |
| | | <ClientEvent name="onGetBindingData" parameters="self,arg"/> |
| | | <ClientEvent name="beforeDataNodeCreate" parameters="self,arg"/></ClientEvents><Children><Child name="BindingConfigs" fixed="true"><Rule name="Wrapper.BindingConfigs" label="BindingConfigs" nodeName="BindingConfigs" icon="/com/bstek/dorado/view/widget/tree/BindingConfigs.png"><Children><Child rule="BindingConfig" name="BindingConfigs" aggregated="true"></Child></Children></Rule></Child></Children></Rule><Rule name="BlockView" parents="AbstractBlockView" label="BlockView" type="com.bstek.dorado.view.widget.blockview.BlockView" sortFactor="2068" category="Collection" icon="/com/bstek/dorado/view/widget/blockview/BlockView.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="items" highlight="1" editor="collection[any]" type="java.util.List"/></Props></Rule><Rule name="DataBlockView" parents="AbstractBlockView" label="DataBlockView" type="com.bstek.dorado.view.widget.blockview.DataBlockView" sortFactor="2069" category="Collection" icon="/com/bstek/dorado/view/widget/blockview/DataBlockView.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="dataPath" highlight="1"/> |
| | | <Prop name="dataSet" highlight="1" reference="DataSet:id"/></Props><ClientEvents> |
| | | <ClientEvent name="onGetBindingData" parameters="self,arg"/> |
| | | <ClientEvent name="onGetBindingDataType" parameters="self,arg"/></ClientEvents></Rule><Rule name="TreeGrid" parents="AbstractTreeGrid" label="TreeGrid" type="com.bstek.dorado.view.widget.treegrid.TreeGrid" sortFactor="2070" category="Collection" icon="/com/bstek/dorado/view/widget/treegrid/TreeGrid.png" clientTypes="desktop"><Children><Child name="Nodes" fixed="true"><Rule name="Wrapper.Nodes" label="Nodes" nodeName="Nodes" icon="/com/bstek/dorado/view/widget/treegrid/Nodes.png"><Children><Child rule="BaseNode" name="Nodes" aggregated="true"></Child></Children></Rule></Child></Children></Rule><Rule name="DataTreeGrid" parents="AbstractTreeGrid" label="DataTreeGrid" type="com.bstek.dorado.view.widget.treegrid.DataTreeGrid" sortFactor="2071" category="Collection" icon="/com/bstek/dorado/view/widget/treegrid/DataTreeGrid.png" clientTypes="desktop"><Props> |
| | | <Prop name="autoCreateColumns" type="java.lang.Boolean"/> |
| | | <Prop name="currentNodeDataPath"/> |
| | | <Prop name="dataPath" highlight="1"/> |
| | | <Prop name="dataSet" highlight="1" reference="DataSet:id"/> |
| | | <Prop name="dataType" type="com.bstek.dorado.data.type.EntityDataType"/></Props><ClientEvents> |
| | | <ClientEvent name="onDataNodeCreate" parameters="self,arg"/> |
| | | <ClientEvent name="onGetBindingDataType" parameters="self,arg"/> |
| | | <ClientEvent name="onGetBindingData" parameters="self,arg"/> |
| | | <ClientEvent name="beforeDataNodeCreate" parameters="self,arg"/></ClientEvents><Children><Child name="BindingConfigs" fixed="true"><Rule name="Wrapper.BindingConfigs" label="BindingConfigs" nodeName="BindingConfigs" icon="/com/bstek/dorado/view/widget/tree/BindingConfigs.png"><Children><Child rule="BindingConfig" name="BindingConfigs" aggregated="true"></Child></Children></Rule></Child></Children></Rule><Rule name="TagEditor" parents="AbstractTextEditor" label="TagEditor" type="com.bstek.dorado.view.widget.advance.TagEditor" sortFactor="2072" category="Form" icon="/com/bstek/dorado/view/widget/advance/TagEditor.png" clientTypes="desktop"><Props> |
| | | <Prop name="acceptUnknownTag" defaultValue="true" type="boolean"/> |
| | | <Prop name="availableTags" highlight="1" type="[Ljava.lang.String;"/> |
| | | <Prop name="availableTagsDataPath" highlight="1"/> |
| | | <Prop name="availableTagsDataSet" highlight="1" reference="DataSet:id"/> |
| | | <Prop name="highlightRequiredTags" defaultValue="true" type="boolean"/> |
| | | <Prop name="requiredTags" highlight="1" type="[Ljava.lang.String;"/> |
| | | <Prop name="showAvailableTags" defaultValue="true" type="boolean"/> |
| | | <Prop name="textSeperator" defaultValue=","/></Props><ClientEvents> |
| | | <ClientEvent name="beforeTagAdd" parameters="self,arg"/> |
| | | <ClientEvent name="beforeUnknownTagAccept" parameters="self,arg"/> |
| | | <ClientEvent name="onUnknownTagAccept" parameters="self,arg"/> |
| | | <ClientEvent name="onTagAdd" parameters="self,arg"/> |
| | | <ClientEvent name="beforeTagRemove" parameters="self,arg"/> |
| | | <ClientEvent name="onTagRemove" parameters="self,arg"/></ClientEvents></Rule><Rule name="ColorPicker" parents="com.bstek.dorado.view.widget.Control" label="ColorPicker" type="com.bstek.dorado.view.widget.advance.ColorPicker" sortFactor="2073" category="Form" icon="/com/bstek/dorado/view/widget/advance/ColorPicker.png" clientTypes="desktop"><Props> |
| | | <Prop name="allowEmpty" type="boolean"/> |
| | | <Prop name="color"/> |
| | | <Prop name="disabled" type="boolean"/> |
| | | <Prop name="palette" enumValues="#sixteen,#websafe,#named" type="[Ljava.lang.String;"/> |
| | | <Prop name="preferredFormat" enumValues="none,hex,hex6,hsl,rgb,name"/> |
| | | <Prop name="showAlpha" type="boolean"/> |
| | | <Prop name="showButtons" defaultValue="true" type="boolean"/> |
| | | <Prop name="showInitial" type="boolean"/> |
| | | <Prop name="showInput" type="boolean"/> |
| | | <Prop name="showPalette" type="boolean"/> |
| | | <Prop name="showPaletteOnly" type="boolean"/></Props></Rule><Rule name="ColorEditor" parents="AbstractDataEditor" label="ColorEditor" type="com.bstek.dorado.view.widget.advance.ColorEditor" sortFactor="2074" category="Form" icon="/com/bstek/dorado/view/widget/advance/ColorEditor.png" clientTypes="desktop"><Props> |
| | | <Prop name="allowEmpty" type="boolean"/> |
| | | <Prop name="color"/> |
| | | <Prop name="disabled" type="boolean"/> |
| | | <Prop name="palette" enumValues="#sixteen,#websafe,#named" type="[Ljava.lang.String;"/> |
| | | <Prop name="preferredFormat" defaultValue="name" enumValues="none,hex,hex6,hsl,rgb,name"/> |
| | | <Prop name="showAlpha" type="boolean"/> |
| | | <Prop name="showButtons" defaultValue="true" type="boolean"/> |
| | | <Prop name="showInitial" type="boolean"/> |
| | | <Prop name="showInput" type="boolean"/> |
| | | <Prop name="showPalette" type="boolean"/> |
| | | <Prop name="showPaletteOnly" type="boolean"/></Props></Rule><Rule name="UploadAction" parents="Action" label="UploadAction" type="com.bstek.dorado.uploader.widget.UploadAction" sortFactor="2075" category="Action" icon="/com/bstek/dorado/uploader/widget/UploadAction.png" autoGenerateId="true" clientTypes="desktop,touch"><Props> |
| | | <Prop name="autoUpload" defaultValue="true" type="boolean"/> |
| | | <Prop name="confirmMessage" visible="false"/> |
| | | <Prop name="fileResolver" highlight="1"/> |
| | | <Prop name="headers" editor="pojo" type="java.util.Map"/> |
| | | <Prop name="hotkey" visible="false"/> |
| | | <Prop name="maxFileSize" defaultValue="100MB"/> |
| | | <Prop name="runtimes" defaultValue="html5,flash,silverlight,gears,browserplus,html4" visible="false"/> |
| | | <Prop name="selectionMode" defaultValue="singleFile" enumValues="singleFile,multiFiles"/> |
| | | <Prop name="url" defaultValue=">dorado/uploader/fileupload" visible="false"/></Props><ClientEvents> |
| | | <ClientEvent name="beforeExecute" parameters="self,arg" deprecated="true"/> |
| | | <ClientEvent name="onStateChanged" parameters="self,arg"/> |
| | | <ClientEvent name="onError" parameters="self,arg"/> |
| | | <ClientEvent name="onRefresh" parameters="self,arg"/> |
| | | <ClientEvent name="onExecute" parameters="self,arg" deprecated="true"/> |
| | | <ClientEvent name="onChunkUploaded" parameters="self,arg"/> |
| | | <ClientEvent name="onFailure" parameters="self,arg" deprecated="true"/> |
| | | <ClientEvent name="beforeInit" parameters="self,arg"/> |
| | | <ClientEvent name="onFilesAdded" parameters="self,arg"/> |
| | | <ClientEvent name="onFilesRemoved" parameters="self,arg"/> |
| | | <ClientEvent name="onQueueChanged" parameters="self,arg"/> |
| | | <ClientEvent name="beforeFileUpload" parameters="self,arg"/> |
| | | <ClientEvent name="onInit" parameters="self,arg"/> |
| | | <ClientEvent name="beforeFileUploaded" parameters="self,arg"/> |
| | | <ClientEvent name="onUploadProgress" parameters="self,arg"/> |
| | | <ClientEvent name="onFileUploaded" parameters="self,arg"/> |
| | | <ClientEvent name="onUploadComplete" parameters="self,arg"/> |
| | | <ClientEvent name="onSuccess" parameters="self,arg" deprecated="true"/></ClientEvents><Children><Child name="Filters" fixed="true"><Rule name="Wrapper.Filters" label="Filters" nodeName="Filters"><Children><Child rule="Filter" name="Filters" aggregated="true"></Child></Children></Rule></Child></Children></Rule><Rule name="DownloadAction" parents="FormSubmitAction" label="DownloadAction" type="com.bstek.dorado.uploader.widget.DownloadAction" sortFactor="2076" category="Action" icon="/com/bstek/dorado/uploader/widget/DownloadAction.png" autoGenerateId="true" clientTypes="desktop,touch"><Props> |
| | | <Prop name="action" defaultValue=">dorado/uploader/filedownload" visible="false"/> |
| | | <Prop name="fileProvider" highlight="1"/> |
| | | <Prop name="inlineMode" defaultValue="off" enumValues="none,off,browser"/></Props></Rule><Rule name="Intro" parents="Component" label="Intro" type="com.bstek.dorado.intro.Intro" sortFactor="2077" category="Advance" icon="/com/bstek/dorado/intro/Intro.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="doneLabel"/> |
| | | <Prop name="exitOnEsc" defaultValue="true" type="boolean"/> |
| | | <Prop name="exitOnOverlayClick" defaultValue="true" type="boolean"/> |
| | | <Prop name="name"/> |
| | | <Prop name="nextLabel"/> |
| | | <Prop name="prevLabel"/> |
| | | <Prop name="showNextButton" defaultValue="true" type="boolean"/> |
| | | <Prop name="showPrevButton" defaultValue="true" type="boolean"/> |
| | | <Prop name="showSkipButton" defaultValue="true" type="boolean"/> |
| | | <Prop name="showStepNumbers" defaultValue="true" type="boolean"/> |
| | | <Prop name="skipLabel"/> |
| | | <Prop name="tooltipClass"/> |
| | | <Prop name="tooltipPosition" highlight="1" enumValues="left,top,right,bottom" deprecated="true"/></Props><ClientEvents> |
| | | <ClientEvent name="onStart" parameters="self,arg"/> |
| | | <ClientEvent name="onChange" parameters="self,arg"/> |
| | | <ClientEvent name="onExit" parameters="self,arg"/> |
| | | <ClientEvent name="onBeforeStart" parameters="self,arg"/> |
| | | <ClientEvent name="onComplete" parameters="self,arg"/> |
| | | <ClientEvent name="onBeforeChange" parameters="self,arg"/></ClientEvents><Children><Child rule="Step" name="Step" aggregated="true"></Child><Child rule="Step" name="Steps" aggregated="true"></Child></Children></Rule><Rule name="Step" label="Step" type="com.bstek.dorado.intro.Step" sortFactor="2078" icon="/com/bstek/dorado/intro/Step.png" clientTypes="desktop,touch"><Props> |
| | | <Prop name="arrowAlign" enumValues="left,top,center,right,bottom"/> |
| | | <Prop name="arrowDirection" enumValues="left,top,right,bottom"/> |
| | | <Prop name="element" highlight="1"/> |
| | | <Prop name="ignored" type="boolean"/> |
| | | <Prop name="intro" editor="multiLines"/> |
| | | <Prop name="name"/> |
| | | <Prop name="position" enumValues="left,top,right,bottom" deprecated="true"/> |
| | | <Prop name="tags"/><Prop name="tooltipPosition" type="java.util.Map" compositeType="Open"></Prop> |
| | | <Prop name="userData" type="java.lang.Object"/></Props></Rule><Rule name="SwfViewer" parents="com.bstek.dorado.view.widget.Control" label="SwfViewer" type="com.bstek.bdf2.swfviewer.widget.SwfViewer" sortFactor="2079" category="BDF2" clientTypes="desktop"><Props> |
| | | <Prop name="attributes"/> |
| | | <Prop name="expressInstallSwfurl"/> |
| | | <Prop name="flashvars"/> |
| | | <Prop name="handlerName"/> |
| | | <Prop name="height" defaultValue="400"/> |
| | | <Prop name="parameter"/> |
| | | <Prop name="params"/> |
| | | <Prop name="printEnabled" defaultValue="true" type="boolean"/> |
| | | <Prop name="showType" defaultValue="complex" enumValues="simple,complex"/> |
| | | <Prop name="swfUrl" highlight="1"/> |
| | | <Prop name="version"/> |
| | | <Prop name="width" defaultValue="400"/></Props></Rule><Rule name="Export2ReportAction" parents="AjaxAction" label="Export2ReportAction" type="com.bstek.bdf2.export.view.Export2ReportAction" sortFactor="2080" category="BDF2" icon="/com/bstek/bdf2/export/view/Export2ReportAction.png" autoGenerateId="true" clientTypes="desktop,touch"><Props> |
| | | <Prop name="autoDownload" defaultValue="true" type="boolean"/> |
| | | <Prop name="batchable" defaultValue="true" type="boolean"/> |
| | | <Prop name="dataBgColor" defaultValue="#FFFFFF"/> |
| | | <Prop name="dataFontColor" defaultValue="#000000"/> |
| | | <Prop name="dataFontSize" defaultValue="10" type="int"/> |
| | | <Prop name="dataScope" defaultValue="currentPage" enumValues="currentPage,serverAll"/> |
| | | <Prop name="extension" defaultValue="xls" enumValues="xls,xlsx,pdf,csv"/> |
| | | <Prop name="fileName"/> |
| | | <Prop name="headerBgColor" defaultValue="#D8D8D8"/> |
| | | <Prop name="headerFontColor" defaultValue="#000000"/> |
| | | <Prop name="headerFontSize" defaultValue="10" type="int"/> |
| | | <Prop name="interceptorName"/> |
| | | <Prop name="maxSize" defaultValue="1000" type="int"/> |
| | | <Prop name="rowSpace" defaultValue="1" type="int"/> |
| | | <Prop name="showPageNumber" defaultValue="true" type="boolean"/> |
| | | <Prop name="showTitle" defaultValue="false" type="boolean"/> |
| | | <Prop name="template" highlight="1"/> |
| | | <Prop name="timeout" type="long"/> |
| | | <Prop name="titleBgColor" defaultValue="#FFFFFF"/> |
| | | <Prop name="titleFontColor" defaultValue="#000000"/> |
| | | <Prop name="titleFontSize" defaultValue="18" type="int"/> |
| | | <Prop name="titleName"/></Props><ClientEvents> |
| | | <ClientEvent name="onGetExportElement" parameters="self,arg"/> |
| | | <ClientEvent name="onGetExportData" parameters="self,arg"/></ClientEvents></Rule><Rule name="AbstractViewElement" abstract="true" type="com.bstek.dorado.view.AbstractViewElement"><PrimitiveProps> |
| | | <Prop name="id" highlight="1"/></PrimitiveProps><Props> |
| | | <Prop name="ignored" type="boolean"/><Prop name="metaData" type="java.util.Map" compositeType="Open"></Prop> |
| | | <Prop name="tags"/> |
| | | <Prop name="userData" type="java.lang.Object"/></Props></Rule><Rule name="ClientEventSupportedElement" parents="AbstractViewElement" abstract="true" type="com.bstek.dorado.view.ClientEventSupportedElement"></Rule><Rule name="Component" parents="ClientEventSupportedElement" abstract="true" type="com.bstek.dorado.view.widget.Component" scope="protected"><PrimitiveProps> |
| | | <Prop name="listener"/></PrimitiveProps><Props> |
| | | <Prop name="userData" editor="any" type="java.lang.Object"/></Props><ClientEvents> |
| | | <ClientEvent name="onCreate" parameters="self,arg"/> |
| | | <ClientEvent name="onAttributeChange" parameters="self,arg"/> |
| | | <ClientEvent name="onDestroy" parameters="self,arg"/> |
| | | <ClientEvent name="onReady" parameters="self,arg"/></ClientEvents></Rule><Rule name="com.bstek.dorado.view.widget.Control" parents="Component" abstract="true" type="com.bstek.dorado.view.widget.Control" scope="protected" icon="/com/bstek/dorado/view/widget/Control.png" clientTypes="desktop"><PrimitiveProps> |
| | | <Prop name="listener"/></PrimitiveProps><Props> |
| | | <Prop name="className"/> |
| | | <Prop name="dragTags"/> |
| | | <Prop name="draggable" type="boolean"/> |
| | | <Prop name="droppable" type="boolean"/> |
| | | <Prop name="droppableTags"/> |
| | | <Prop name="exClassName"/> |
| | | <Prop name="height"/> |
| | | <Prop name="hideMode" defaultValue="visibility" enumValues="visibility,display"/> |
| | | <Prop name="layoutConstraint" type="java.lang.Object"/> |
| | | <Prop name="lazyInit" type="java.lang.Boolean"/> |
| | | <Prop name="renderOn"/> |
| | | <Prop name="renderTo"/><Prop name="style" type="java.util.Map" compositeType="Open"></Prop> |
| | | <Prop name="tip"/> |
| | | <Prop name="ui" defaultValue="default"/> |
| | | <Prop name="visible" type="java.lang.Boolean"/> |
| | | <Prop name="width"/></Props><ClientEvents> |
| | | <ClientEvent name="onKeyDown" parameters="self,arg"/> |
| | | <ClientEvent name="onClick" parameters="self,arg" clientTypes="desktop"/> |
| | | <ClientEvent name="onKeyPress" parameters="self,arg"/> |
| | | <ClientEvent name="beforeRefreshDom" parameters="self,arg"/> |
| | | <ClientEvent name="onRefreshDom" parameters="self,arg"/> |
| | | <ClientEvent name="onDragMove" parameters="self,arg"/> |
| | | <ClientEvent name="onSwipe" parameters="self,arg" clientTypes="touch"/> |
| | | <ClientEvent name="onDoubleClick" parameters="self,arg" clientTypes="desktop"/> |
| | | <ClientEvent name="onDraggingSourceOver" parameters="self,arg"/> |
| | | <ClientEvent name="onTap" parameters="self,arg" clientTypes="touch"/> |
| | | <ClientEvent name="onGetDraggingIndicator" parameters="self,arg"/> |
| | | <ClientEvent name="onDraggingSourceMove" parameters="self,arg"/> |
| | | <ClientEvent name="onCreateDom" parameters="self,arg"/> |
| | | <ClientEvent name="onDraggingSourceOut" parameters="self,arg"/> |
| | | <ClientEvent name="onDragStart" parameters="self,arg"/> |
| | | <ClientEvent name="onMouseDown" parameters="self,arg"/> |
| | | <ClientEvent name="onContextMenu" parameters="self,arg"/> |
| | | <ClientEvent name="beforeDraggingSourceDrop" parameters="self,arg"/> |
| | | <ClientEvent name="onTapHold" parameters="self,arg" clientTypes="touch"/> |
| | | <ClientEvent name="onDraggingSourceDrop" parameters="self,arg"/> |
| | | <ClientEvent name="onFocus" parameters="self,arg"/> |
| | | <ClientEvent name="onDoubleTap" parameters="self,arg" clientTypes="touch"/> |
| | | <ClientEvent name="onBlur" parameters="self,arg"/> |
| | | <ClientEvent name="onResize" parameters="self,arg"/> |
| | | <ClientEvent name="onDragStop" parameters="self,arg"/> |
| | | <ClientEvent name="onMouseUp" parameters="self,arg"/></ClientEvents></Rule><Rule name="AsyncAction" parents="Action" abstract="true" type="com.bstek.dorado.view.widget.action.AsyncAction" scope="protected"><Props> |
| | | <Prop name="async" defaultValue="true" type="boolean"/> |
| | | <Prop name="executingMessage"/> |
| | | <Prop name="modal" defaultValue="true" type="boolean"/></Props></Rule><Rule name="UpdateItem" label="UpdateItem" type="com.bstek.dorado.view.widget.action.UpdateItem" icon="/com/bstek/dorado/view/widget/action/UpdateItem.png"><Props> |
| | | <Prop name="alias"/> |
| | | <Prop name="autoResetEntityState" defaultValue="true" type="boolean"/> |
| | | <Prop name="dataPath" defaultValue="!DIRTY_TREE" enumValues="!DIRTY_TREE,!CASCADE_DIRTY,[#dirty],[#all],[#visible],[#current]"/> |
| | | <Prop name="dataSet" highlight="1" reference="DataSet:id"/> |
| | | <Prop name="firstResultOnly" type="boolean"/> |
| | | <Prop name="refreshMode" defaultValue="value" enumValues="none,state,value,cascade"/> |
| | | <Prop name="submitDeletedEntity" type="java.lang.Boolean"/> |
| | | <Prop name="submitOldData" type="boolean"/> |
| | | <Prop name="submitSimplePropertyOnly" type="boolean"/> |
| | | <Prop name="validateData" defaultValue="true" type="boolean"/></Props></Rule><Rule name="AbstractButton" parents="com.bstek.dorado.view.widget.Control" abstract="true" type="com.bstek.dorado.view.widget.base.AbstractButton" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="action" highlight="1" reference="Action:id"/> |
| | | <Prop name="disabled" type="boolean"/> |
| | | <Prop name="menu" reference="Menu:id"/> |
| | | <Prop name="toggleOnShowMenu" defaultValue="true" type="boolean"/> |
| | | <Prop name="toggleable" type="boolean"/> |
| | | <Prop name="toggled" type="boolean"/></Props></Rule><Rule name="AbstractPanel" parents="Container" abstract="true" type="com.bstek.dorado.view.widget.base.AbstractPanel" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="buttonAlign" defaultValue="center" enumValues="left,center,right"/> |
| | | <Prop name="caption"/> |
| | | <Prop name="collapseable" defaultValue="true" type="boolean"/> |
| | | <Prop name="collapsed" defaultValue="false" type="boolean"/> |
| | | <Prop name="lazyInitChildren" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onCollapsedChange" parameters="self,arg"/> |
| | | <ClientEvent name="beforeCollapsedChange" parameters="self,arg"/></ClientEvents><Children><Child name="Buttons" fixed="true"><Rule name="Wrapper.Buttons" label="Buttons" nodeName="Buttons" icon="/com/bstek/dorado/view/widget/base/Buttons.png"><Children><Child rule="Button" name="Buttons" aggregated="true"></Child></Children></Rule></Child><Child name="Children" fixed="true"><Rule name="Wrapper.Children" label="Children" nodeName="Children" icon="/com/bstek/dorado/view/widget/base/Children.png"><Children><Child rule="Component" name="Children" aggregated="true"></Child></Children></Rule></Child></Children></Rule><Rule name="ControlTab" parents="Tab" label="ControlTab" type="com.bstek.dorado.view.widget.base.tab.ControlTab" scope="protected" icon="/com/bstek/dorado/view/widget/base/tab/ControlTab.png"><Children><Child rule="com.bstek.dorado.view.widget.Control" name="Control"></Child></Children></Rule><Rule name="Tab" parents="ClientEventSupportedElement" label="Tab" type="com.bstek.dorado.view.widget.base.tab.Tab" scope="protected" icon="/com/bstek/dorado/view/widget/base/tab/Tab.png"><Props> |
| | | <Prop name="caption" highlight="1"/> |
| | | <Prop name="className"/> |
| | | <Prop name="closeable" type="boolean"/> |
| | | <Prop name="disabled" type="boolean"/> |
| | | <Prop name="exClassName" deprecated="true"/> |
| | | <Prop name="height"/> |
| | | <Prop name="icon"/> |
| | | <Prop name="iconClass"/> |
| | | <Prop name="name"/><Prop name="style" type="java.util.Map" compositeType="Open"></Prop> |
| | | <Prop name="tip"/> |
| | | <Prop name="visible" defaultValue="true" type="boolean"/> |
| | | <Prop name="width"/></Props><ClientEvents> |
| | | <ClientEvent name="onClose" parameters="self,arg"/> |
| | | <ClientEvent name="onClick" parameters="self,arg"/> |
| | | <ClientEvent name="beforeClose" parameters="self,arg"/></ClientEvents></Rule><Rule name="IFrameTab" parents="Tab" label="IFrameTab" type="com.bstek.dorado.view.widget.base.tab.IFrameTab" scope="protected" icon="/com/bstek/dorado/view/widget/base/tab/IFrameTab.png"><Props> |
| | | <Prop name="iframeHeight" type="java.lang.Integer"/> |
| | | <Prop name="path" highlight="1"/></Props></Rule><Rule name="AbstractTabControl" parents="com.bstek.dorado.view.widget.Control" abstract="true" type="com.bstek.dorado.view.widget.base.tab.AbstractTabControl" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="alwaysShowNavButtons" type="boolean"/> |
| | | <Prop name="currentTab" type="int"/></Props><ClientEvents> |
| | | <ClientEvent name="onTabContextMenu" parameters="self,arg"/> |
| | | <ClientEvent name="onTabChange" parameters="self,arg"/> |
| | | <ClientEvent name="onTabRemove" parameters="self,arg"/> |
| | | <ClientEvent name="beforeTabChange" parameters="self,arg"/></ClientEvents></Rule><Rule name="com.bstek.dorado.view.widget.base.toolbar.Label" parents="com.bstek.dorado.view.widget.Control" label="Label" nodeName="ToolBarLabel" type="com.bstek.dorado.view.widget.base.toolbar.Label" scope="protected" category="ToolBar" icon="/com/bstek/dorado/view/widget/base/toolbar/Label.png" clientTypes="desktop"><Props> |
| | | <Prop name="text"/></Props></Rule><Rule name="MenuButton" parents="Button" label="MenuButton" nodeName="MenuButton" type="com.bstek.dorado.view.widget.base.toolbar.MenuButton" scope="protected" category="ToolBar" icon="/com/bstek/dorado/view/widget/base/toolbar/MenuButton.png" clientTypes="desktop"><Props> |
| | | <Prop name="hideMenuOnMouseLeave" type="boolean"/> |
| | | <Prop name="hideMenuOnMouseLeaveDelay" defaultValue="300" type="int"/> |
| | | <Prop name="menu" deprecated="true" visible="false"/> |
| | | <Prop name="showMenuOnHover" defaultValue="false" type="boolean"/></Props><Children><Child rule="BaseMenuItem" name="Items" aggregated="true"></Child></Children></Rule><Rule name="BaseMenuItem" parents="ClientEventSupportedElement" abstract="true" type="com.bstek.dorado.view.widget.base.menu.BaseMenuItem"><Props> |
| | | <Prop name="className"/> |
| | | <Prop name="exClassName"/> |
| | | <Prop name="height"/> |
| | | <Prop name="name"/><Prop name="style" type="java.util.Map" compositeType="Open"></Prop> |
| | | <Prop name="tip"/> |
| | | <Prop name="visible" defaultValue="true" type="boolean"/> |
| | | <Prop name="width"/></Props></Rule><Rule name="Separator" parents="BaseMenuItem" label="Separator" type="com.bstek.dorado.view.widget.base.menu.Separator" icon="/com/bstek/dorado/view/widget/base/menu/Separator.png" clientTypes="desktop,touch"></Rule><Rule name="CheckableMenuItem" parents="MenuItem" label="CheckableMenuItem" type="com.bstek.dorado.view.widget.base.menu.CheckableMenuItem" icon="/com/bstek/dorado/view/widget/base/menu/CheckableMenuItem.png" clientTypes="desktop"><Props> |
| | | <Prop name="checked" type="boolean"/> |
| | | <Prop name="group"/></Props><ClientEvents> |
| | | <ClientEvent name="onCheckedChange" parameters="self,arg"/></ClientEvents></Rule><Rule name="TextMenuItem" parents="BaseMenuItem" abstract="true" type="com.bstek.dorado.view.widget.base.menu.TextMenuItem"><Props> |
| | | <Prop name="action" reference="Action:id"/> |
| | | <Prop name="caption"/> |
| | | <Prop name="disabled" type="boolean"/> |
| | | <Prop name="hideOnClick" defaultValue="true" type="boolean"/> |
| | | <Prop name="icon"/> |
| | | <Prop name="iconClass"/></Props><ClientEvents> |
| | | <ClientEvent name="onClick" parameters="self,arg"/></ClientEvents></Rule><Rule name="MenuItem" parents="TextMenuItem" label="MenuItem" type="com.bstek.dorado.view.widget.base.menu.MenuItem" icon="/com/bstek/dorado/view/widget/base/menu/MenuItem.png" clientTypes="desktop"><Children><Child rule="BaseMenuItem" name="Items" aggregated="true"></Child></Children></Rule><Rule name="ControlMenuItem" parents="TextMenuItem" label="ControlMenuItem" type="com.bstek.dorado.view.widget.base.menu.ControlMenuItem" icon="/com/bstek/dorado/view/widget/base/menu/ControlMenuItem.png" clientTypes="desktop"><Children><Child rule="FloatControl" name="Control"></Child></Children></Rule><Rule name="FloatControl" abstract="true" type="com.bstek.dorado.view.widget.FloatControl"><Props> |
| | | <Prop name="align" enumValues="left,innerleft,center,innerright,top" visible="false"/> |
| | | <Prop name="anchorTarget" visible="false"/> |
| | | <Prop name="animateTarget" visible="false"/> |
| | | <Prop name="animateType" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="autoAdjustPosition" type="boolean"/> |
| | | <Prop name="center" type="boolean"/> |
| | | <Prop name="continuedFocus" type="boolean"/> |
| | | <Prop name="floating" type="boolean"/> |
| | | <Prop name="floatingClassName"/> |
| | | <Prop name="focusAfterShow" type="boolean"/> |
| | | <Prop name="handleOverflow" visible="false" type="boolean"/> |
| | | <Prop name="hideAnimateType" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="left" type="int"/> |
| | | <Prop name="modal" type="boolean"/> |
| | | <Prop name="modalType" enumValues="dark,transparent"/> |
| | | <Prop name="offsetLeft" type="int"/> |
| | | <Prop name="offsetTop" type="int"/> |
| | | <Prop name="shadowMode" enumValues="drop,sides,frame,none"/> |
| | | <Prop name="showAnimateType" enumValues="zoom,modernZoom,flip,slide,safeSlide,modernSlide,fade,none"/> |
| | | <Prop name="top" type="int"/> |
| | | <Prop name="vAlign" enumValues="top,innertop,center,innerbottom,bottom" visible="false"/></Props></Rule><Rule name="Fill" parents="com.bstek.dorado.view.widget.Control" label="Fill" type="com.bstek.dorado.view.widget.base.toolbar.Fill" scope="protected" category="ToolBar" icon="/com/bstek/dorado/view/widget/base/toolbar/Fill.png" clientTypes="desktop"></Rule><Rule name="com.bstek.dorado.view.widget.base.toolbar.Button" parents="Button" label="ToolBarButton" nodeName="ToolBarButton" type="com.bstek.dorado.view.widget.base.toolbar.Button" scope="protected" category="ToolBar" icon="/com/bstek/dorado/view/widget/base/toolbar/Button.png" clientTypes="desktop"><Props> |
| | | <Prop name="hideMenuOnMouseLeave" type="boolean"/> |
| | | <Prop name="hideMenuOnMouseLeaveDelay" defaultValue="300" type="int"/> |
| | | <Prop name="showMenuOnHover" defaultValue="false" type="boolean"/></Props></Rule><Rule name="com.bstek.dorado.view.widget.base.toolbar.Separator" parents="com.bstek.dorado.view.widget.Control" label="Separator" type="com.bstek.dorado.view.widget.base.toolbar.Separator" scope="protected" category="ToolBar" icon="/com/bstek/dorado/view/widget/base/toolbar/Separator.png" clientTypes="desktop"></Rule><Rule name="Section" parents="ClientEventSupportedElement" label="Section" type="com.bstek.dorado.view.widget.base.accordion.Section" icon="/com/bstek/dorado/view/widget/base/accordion/Section.png"><Props> |
| | | <Prop name="caption"/> |
| | | <Prop name="className"/> |
| | | <Prop name="disabled" type="boolean"/> |
| | | <Prop name="exClassName"/> |
| | | <Prop name="icon"/> |
| | | <Prop name="iconClass"/> |
| | | <Prop name="name"/><Prop name="style" type="java.util.Map" compositeType="Open"></Prop> |
| | | <Prop name="tip"/> |
| | | <Prop name="visible" defaultValue="true" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onCaptionClick" parameters="self,arg"/></ClientEvents><Children><Child rule="com.bstek.dorado.view.widget.Control" name="Control"></Child></Children></Rule><Rule name="AbstractDataControl" parents="com.bstek.dorado.view.widget.Control" abstract="true" type="com.bstek.dorado.view.widget.datacontrol.AbstractDataControl" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="dataPath" highlight="1"/> |
| | | <Prop name="dataSet" highlight="1" reference="DataSet:id"/></Props><ClientEvents> |
| | | <ClientEvent name="onGetBindingData" parameters="self,arg"/> |
| | | <ClientEvent name="onGetBindingDataType" parameters="self,arg"/></ClientEvents></Rule><Rule name="AbstractPropertyDataControl" parents="AbstractDataControl" abstract="true" type="com.bstek.dorado.view.widget.datacontrol.AbstractPropertyDataControl" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="property" highlight="1"/></Props><ClientEvents> |
| | | <ClientEvent name="onGetBindingData" parameters="self,arg"/> |
| | | <ClientEvent name="onGetBindingDataType" parameters="self,arg"/></ClientEvents></Rule><Rule name="AbstractEditor" parents="com.bstek.dorado.view.widget.Control" abstract="true" type="com.bstek.dorado.view.widget.form.AbstractEditor" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="readOnly" type="boolean"/> |
| | | <Prop name="supportsDirtyFlag" defaultValue="true" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onPost" parameters="self,arg"/> |
| | | <ClientEvent name="beforePost" parameters="self,arg"/> |
| | | <ClientEvent name="onPostFailed" parameters="self,arg"/></ClientEvents></Rule><Rule name="AbstractDataEditor" parents="AbstractEditor" abstract="true" type="com.bstek.dorado.view.widget.form.AbstractDataEditor" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="dataPath" highlight="1"/> |
| | | <Prop name="dataSet" highlight="1" reference="DataSet:id"/> |
| | | <Prop name="property" highlight="1"/></Props><ClientEvents> |
| | | <ClientEvent name="onGetBindingData" parameters="self,arg"/> |
| | | <ClientEvent name="onGetBindingDataType" parameters="self,arg"/></ClientEvents></Rule><Rule name="AbstractTextBox" parents="AbstractDataEditor" abstract="true" type="com.bstek.dorado.view.widget.form.AbstractTextBox" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="text"/> |
| | | <Prop name="trigger" enumValues="triggerClear,autoMappingDropDown1,autoMappingDropDown2,autoOpenMappingDropDown1,autoOpenMappingDropDown2,defaultDateDropDown,defaultDateTimeDropDown,defaultYearMonthDropDown,defaultYearDropDown,defaultMonthDropDown" reference="Trigger:id"/></Props><ClientEvents> |
| | | <ClientEvent name="onValidationStateChange" parameters="self,arg"/> |
| | | <ClientEvent name="onTriggerClick" parameters="self,arg"/> |
| | | <ClientEvent name="onTextEdit" parameters="self,arg"/></ClientEvents></Rule><Rule name="AbstractTextEditor" parents="AbstractTextBox" abstract="true" type="com.bstek.dorado.view.widget.form.AbstractTextEditor" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="blankText"/> |
| | | <Prop name="editable" defaultValue="true" type="boolean"/> |
| | | <Prop name="maxLength" type="int"/> |
| | | <Prop name="minLength" type="int"/> |
| | | <Prop name="required" type="boolean"/> |
| | | <Prop name="selectTextOnFocus" defaultValue="true" type="boolean"/></Props></Rule><Rule name="RadioButton" label="RadioButton" type="com.bstek.dorado.view.widget.form.RadioButton" icon="/com/bstek/dorado/view/widget/form/RadioButton.png"><Props> |
| | | <Prop name="readOnly" type="boolean"/> |
| | | <Prop name="text"/> |
| | | <Prop name="value" type="java.lang.Object"/></Props></Rule><Rule name="AutoFormElement" parents="FormElement" label="AutoFormElement" type="com.bstek.dorado.view.widget.form.autoform.AutoFormElement" scope="protected" category="AutoForm" icon="/com/bstek/dorado/view/widget/form/autoform/AutoFormElement.png" labelProperty="id,name,property" clientTypes="desktop,touch"><Props> |
| | | <Prop name="name"/></Props></Rule><Rule name="Spinner" parents="AbstractTextBox" abstract="true" type="com.bstek.dorado.view.widget.form.Spinner" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="postValueOnSpin" defaultValue="true" type="boolean"/> |
| | | <Prop name="showSpinTrigger" defaultValue="true" type="boolean"/> |
| | | <Prop name="step" defaultValue="1" type="int"/></Props></Rule><Rule name="DropDown" parents="Trigger" abstract="true" type="com.bstek.dorado.view.widget.form.trigger.DropDown" scope="protected"><Props> |
| | | <Prop name="assignmentMap"/> |
| | | <Prop name="autoOpen" type="boolean"/> |
| | | <Prop name="height" type="int"/> |
| | | <Prop name="maxHeight" type="int"/> |
| | | <Prop name="maxWidth" type="int"/> |
| | | <Prop name="minHeight" type="int"/> |
| | | <Prop name="minWidth" type="int"/> |
| | | <Prop name="postValueOnSelect" defaultValue="true" type="boolean"/> |
| | | <Prop name="width" type="int"/></Props><ClientEvents> |
| | | <ClientEvent name="onValueSelect" parameters="self,arg"/> |
| | | <ClientEvent name="onClose" parameters="self,arg"/> |
| | | <ClientEvent name="onOpen" parameters="self,arg"/></ClientEvents></Rule><Rule name="RowListDropDown" parents="DropDown" abstract="true" type="com.bstek.dorado.view.widget.form.trigger.RowListDropDown" scope="protected"><Props> |
| | | <Prop name="displayProperty"/> |
| | | <Prop name="dynaFilter" type="boolean"/> |
| | | <Prop name="filterOnOpen" type="boolean"/> |
| | | <Prop name="filterOnTyping" defaultValue="true" type="boolean"/> |
| | | <Prop name="minFilterInterval" defaultValue="300" type="int"/> |
| | | <Prop name="property" highlight="1"/> |
| | | <Prop name="useEmptyItem" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onFilterItems" parameters="self,arg"/> |
| | | <ClientEvent name="onFilterItem" parameters="self,arg"/></ClientEvents><Children><Child rule="Column" name="Columns" aggregated="true"></Child></Children></Rule><Rule name="Column" parents="ClientEventSupportedElement" abstract="true" type="com.bstek.dorado.view.widget.grid.Column"><Props> |
| | | <Prop name="align" enumValues="left,center,right"/> |
| | | <Prop name="caption"/> |
| | | <Prop name="headerAlign" defaultValue="center" enumValues="left,center,right"/> |
| | | <Prop name="headerRenderer"/> |
| | | <Prop name="name"/> |
| | | <Prop name="supportsOptionMenu" defaultValue="true" type="boolean"/> |
| | | <Prop name="visible" defaultValue="true" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onGetCellEditor" parameters="self,arg"/> |
| | | <ClientEvent name="onHeaderClick" parameters="self,arg"/> |
| | | <ClientEvent name="onRenderHeaderCell" parameters="self,arg"/></ClientEvents></Rule><Rule name="DataColumn" parents="AbstractDataColumn" label="DataColumn" type="com.bstek.dorado.view.widget.grid.DataColumn" icon="/com/bstek/dorado/view/widget/grid/DataColumn.png" labelProperty="name,property"><Props> |
| | | <Prop name="align" enumValues="left,center,right"/> |
| | | <Prop name="dataType" type="com.bstek.dorado.data.type.DataType"/> |
| | | <Prop name="defaultFilterOperator"/> |
| | | <Prop name="displayFormat"/> |
| | | <Prop name="editable" defaultValue="true" type="boolean"/> |
| | | <Prop name="editorType" defaultValue="TextEditor" highlight="1" enumValues="None,TextEditor,PasswordEditor,TextArea,CheckBox,RadioGroup,NumberSpinner"/> |
| | | <Prop name="filterable" defaultValue="true" type="boolean"/> |
| | | <Prop name="property" highlight="1"/> |
| | | <Prop name="readOnly" type="boolean"/> |
| | | <Prop name="required" type="boolean"/> |
| | | <Prop name="sortState" defaultValue="none" enumValues="none,asc,desc"/> |
| | | <Prop name="summaryType" enumValues="sum,average,count,max,min"/> |
| | | <Prop name="trigger" enumValues="triggerClear,autoMappingDropDown1,autoMappingDropDown2,autoOpenMappingDropDown1,autoOpenMappingDropDown2,defaultDateDropDown,defaultDateTimeDropDown,defaultYearMonthDropDown,defaultYearDropDown,defaultMonthDropDown" reference="Trigger:id"/> |
| | | <Prop name="typeFormat"/> |
| | | <Prop name="wrappable" type="boolean"/></Props><Children><Child name="Editor" fixed="true"><Rule name="Wrapper.Editor" label="Editor" nodeName="Editor" icon="/com/bstek/dorado/view/widget/grid/Editor.png"><Children><Child rule="com.bstek.dorado.view.widget.Control" name="Editor"></Child></Children></Rule></Child></Children></Rule><Rule name="AbstractDataColumn" parents="Column" abstract="true" type="com.bstek.dorado.view.widget.grid.AbstractDataColumn"><Props> |
| | | <Prop name="filterBarRenderer"/> |
| | | <Prop name="footerRenderer"/> |
| | | <Prop name="renderer"/> |
| | | <Prop name="resizeable" defaultValue="true" type="boolean"/> |
| | | <Prop name="width"/></Props><ClientEvents> |
| | | <ClientEvent name="onRenderFooterCell" parameters="self,arg"/> |
| | | <ClientEvent name="onRenderCell" parameters="self,arg"/></ClientEvents></Rule><Rule name="ColumnGroup" parents="Column" label="ColumnGroup" type="com.bstek.dorado.view.widget.grid.ColumnGroup" icon="/com/bstek/dorado/view/widget/grid/ColumnGroup.png"><Props> |
| | | <Prop name="align" enumValues="left,center,right" visible="false"/></Props><Children><Child rule="Column" name="Columns" aggregated="true"></Child></Children></Rule><Rule name="IndicatorColumn" parents="AbstractDataColumn" label="IndicatorColumn" type="com.bstek.dorado.view.widget.grid.IndicatorColumn" icon="/com/bstek/dorado/view/widget/grid/IndicatorColumn.png"></Rule><Rule name="RowSelectorColumn" parents="AbstractDataColumn" label="RowSelectorColumn" type="com.bstek.dorado.view.widget.grid.RowSelectorColumn" icon="/com/bstek/dorado/view/widget/grid/RowSelectorColumn.png"></Rule><Rule name="RowNumColumn" parents="AbstractDataColumn" label="RowNumColumn" type="com.bstek.dorado.view.widget.grid.RowNumColumn" icon="/com/bstek/dorado/view/widget/grid/RowNumColumn.png"></Rule><Rule name="AbstractList" parents="com.bstek.dorado.view.widget.Control" abstract="true" type="com.bstek.dorado.view.widget.list.AbstractList" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="allowNoCurrent" type="boolean"/> |
| | | <Prop name="dragMode" defaultValue="item" enumValues="item,control,itemOrControl"/> |
| | | <Prop name="dropMode" defaultValue="insertItems" enumValues="onControl,onItem,insertItems,onOrInsertItems,onAnyWhere"/> |
| | | <Prop name="scrollMode" defaultValue="lazyRender" enumValues="simple,lazyRender,viewport"/> |
| | | <Prop name="selectionMode" defaultValue="none" enumValues="none,singleRow,multiRows"/> |
| | | <Prop name="useNativeScrollbars" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onCompareItems" parameters="self,arg"/> |
| | | <ClientEvent name="onCurrentChange" parameters="self,arg"/> |
| | | <ClientEvent name="onFilterItem" parameters="self,arg"/> |
| | | <ClientEvent name="onSelectionChange" parameters="self,arg"/> |
| | | <ClientEvent name="beforeSelectionChange" parameters="self,arg"/></ClientEvents></Rule><Rule name="RowList" parents="AbstractList" abstract="true" type="com.bstek.dorado.view.widget.list.RowList" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="highlightCurrentRow" defaultValue="true" type="boolean"/> |
| | | <Prop name="highlightHoverRow" defaultValue="true" type="boolean"/> |
| | | <Prop name="highlightSelectedRow" defaultValue="true" type="boolean"/> |
| | | <Prop name="rowHeight" type="int"/></Props><ClientEvents> |
| | | <ClientEvent name="onDataRowClick" parameters="self,arg"/> |
| | | <ClientEvent name="onDataRowDoubleClick" parameters="self,arg"/></ClientEvents></Rule><Rule name="AbstractListBox" parents="RowList" abstract="true" type="com.bstek.dorado.view.widget.list.AbstractListBox" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="property"/> |
| | | <Prop name="renderer"/></Props><ClientEvents> |
| | | <ClientEvent name="onRenderRow" parameters="self,arg"/></ClientEvents></Rule><Rule name="GridSupport" parents="RowList" abstract="true" type="com.bstek.dorado.view.widget.grid.GridSupport" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="cellRenderer"/> |
| | | <Prop name="dynaRowHeight" type="boolean"/> |
| | | <Prop name="fixedColumnCount" type="int"/> |
| | | <Prop name="footerRenderer"/> |
| | | <Prop name="footerRowHeight" type="int"/> |
| | | <Prop name="headerRenderer"/> |
| | | <Prop name="headerRowHeight" type="int"/> |
| | | <Prop name="readOnly" type="boolean"/> |
| | | <Prop name="rowRenderer"/> |
| | | <Prop name="showFooter" type="boolean"/> |
| | | <Prop name="showHeader" defaultValue="true" type="boolean"/> |
| | | <Prop name="stretchColumnsMode" defaultValue="auto" enumValues="auto,off,stretchableColumns,lastColumn,allColumns,allResizeableColumns"/></Props><ClientEvents> |
| | | <ClientEvent name="beforeCellValueEdit" parameters="self,arg"/> |
| | | <ClientEvent name="onGetCellEditor" parameters="self,arg"/> |
| | | <ClientEvent name="onRenderRow" parameters="self,arg"/> |
| | | <ClientEvent name="onRenderFooterCell" parameters="self,arg"/> |
| | | <ClientEvent name="onCellValueEdit" parameters="self,arg"/> |
| | | <ClientEvent name="onRenderCell" parameters="self,arg"/> |
| | | <ClientEvent name="onHeaderClick" parameters="self,arg"/> |
| | | <ClientEvent name="onRenderHeaderCell" parameters="self,arg"/></ClientEvents><Children><Child rule="Column" name="Columns" aggregated="true"></Child></Children></Rule><Rule name="AbstractGrid" parents="GridSupport" abstract="true" type="com.bstek.dorado.view.widget.grid.AbstractGrid" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="filterBarRenderer"/> |
| | | <Prop name="groupFooterRenderer"/> |
| | | <Prop name="groupHeaderRenderer"/> |
| | | <Prop name="groupOnSort" defaultValue="true" type="boolean"/> |
| | | <Prop name="groupProperty"/> |
| | | <Prop name="showFilterBar" type="boolean"/> |
| | | <Prop name="showGroupFooter" type="boolean"/></Props></Rule><Rule name="AbstractTree" parents="RowList" abstract="true" type="com.bstek.dorado.view.widget.tree.AbstractTree" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="defaultExpandedIcon"/> |
| | | <Prop name="defaultExpandedIconClass"/> |
| | | <Prop name="defaultIcon"/> |
| | | <Prop name="defaultIconClass"/> |
| | | <Prop name="dropMode" defaultValue="onItem" enumValues="onControl,onItem,insertItems,onOrInsertItems,onAnyWhere"/> |
| | | <Prop name="expandingAnimated" defaultValue="true" type="boolean"/> |
| | | <Prop name="expandingMode" defaultValue="async" enumValues="async,sync"/> |
| | | <Prop name="indent" type="int"/> |
| | | <Prop name="renderer"/> |
| | | <Prop name="scrollMode" enumValues="simple,lazyRender,viewport"/> |
| | | <Prop name="showLines" type="boolean"/></Props><ClientEvents> |
| | | <ClientEvent name="onRenderNode" parameters="self,arg"/> |
| | | <ClientEvent name="onCollapse" parameters="self,arg"/> |
| | | <ClientEvent name="onNodeAttached" parameters="self,arg"/> |
| | | <ClientEvent name="beforeNodeCheckedChange" parameters="self,arg"/> |
| | | <ClientEvent name="onExpand" parameters="self,arg"/> |
| | | <ClientEvent name="beforeCollapse" parameters="self,arg"/> |
| | | <ClientEvent name="beforeCurrentChange" parameters="self,arg"/> |
| | | <ClientEvent name="beforeExpand" parameters="self,arg"/> |
| | | <ClientEvent name="onNodeDetached" parameters="self,arg"/> |
| | | <ClientEvent name="onNodeCheckedChange" parameters="self,arg"/></ClientEvents></Rule><Rule name="BaseNode" abstract="true" type="com.bstek.dorado.view.widget.tree.BaseNode"><Props> |
| | | <Prop name="autoCheckChildren" defaultValue="true" type="boolean"/> |
| | | <Prop name="checkable" type="boolean"/> |
| | | <Prop name="checked" type="boolean"/> |
| | | <Prop name="data" type="java.lang.Object"/> |
| | | <Prop name="expanded" type="boolean"/> |
| | | <Prop name="expandedIcon"/> |
| | | <Prop name="expandedIconClass"/> |
| | | <Prop name="hasChild" type="boolean"/> |
| | | <Prop name="icon"/> |
| | | <Prop name="iconClass"/> |
| | | <Prop name="ignored" type="boolean"/> |
| | | <Prop name="label"/> |
| | | <Prop name="tags"/> |
| | | <Prop name="tip"/> |
| | | <Prop name="userData" type="java.lang.Object"/></Props><Children><Child rule="BaseNode" name="Nodes" aggregated="true"></Child></Children></Rule><Rule name="Node" parents="BaseNode" label="Node" type="com.bstek.dorado.view.widget.tree.Node" icon="/com/bstek/dorado/view/widget/tree/Node.png"><PrimitiveProps> |
| | | <Prop name="id" highlight="1"/></PrimitiveProps><Props><Prop name="metaData" type="java.util.Map" compositeType="Open"></Prop></Props></Rule><Rule name="BindingConfig" label="BindingConfig" type="com.bstek.dorado.view.widget.tree.BindingConfig" icon="/com/bstek/dorado/view/widget/tree/BindingConfig.png"><Props> |
| | | <Prop name="autoCheckChildren" defaultValue="true" type="boolean"/> |
| | | <Prop name="checkable" type="boolean"/> |
| | | <Prop name="checkedProperty"/> |
| | | <Prop name="childrenProperty"/> |
| | | <Prop name="expandLevel" type="int"/> |
| | | <Prop name="expandedIcon"/> |
| | | <Prop name="expandedIconClass"/> |
| | | <Prop name="expandedIconProperty"/> |
| | | <Prop name="hasChild" type="java.lang.Boolean"/> |
| | | <Prop name="hasChildProperty"/> |
| | | <Prop name="icon"/> |
| | | <Prop name="iconClass"/> |
| | | <Prop name="iconProperty"/> |
| | | <Prop name="ignored" type="boolean"/> |
| | | <Prop name="labelProperty"/> |
| | | <Prop name="name"/> |
| | | <Prop name="recursive" type="boolean"/> |
| | | <Prop name="tags"/> |
| | | <Prop name="tipProperty"/></Props><Children><Child rule="BindingConfig" name="ChildBindingConfigs" aggregated="true"></Child></Children></Rule><Rule name="AbstractBlockView" parents="AbstractList" abstract="true" type="com.bstek.dorado.view.widget.blockview.AbstractBlockView" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="blockDecoratorSize" defaultValue="4" type="int"/> |
| | | <Prop name="blockHeight" defaultValue="80" type="int"/> |
| | | <Prop name="blockLayout" defaultValue="vertical" enumValues="vertical,horizontal"/> |
| | | <Prop name="blockWidth" defaultValue="80" type="int"/> |
| | | <Prop name="fillLine" type="boolean"/> |
| | | <Prop name="horiPadding" defaultValue="8" type="int"/> |
| | | <Prop name="horiSpacing" defaultValue="8" type="int"/> |
| | | <Prop name="lineSize" type="int"/> |
| | | <Prop name="renderer"/> |
| | | <Prop name="vertPadding" defaultValue="8" type="int"/> |
| | | <Prop name="vertSpacing" defaultValue="8" type="int"/></Props><ClientEvents> |
| | | <ClientEvent name="onBlockClick" parameters="self,arg" clientTypes="desktop"/> |
| | | <ClientEvent name="onBlockDoubleClick" parameters="self,arg" clientTypes="desktop"/> |
| | | <ClientEvent name="onRenderBlock" parameters="self,arg"/> |
| | | <ClientEvent name="onBlockTap" parameters="self,arg" clientTypes="touch"/> |
| | | <ClientEvent name="onBlockMouseDown" parameters="self,arg"/> |
| | | <ClientEvent name="onBlockMouseUp" parameters="self,arg"/> |
| | | <ClientEvent name="onBlockTapHold" parameters="self,arg" clientTypes="touch"/></ClientEvents></Rule><Rule name="AbstractTreeGrid" parents="GridSupport" abstract="true" type="com.bstek.dorado.view.widget.treegrid.AbstractTreeGrid" scope="protected" clientTypes="desktop"><Props> |
| | | <Prop name="defaultExpandedIcon"/> |
| | | <Prop name="defaultExpandedIconClass"/> |
| | | <Prop name="defaultIcon"/> |
| | | <Prop name="defaultIconClass"/> |
| | | <Prop name="dropMode" defaultValue="onItem" enumValues="onControl,onItem,insertItems,onOrInsertItems,onAnyWhere"/> |
| | | <Prop name="expandingAnimated" defaultValue="true" type="boolean"/> |
| | | <Prop name="expandingMode" defaultValue="async" enumValues="async,sync"/> |
| | | <Prop name="indent" type="int"/> |
| | | <Prop name="showLines" type="boolean"/> |
| | | <Prop name="treeColumn" highlight="1"/></Props><ClientEvents> |
| | | <ClientEvent name="onRenderNode" parameters="self,arg"/> |
| | | <ClientEvent name="onCollapse" parameters="self,arg"/> |
| | | <ClientEvent name="onNodeAttached" parameters="self,arg"/> |
| | | <ClientEvent name="beforeNodeCheckedChange" parameters="self,arg"/> |
| | | <ClientEvent name="onExpand" parameters="self,arg"/> |
| | | <ClientEvent name="beforeCollapse" parameters="self,arg"/> |
| | | <ClientEvent name="beforeExpand" parameters="self,arg"/> |
| | | <ClientEvent name="onNodeDetached" parameters="self,arg"/> |
| | | <ClientEvent name="onNodeCheckedChange" parameters="self,arg"/></ClientEvents><Children><Child name="Columns" fixed="true"><Rule name="Wrapper.Columns" label="Columns" nodeName="Columns" icon="/com/bstek/dorado/view/widget/treegrid/Columns.png"><Children><Child rule="Column" name="Columns" aggregated="true"></Child></Children></Rule></Child></Children></Rule><Rule name="Filter" label="Filter" type="com.bstek.dorado.uploader.widget.Filter" labelProperty="title"><Props> |
| | | <Prop name="extensions"/> |
| | | <Prop name="title"/></Props></Rule><Rule name="DefaultView" parents="View" label="View" nodeName="View" type="com.bstek.dorado.view.DefaultView" category="General" icon="/com/bstek/dorado/view/DefaultView.png" clientTypes="desktop"></Rule></RuleSet> |
| | |
| | | </properties> |
| | | |
| | | |
| | | |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- å¼å
¥IOå
--> |
| | |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <configuration> |
| | | <source>1.8</source> |
| | | <target>1.8</target> |
| | | <compilerArguments> |
| | | <extdirs>src\main\webapp\WEB-INF\lib</extdirs> |
| | | </compilerArguments> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <configuration> |
| | | <source>${java.version}</source> |
| | | <target>${java.version}</target> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | |
| | | <resources> |
| | | <resource> |
| | | <directory>src/main/java</directory> |
| | | <includes> |
| | | <include>**/*.xml</include> |
| | | <include>**/*.js</include> |
| | | </includes> |
| | | <filtering>true</filtering> |
| | | </resource> |
| | | <resource> |
| | | <directory>src/main/resources</directory> |
| | | </resource> |
| | | </resources> |
| | | </build> |
| | | |
| | | |
| | | <!-- <repositories>--> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ViewConfig> |
| | | <Arguments/> |
| | | <Context/> |
| | | <Model> |
| | | <DataType name="dtMain"> |
| | | <Property name="creationType">com.ld.igds.models.DeviceModbus</Property> |
| | | <PropertyDef name="id"> |
| | | <Property/> |
| | | <Property name="label">ID</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="deviceCode"> |
| | | <Property/> |
| | | <Property name="label">设å¤ç¼ç </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="open"> |
| | | <Property/> |
| | | <Property name="label">å¼å°å</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="openFun"> |
| | | <Property/> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="close"> |
| | | <Property/> |
| | | <Property name="label">å
³å°å</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="closeFun"> |
| | | <Property/> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="stop"> |
| | | <Property/> |
| | | <Property name="label">åå°å</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="stopFun"> |
| | | <Property/> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="openEnd"> |
| | | <Property/> |
| | | <Property name="label">åå°å</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="openEndFun"> |
| | | <Property/> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="closeEnd"> |
| | | <Property/> |
| | | <Property name="label">å
³å°ä½å°å</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="closeEndFun"> |
| | | <Property/> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="openError"> |
| | | <Property/> |
| | | <Property name="label">弿
éå°å</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="openErrorFun"> |
| | | <Property/> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="closeError"> |
| | | <Property/> |
| | | <Property name="label">å
³æ
éå°å</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="closeErrorFun"> |
| | | <Property/> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="bizType"> |
| | | <Property/> |
| | | <Property name="label">ä¸å¡ç±»å</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("dicTriggerPR#triggerBizType").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="serId"> |
| | | <Property/> |
| | | <Property name="label">æå±åæº</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}</Property> |
| | | <Property name="keyProperty">id</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | </DataType> |
| | | </Model> |
| | | <View layout="padding:5;regionPadding:5"> |
| | | <Property name="packages">font-awesome,css-common</Property> |
| | | <DataSet id="dsMain"> |
| | | <Property name="loadMode">lazy</Property> |
| | | <Property name="dataType">[dtMain]</Property> |
| | | <Property name="dataProvider">deviceModbusPR#listAll</Property> |
| | | </DataSet> |
| | | <Container layout="regionPadding:10" layoutConstraint="top"> |
| | | <Property name="exClassName">bg-color</Property> |
| | | <Property name="contentOverflow">hidden</Property> |
| | | <Property name="height">55</Property> |
| | | <Label layoutConstraint="left"> |
| | | <Property name="text">èåæ ï¼</Property> |
| | | </Label> |
| | | <Button layoutConstraint="left"> |
| | | <ClientEvent name="onClick">view.get("#dsMain").insert({});</ClientEvent> |
| | | <Property name="caption">æ°å¢</Property> |
| | | <Property name="exClassName">btn-default</Property> |
| | | <Property name="iconClass">fa fa-plus</Property> |
| | | </Button> |
| | | <Button> |
| | | <ClientEvent name="onClick"> view.get("#uaAction").execute(); </ClientEvent> |
| | | <Property name="caption">ä¿å</Property> |
| | | <Property name="iconClass">fa fa-check</Property> |
| | | <Property name="exClassName">btn-normal</Property> |
| | | </Button> |
| | | <Button layoutConstraint="left"> |
| | | <ClientEvent name="onClick">var data = view.get("#dsMain.data:#");
 |
| | | if(!data){
 |
| | | return;
 |
| | | }
 |
| | | view.get("#ajaxDel").set("parameter",data).execute(function(result){
 |
| | | if(result){
 |
| | | $alert(result);
 |
| | | return;
 |
| | | }else{
 |
| | | data.remove();
 |
| | | }
 |
| | | }); </ClientEvent> |
| | | <Property name="caption">å é¤</Property> |
| | | <Property name="exClassName">btn-warn</Property> |
| | | <Property name="iconClass">fa fa-minus</Property> |
| | | </Button> |
| | | <Button layoutConstraint="left"> |
| | | <ClientEvent name="onClick">view.get("#dsMain").flushAsync(); </ClientEvent> |
| | | <Property name="caption">å·æ°</Property> |
| | | <Property name="exClassName">btn-default</Property> |
| | | <Property name="iconClass">fa fa-refresh</Property> |
| | | </Button> |
| | | <Button layoutConstraint="left"> |
| | | <Property name="caption">å·æ°ç¼å</Property> |
| | | <Property name="exClassName">btn-default</Property> |
| | | <Property name="iconClass">fa fa-refresh</Property> |
| | | <Property name="action">ajaxFlushCache</Property> |
| | | </Button> |
| | | </Container> |
| | | <Container layout="regionPadding:10" layoutConstraint="center"> |
| | | <Property name="exClassName">bg-color</Property> |
| | | <DataGrid layoutConstraint="center padding:5px"> |
| | | <Property name="dataSet">dsMain</Property> |
| | | <RowNumColumn/> |
| | | <DataColumn name="deviceCode"> |
| | | <Property name="property">deviceCode</Property> |
| | | </DataColumn> |
| | | <DataColumn name="serId"> |
| | | <Property name="property">serId</Property> |
| | | </DataColumn> |
| | | <DataColumn name="bizType"> |
| | | <Property name="property">bizType</Property> |
| | | </DataColumn> |
| | | <ColumnGroup> |
| | | <Property name="caption">弿ä½</Property> |
| | | <DataColumn name="open"> |
| | | <Property name="property">open</Property> |
| | | <Property name="caption">å°å</Property> |
| | | <Property name="width">80</Property> |
| | | </DataColumn> |
| | | <DataColumn name="openFun"> |
| | | <Property name="property">openFun</Property> |
| | | <Property name="caption">åè½</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | </DataColumn> |
| | | </ColumnGroup> |
| | | <ColumnGroup> |
| | | <Property name="caption">å
³æä½</Property> |
| | | <DataColumn name="close"> |
| | | <Property name="property">close</Property> |
| | | <Property name="caption">å°å</Property> |
| | | <Property name="width">80</Property> |
| | | </DataColumn> |
| | | <DataColumn name="closeFun"> |
| | | <Property name="property">closeFun</Property> |
| | | <Property name="caption">åè½</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | </DataColumn> |
| | | </ColumnGroup> |
| | | <ColumnGroup> |
| | | <Property name="caption">åæä½</Property> |
| | | <DataColumn name="stop"> |
| | | <Property name="property">stop</Property> |
| | | <Property name="caption">å°å</Property> |
| | | <Property name="width">80</Property> |
| | | </DataColumn> |
| | | <DataColumn name="stopFun"> |
| | | <Property name="property">stopFun</Property> |
| | | <Property name="caption">åè½</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | </DataColumn> |
| | | </ColumnGroup> |
| | | <ColumnGroup> |
| | | <Property name="caption">å¼å°ä½</Property> |
| | | <DataColumn name="openEnd"> |
| | | <Property name="property">openEnd</Property> |
| | | <Property name="caption">å°å</Property> |
| | | <Property name="width">80</Property> |
| | | </DataColumn> |
| | | <DataColumn name="openEndFun"> |
| | | <Property name="property">openEndFun</Property> |
| | | <Property name="caption">åè½</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | </DataColumn> |
| | | </ColumnGroup> |
| | | <ColumnGroup> |
| | | <Property name="caption">å
³å°ä½</Property> |
| | | <DataColumn name="closeEnd"> |
| | | <Property name="property">closeEnd</Property> |
| | | <Property name="caption">å°å</Property> |
| | | <Property name="width">80</Property> |
| | | </DataColumn> |
| | | <DataColumn name="closeEndFun"> |
| | | <Property name="property">closeEndFun</Property> |
| | | <Property name="caption">åè½</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | </DataColumn> |
| | | </ColumnGroup> |
| | | <ColumnGroup> |
| | | <Property name="caption">弿
é</Property> |
| | | <DataColumn name="openError"> |
| | | <Property name="property">openError</Property> |
| | | <Property name="caption">å°å</Property> |
| | | <Property name="width">80</Property> |
| | | </DataColumn> |
| | | <DataColumn name="openErrorFun"> |
| | | <Property name="property">openErrorFun</Property> |
| | | <Property name="caption">åè½</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | </DataColumn> |
| | | </ColumnGroup> |
| | | <ColumnGroup> |
| | | <Property name="caption">å
³æ
é</Property> |
| | | <DataColumn name="closeError"> |
| | | <Property name="property">closeError</Property> |
| | | <Property name="caption">å°å</Property> |
| | | <Property name="width">80</Property> |
| | | </DataColumn> |
| | | <DataColumn name="closeErrorFun"> |
| | | <Property name="property">closeErrorFun</Property> |
| | | <Property name="caption">åè½</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | </DataColumn> |
| | | </ColumnGroup> |
| | | </DataGrid> |
| | | </Container> |
| | | <UpdateAction id="uaAction"> |
| | | <Property name="dataResolver">deviceModbusPR#updateData</Property> |
| | | <UpdateItem> |
| | | <Property name="dataSet">dsMain</Property> |
| | | <Property name="dataPath">!DIRTY_TREE</Property> |
| | | </UpdateItem> |
| | | </UpdateAction> |
| | | <AjaxAction id="ajaxDel"> |
| | | <Property name="service">deviceModbusPR#delData</Property> |
| | | <Property name="confirmMessage">ç¡®å®è¦å é¤ä¹ï¼</Property> |
| | | </AjaxAction> |
| | | <AjaxAction id="ajaxFlushCache"> |
| | | <Property name="service">deviceModbusPR#flushCache</Property> |
| | | <Property name="successMessage">ç¼åæ´æ°æå</Property> |
| | | </AjaxAction> |
| | | </View> |
| | | </ViewConfig> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.modbus; |
| | | |
| | | import com.bstek.dorado.annotation.DataProvider; |
| | | import com.bstek.dorado.annotation.DataResolver; |
| | | import com.bstek.dorado.annotation.Expose; |
| | | import com.ld.igds.modbus.service.HModbusService; |
| | | import com.ld.igds.models.DeviceModbus; |
| | | import com.ld.igds.models.DicTrigger; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * MOOBUS-TCP设å¤åæ°é
ç½® |
| | | */ |
| | | @Component |
| | | public class DeviceModbusPR { |
| | | |
| | | @Resource |
| | | private HModbusService deviceModbusService; |
| | | |
| | | /** |
| | | * deviceModbusPR#listAll |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<DeviceModbus> listAll() { |
| | | String companyId = ContextUtil.getCompanyId(); |
| | | return deviceModbusService.listAllDevice(companyId); |
| | | } |
| | | |
| | | /** |
| | | * deviceModbusPR#flushCache |
| | | * |
| | | * @return |
| | | */ |
| | | @Expose |
| | | public void flushCache() { |
| | | String companyId = ContextUtil.getCompanyId(); |
| | | deviceModbusService.flushCacheDevice(companyId); |
| | | } |
| | | |
| | | /** |
| | | * deviceModbusPR#delData |
| | | * |
| | | * @return |
| | | */ |
| | | @Expose |
| | | public String delData(DeviceModbus data) { |
| | | if (null == data.getId()) return null; |
| | | return deviceModbusService.delDataDevice(data); |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®æ´æ° |
| | | * deviceModbusPR#updateData |
| | | * |
| | | * @param details |
| | | */ |
| | | @DataResolver |
| | | public void updateData(List<DeviceModbus> details) { |
| | | deviceModbusService.updateDataDevice(details); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()} |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<DicTrigger> triggerFun() { |
| | | List<DicTrigger> list = new ArrayList<>(); |
| | | |
| | | list.add(new DicTrigger(ModbusConstant.FUN_01, "01-读线å")); |
| | | list.add(new DicTrigger(ModbusConstant.FUN_02, "02-读离æ£éè¾å
¥")); |
| | | list.add(new DicTrigger(ModbusConstant.FUN_03, "03-è¯»ä¿æå¯åå¨")); |
| | | list.add(new DicTrigger(ModbusConstant.FUN_04, "04-读è¾å
¥å¯åå¨")); |
| | | list.add(new DicTrigger(ModbusConstant.FUN_05, "05-åå个线å")); |
| | | list.add(new DicTrigger(ModbusConstant.FUN_06, "06-åå个å¯åå¨")); |
| | | list.add(new DicTrigger(ModbusConstant.FUN_15, "15-åå¤ä¸ªçº¿å")); |
| | | list.add(new DicTrigger(ModbusConstant.FUN_16, "16-åå¤ä¸ªå¯åå¨")); |
| | | list.add(new DicTrigger(ModbusConstant.FUN_99, "æªé
ç½®")); |
| | | return list; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ViewConfig> |
| | | <Arguments/> |
| | | <Context/> |
| | | <Model> |
| | | <DataType name="dtMain"> |
| | | <Property name="creationType">com.ld.igds.models.DeviceModbus</Property> |
| | | <PropertyDef name="id"> |
| | | <Property></Property> |
| | | <Property name="label">ID</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="deviceCode"> |
| | | <Property></Property> |
| | | <Property name="label">ä»åºç¼ç </Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("depotPR#getAllCache").getResult()}</Property> |
| | | <Property name="keyProperty">id</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="open"> |
| | | <Property></Property> |
| | | <Property name="label">å¼å°å</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="openFun"> |
| | | <Property></Property> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="close"> |
| | | <Property></Property> |
| | | <Property name="label">å
³å°å</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="closeFun"> |
| | | <Property></Property> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="stop"> |
| | | <Property></Property> |
| | | <Property name="label">åå°å</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="stopFun"> |
| | | <Property></Property> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="openEnd"> |
| | | <Property></Property> |
| | | <Property name="label">å¼å°ä½</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="openEndFun"> |
| | | <Property></Property> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="closeEnd"> |
| | | <Property></Property> |
| | | <Property name="label">å
³å°ä½</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="closeEndFun"> |
| | | <Property></Property> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="openError"> |
| | | <Property></Property> |
| | | <Property name="label">弿
é</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="openErrorFun"> |
| | | <Property></Property> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="closeError"> |
| | | <Property></Property> |
| | | <Property name="label">å
³æ
é</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="closeErrorFun"> |
| | | <Property></Property> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <Reference name="listGas"> |
| | | <Property name="dataType">[dtGas]</Property> |
| | | <Property name="dataProvider">gasModbusPR#listGasModBus</Property> |
| | | <Property name="parameter">$${this.deviceCode}</Property> |
| | | </Reference> |
| | | </DataType> |
| | | <DataType name="dtGas"> |
| | | <Property name="creationType">com.ld.igds.models.GasModbus</Property> |
| | | <PropertyDef name="id"> |
| | | <Property></Property> |
| | | <Property name="label">ID</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="depotId"> |
| | | <Property></Property> |
| | | <Property name="label">æå±ä»åº</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="passcode"> |
| | | <Property name="dataType">int</Property> |
| | | <Property name="label">éé</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="co2"> |
| | | <Property></Property> |
| | | <Property name="label">äºæ°§å碳</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="co2Fun"> |
| | | <Property></Property> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="o2"> |
| | | <Property></Property> |
| | | <Property name="label">æ°§æ°</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="o2Fun"> |
| | | <Property></Property> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="ph3"> |
| | | <Property></Property> |
| | | <Property name="label">ç£·åæ°¢</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="ph3Fun"> |
| | | <Property></Property> |
| | | <Property name="label">åè½å·</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deviceModbusPR#triggerFun").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | </DataType> |
| | | </Model> |
| | | <View layout="padding:5;regionPadding:5"> |
| | | <Property name="packages">font-awesome,css-common</Property> |
| | | <DataSet id="dsMain"> |
| | | <Property name="loadMode">lazy</Property> |
| | | <Property name="dataType">dtMain</Property> |
| | | <Property name="dataProvider">gasModbusPR#getGasData</Property> |
| | | <Property name="parameter">${request.getParameter('depotId')}</Property> |
| | | </DataSet> |
| | | <Container layout="regionPadding:10" layoutConstraint="top"> |
| | | <Property name="exClassName">bg-color</Property> |
| | | <Property name="contentOverflow">hidden</Property> |
| | | <Property name="height">55</Property> |
| | | <Label layoutConstraint="left"> |
| | | <Property name="text">èåæ ï¼</Property> |
| | | </Label> |
| | | <Button layoutConstraint="left"> |
| | | <ClientEvent name="onClick">var list = view.get("#dsMain.data").get("listGas");
 |
| | | list.insert({});</ClientEvent> |
| | | <Property name="caption">æ°å¢éé</Property> |
| | | <Property name="exClassName">btn-default</Property> |
| | | <Property name="iconClass">fa fa-plus</Property> |
| | | </Button> |
| | | <Button> |
| | | <ClientEvent name="onClick">view.get("#uaAction").execute(); </ClientEvent> |
| | | <Property name="caption">ä¿åæ°æ®</Property> |
| | | <Property name="iconClass">fa fa-check</Property> |
| | | <Property name="exClassName">btn-normal</Property> |
| | | </Button> |
| | | <Button layoutConstraint="left"> |
| | | <ClientEvent name="onClick">var data = view.get("#dataGrid1").getCurrentItem();;
 |
| | | if(!data){
 |
| | | return;
 |
| | | }
 |
| | | view.get("#ajaxDel").set("parameter",data).execute(function(result){
 |
| | | if(result){
 |
| | | $alert(result);
 |
| | | return;
 |
| | | }else{
 |
| | | data.remove();
 |
| | | }
 |
| | | }); </ClientEvent> |
| | | <Property name="caption">å é¤éé</Property> |
| | | <Property name="exClassName">btn-warn</Property> |
| | | <Property name="iconClass">fa fa-minus</Property> |
| | | </Button> |
| | | </Container> |
| | | <Container layout="regionPadding:10" layoutConstraint="center"> |
| | | <Property name="exClassName">bg-color</Property> |
| | | <AutoForm> |
| | | <Property name="dataSet">dsMain</Property> |
| | | <Property name="cols">*,*,*,*</Property> |
| | | <Property name="labelAlign">right</Property> |
| | | <Property name="labelSeparator">ï¼</Property> |
| | | <Property name="labelWidth">100</Property> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">deviceCode</Property> |
| | | <Property name="property">deviceCode</Property> |
| | | <Property name="label">ä»åºç¼ç </Property> |
| | | <Property name="labelWidth">100</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">open</Property> |
| | | <Property name="property">open</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">openFun</Property> |
| | | <Property name="property">openFun</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">close</Property> |
| | | <Property name="property">close</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">closeFun</Property> |
| | | <Property name="property">closeFun</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">stop</Property> |
| | | <Property name="property">stop</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">stopFun</Property> |
| | | <Property name="property">stopFun</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">openEnd</Property> |
| | | <Property name="property">openEnd</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">openEndFun</Property> |
| | | <Property name="property">openEndFun</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">closeEnd</Property> |
| | | <Property name="property">closeEnd</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">closeEndFun</Property> |
| | | <Property name="property">closeEndFun</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">openError</Property> |
| | | <Property name="property">openError</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">openErrorFun</Property> |
| | | <Property name="property">openErrorFun</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">closeError</Property> |
| | | <Property name="property">closeError</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">closeErrorFun</Property> |
| | | <Property name="property">closeErrorFun</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | </AutoForm> |
| | | <ToolBar> |
| | | <ToolBarLabel> |
| | | <Property name="text">æ£æµééé
ç½®</Property> |
| | | <Property name="style"> |
| | | <Property name="font-weight">bold</Property> |
| | | </Property> |
| | | </ToolBarLabel> |
| | | </ToolBar> |
| | | <DataGrid id="dataGrid1" layoutConstraint="center padding:5px"> |
| | | <Property name="dataSet">dsMain</Property> |
| | | <Property name="dataPath">#.listGas</Property> |
| | | <RowNumColumn/> |
| | | <DataColumn> |
| | | <Property name="property">passcode</Property> |
| | | <Property name="name">passcode</Property> |
| | | <Editor/> |
| | | </DataColumn> |
| | | <ColumnGroup> |
| | | <Property name="caption">CO2</Property> |
| | | <DataColumn> |
| | | <Property name="property">co2</Property> |
| | | <Property name="caption">å°å</Property> |
| | | <Property name="name">co2</Property> |
| | | </DataColumn> |
| | | <DataColumn> |
| | | <Property name="property">co2Fun</Property> |
| | | <Property name="caption">åè½</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | <Property name="name">co2Fun</Property> |
| | | </DataColumn> |
| | | </ColumnGroup> |
| | | <ColumnGroup> |
| | | <Property name="caption">O2</Property> |
| | | <DataColumn> |
| | | <Property name="property">o2</Property> |
| | | <Property name="caption">å°å</Property> |
| | | <Property name="name">o2</Property> |
| | | </DataColumn> |
| | | <DataColumn> |
| | | <Property name="property">o2Fun</Property> |
| | | <Property name="caption">åè½</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | <Property name="name">o2Fun</Property> |
| | | </DataColumn> |
| | | </ColumnGroup> |
| | | <ColumnGroup> |
| | | <Property name="caption">PH3</Property> |
| | | <DataColumn> |
| | | <Property name="property">ph3</Property> |
| | | <Property name="caption">å°å</Property> |
| | | <Property name="name">ph3</Property> |
| | | </DataColumn> |
| | | <DataColumn> |
| | | <Property name="property">ph3Fun</Property> |
| | | <Property name="caption">åè½</Property> |
| | | <Property name="trigger">autoMappingDropDown1</Property> |
| | | <Property name="name">ph3Fun</Property> |
| | | </DataColumn> |
| | | </ColumnGroup> |
| | | </DataGrid> |
| | | </Container> |
| | | <UpdateAction id="uaAction"> |
| | | <Property name="dataResolver">gasModbusPR#updateData</Property> |
| | | <UpdateItem> |
| | | <Property name="dataSet">dsMain</Property> |
| | | <Property name="dataPath">[#current]</Property> |
| | | </UpdateItem> |
| | | </UpdateAction> |
| | | <AjaxAction id="ajaxDel"> |
| | | <Property name="service">gasModbusPR#delData</Property> |
| | | <Property name="confirmMessage">ç¡®å®è¦å é¤ä¹ï¼</Property> |
| | | </AjaxAction> |
| | | </View> |
| | | </ViewConfig> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.modbus; |
| | | |
| | | import com.bstek.dorado.annotation.DataProvider; |
| | | import com.bstek.dorado.annotation.DataResolver; |
| | | import com.bstek.dorado.annotation.Expose; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.modbus.service.HModbusService; |
| | | import com.ld.igds.models.DeviceModbus; |
| | | import com.ld.igds.models.GasModbus; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * MOOBUS-TCP设å¤åæ°é
ç½® |
| | | */ |
| | | @Component |
| | | public class GasModbusPR { |
| | | |
| | | @Resource |
| | | private HModbusService modbusService; |
| | | |
| | | /** |
| | | * gasModbusPR#getGasData |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public DeviceModbus getGasData(String depotId) { |
| | | if (null == depotId) return new DeviceModbus(); |
| | | |
| | | String bizType = BizType.GAS.getCode(); |
| | | |
| | | String companyId = ContextUtil.getCompanyId(); |
| | | |
| | | DeviceModbus result = modbusService.getGasData(companyId, depotId, bizType); |
| | | |
| | | if (null == result) { |
| | | result = new DeviceModbus(); |
| | | result.setBizType(bizType); |
| | | result.setDeviceCode(depotId); |
| | | result.setListGas(new ArrayList<>()); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * gasModbusPR#listGasModBus |
| | | * |
| | | * @param depotId |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<GasModbus> listGasModBus(String depotId) { |
| | | return modbusService.listGasModBus(depotId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * gasModbusPR#updateData |
| | | * @param data |
| | | */ |
| | | @DataResolver |
| | | public void updateData(DeviceModbus data){ |
| | | modbusService.updateGasModbus(data); |
| | | } |
| | | |
| | | /** |
| | | * deviceModbusPR#delData |
| | | * |
| | | * @return |
| | | */ |
| | | @Expose |
| | | public String delData(GasModbus data) { |
| | | if (null == data.getId()) return null; |
| | | return modbusService.delDataGas(data); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.modbus; |
| | | |
| | | /** |
| | | * MOdBUS-åºç¡å¸¸éä¿¡æ¯ |
| | | */ |
| | | public class ModbusConstant { |
| | | |
| | | |
| | | //01-读线å |
| | | public static final String FUN_01 = "01"; |
| | | //02-读离æ£éè¾å
¥ |
| | | public static final String FUN_02 = "02"; |
| | | //03-è¯»ä¿æå¯åå¨ |
| | | public static final String FUN_03 = "03"; |
| | | //04-读è¾å
¥å¯åå¨ |
| | | public static final String FUN_04 = "04"; |
| | | //05-åå个线å |
| | | public static final String FUN_05 = "05"; |
| | | //06-åå个å¯åå¨ |
| | | public static final String FUN_06 = "06"; |
| | | //15-åå¤ä¸ªçº¿å |
| | | public static final String FUN_15 = "15"; |
| | | //16-åå¤ä¸ªå¯åå¨ |
| | | public static final String FUN_16 = "16"; |
| | | //99-ä¸æä½ |
| | | public static final String FUN_99 = "99"; |
| | | |
| | | |
| | | |
| | | public static final String MODBUS_DEVICE_CACHE = "MODBUS_DEVICE"; |
| | | |
| | | public static final String MODBUS_GAS_CACHE_LIST = "MODBUS_GAS_LIST"; |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.modbus.service; |
| | | |
| | | import com.bstek.bdf2.core.orm.hibernate.HibernateDao; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.constant.Constant; |
| | | import com.ld.igds.constant.RedisConst; |
| | | import com.ld.igds.modbus.ModbusConstant; |
| | | import com.ld.igds.models.DeviceModbus; |
| | | import com.ld.igds.models.GasModbus; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import com.ld.igds.util.RedisUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.hibernate.Session; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Component |
| | | public class HModbusService extends HibernateDao { |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | public List<DeviceModbus> listAllDevice(String companyId) { |
| | | |
| | | String hql = " from " + DeviceModbus.class.getName() + " where 1=1 order by deviceCode+0"; |
| | | |
| | | return this.query(hql); |
| | | } |
| | | |
| | | public void flushCacheDevice(String companyId) { |
| | | |
| | | if (null == companyId) companyId = ContextUtil.getDefaultCompanyId(); |
| | | |
| | | List<DeviceModbus> listAll = this.listAllDevice(companyId); |
| | | |
| | | if (null == listAll || listAll.isEmpty()) return; |
| | | |
| | | |
| | | String key; |
| | | DeviceModbus entityDevice; |
| | | for (DeviceModbus hibDevice : listAll) { |
| | | entityDevice = new DeviceModbus(); |
| | | BeanUtils.copyProperties(hibDevice, entityDevice); |
| | | |
| | | if (null == hibDevice.getBizType()) hibDevice.setBizType(BizType.AREATION.getCode()); |
| | | if (BizType.AREATION.getCode().equals(hibDevice.getBizType())) { |
| | | key = RedisConst.buildKey(companyId, ModbusConstant.MODBUS_DEVICE_CACHE, hibDevice.getDeviceCode()); |
| | | } else { |
| | | key = RedisConst.buildKey(companyId, ModbusConstant.MODBUS_DEVICE_CACHE, hibDevice.getDeviceCode(), hibDevice.getBizType()); |
| | | } |
| | | redisUtil.set(key, entityDevice); |
| | | } |
| | | } |
| | | |
| | | public DeviceModbus getCacheDeviceModbus(String companyId, String deviceCode) { |
| | | return getCacheDeviceModbus(companyId, deviceCode, null); |
| | | } |
| | | |
| | | public DeviceModbus getCacheDeviceModbus(String companyId, String deviceCode, String bizType) { |
| | | String key = RedisConst.buildKey(companyId, ModbusConstant.MODBUS_DEVICE_CACHE, deviceCode); |
| | | if (null != bizType && !BizType.AREATION.equals(bizType)) { |
| | | key = RedisConst.buildKey(companyId, ModbusConstant.MODBUS_DEVICE_CACHE, deviceCode, bizType); |
| | | } |
| | | return (DeviceModbus) redisUtil.get(key); |
| | | } |
| | | |
| | | public void updateDataDevice(List<DeviceModbus> details) { |
| | | if (null == details || details.isEmpty()) return; |
| | | |
| | | Session session = this.getSessionFactory().openSession(); |
| | | try { |
| | | for (DeviceModbus device : details) { |
| | | |
| | | |
| | | device = updateInitData(device); |
| | | |
| | | if (null == device.getId()) { |
| | | device.setId(ContextUtil.getUUID()); |
| | | session.save(device); |
| | | } else { |
| | | session.update(device); |
| | | } |
| | | } |
| | | |
| | | flushCacheDevice(null); |
| | | |
| | | } catch (Exception e) { |
| | | |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | } |
| | | |
| | | private DeviceModbus updateInitData(DeviceModbus device) { |
| | | if (StringUtils.isEmpty(device.getOpen())) device.setOpen(Constant.YN_N); |
| | | if (StringUtils.isEmpty(device.getOpenFun())) device.setOpenFun(ModbusConstant.FUN_99); |
| | | |
| | | if (StringUtils.isEmpty(device.getOpenEnd())) device.setOpenEnd(Constant.YN_N); |
| | | if (StringUtils.isEmpty(device.getOpenEndFun())) device.setOpenEndFun(ModbusConstant.FUN_99); |
| | | |
| | | if (StringUtils.isEmpty(device.getOpenError())) device.setOpenError(Constant.YN_N); |
| | | if (StringUtils.isEmpty(device.getOpenErrorFun())) device.setOpenErrorFun(ModbusConstant.FUN_99); |
| | | |
| | | if (StringUtils.isEmpty(device.getClose())) device.setClose(Constant.YN_N); |
| | | if (StringUtils.isEmpty(device.getCloseFun())) device.setCloseFun(ModbusConstant.FUN_99); |
| | | |
| | | if (StringUtils.isEmpty(device.getCloseEnd())) device.setCloseEnd(Constant.YN_N); |
| | | if (StringUtils.isEmpty(device.getCloseEndFun())) device.setCloseEndFun(ModbusConstant.FUN_99); |
| | | |
| | | if (StringUtils.isEmpty(device.getCloseError())) device.setCloseError(Constant.YN_N); |
| | | if (StringUtils.isEmpty(device.getCloseErrorFun())) device.setCloseErrorFun(ModbusConstant.FUN_99); |
| | | |
| | | if (StringUtils.isEmpty(device.getStop())) device.setStop(Constant.YN_N); |
| | | if (StringUtils.isEmpty(device.getStopFun())) device.setStopFun(ModbusConstant.FUN_99); |
| | | |
| | | |
| | | if (StringUtils.isEmpty(device.getBizType())) device.setBizType(BizType.AREATION.getCode()); |
| | | |
| | | return device; |
| | | } |
| | | |
| | | public String delDataDevice(DeviceModbus data) { |
| | | Session session = this.getSessionFactory().openSession(); |
| | | try { |
| | | session.delete(data); |
| | | flushCacheDevice(null); |
| | | } catch (Exception e) { |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç±»åè·åModbusè½è设å¤é
ç½®ä¿¡æ¯ |
| | | * @param bizType |
| | | * @param serId |
| | | * @return |
| | | */ |
| | | public List<DeviceModbus> getDataByBizType(String bizType, String serId) { |
| | | |
| | | String hql = " from " + DeviceModbus.class.getName() + " where bizType=:bizType and serId =:serId"; |
| | | |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("bizType", bizType); |
| | | param.put("serId", serId); |
| | | |
| | | return this.query(hql, param); |
| | | } |
| | | |
| | | |
| | | public DeviceModbus getGasData(String companyId, String depotId, String bizType) { |
| | | |
| | | String hql = " from " + DeviceModbus.class.getName() + " where bizType=:bizType and deviceCode =:deviceCode"; |
| | | |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("bizType", bizType); |
| | | param.put("deviceCode", depotId); |
| | | List<DeviceModbus> list = this.query(hql, param); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | return null; |
| | | } |
| | | return list.get(0); |
| | | } |
| | | |
| | | |
| | | public List<GasModbus> listGasModBus(String depotId) { |
| | | String hql = " from " + GasModbus.class.getName(); |
| | | |
| | | if (null == depotId) { |
| | | return this.query(hql); |
| | | } else { |
| | | hql += " where depotId=:depotId order by passcode"; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("depotId", depotId); |
| | | return this.query(hql, param); |
| | | } |
| | | } |
| | | |
| | | public void updateGasModbus(DeviceModbus data) { |
| | | Session session = this.getSessionFactory().openSession(); |
| | | try { |
| | | |
| | | data = updateInitData(data); |
| | | data.setBizType(BizType.GAS.getCode()); |
| | | |
| | | if (StringUtils.isEmpty(data.getId())) { |
| | | data.setId(ContextUtil.getUUID()); |
| | | session.save(data); |
| | | } else { |
| | | session.update(data); |
| | | } |
| | | flushCacheDevice(null); |
| | | |
| | | this.updateListGas(session, data); |
| | | |
| | | } catch (Exception e) { |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | } |
| | | |
| | | private void updateListGas(Session session, DeviceModbus data) { |
| | | List<GasModbus> list = data.getListGas(); |
| | | if (null == list || list.isEmpty()) return; |
| | | for (GasModbus gas : list) { |
| | | gas.setDepotId(data.getDeviceCode()); |
| | | if (StringUtils.isEmpty(gas.getId())) { |
| | | gas.setId(ContextUtil.getUUID()); |
| | | session.save(gas); |
| | | } else { |
| | | session.update(gas); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public String delDataGas(GasModbus data) { |
| | | Session session = this.getSessionFactory().openSession(); |
| | | try { |
| | | session.delete(data); |
| | | } catch (Exception e) { |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | return null; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.models; |
| | | |
| | | import com.bstek.dorado.annotation.PropertyDef; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.constant.Constant; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.*; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ ¹æ®è®¾å¤é
ç½®çModbus-TCPåæ°é
ç½® |
| | | */ |
| | | @Data |
| | | @Entity |
| | | @Table(name = "D_DEVICE_MODBUS") |
| | | public class DeviceModbus implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Id |
| | | @Column(name = "ID_", length = 40) |
| | | @PropertyDef(label = "ID") |
| | | private String id; |
| | | |
| | | @Column(name = "DEVICE_CODE_", length = 40) |
| | | @PropertyDef(label = "设å¤ç¼ç ") |
| | | private String deviceCode; |
| | | |
| | | @Column(name = "BIZ_TYEP_", length = 10) |
| | | @PropertyDef(label = "ä¸å¡ç±»å") |
| | | private String bizType = BizType.AREATION.getCode(); |
| | | |
| | | @Column(name = "OPEN_", length = 10) |
| | | @PropertyDef(label = "å¼å°å", description = "å¼å°åãè½è读åå°å") |
| | | private String open = Constant.YN_N; |
| | | |
| | | |
| | | @Column(name = "OPEN_FUN", length = 4) |
| | | @PropertyDef(label = "åè½å·") |
| | | private String openFun = "99"; |
| | | |
| | | @Column(name = "CLOSE_", length = 10) |
| | | @PropertyDef(label = "å
³å°å", description = "å
³å°åãç©ºè°æ¸©åº¦è®¾ç½®å°å") |
| | | private String close = Constant.YN_N; |
| | | |
| | | @Column(name = "CLOSE_FUN", length = 4) |
| | | @PropertyDef(label = "åè½å·") |
| | | private String closeFun = "99"; |
| | | |
| | | @Column(name = "STOP_", length = 10) |
| | | @PropertyDef(label = "åå°å") |
| | | private String stop = Constant.YN_N; |
| | | |
| | | @Column(name = "STOP_FUN", length = 4) |
| | | @PropertyDef(label = "åè½å·") |
| | | private String stopFun = "99"; |
| | | |
| | | @Column(name = "OPEN_END_", length = 10) |
| | | @PropertyDef(label = "å¼å°ä½å°å", description = "å¼å°ä½å°åãè¿è¡ç¶æå°å(飿ºå空è°)") |
| | | private String openEnd = Constant.YN_N; |
| | | |
| | | @Column(name = "OPEN_END_FUN", length = 4) |
| | | @PropertyDef(label = "åè½å·") |
| | | private String openEndFun = "99"; |
| | | |
| | | @Column(name = "CLOSE_END_", length = 10) |
| | | @PropertyDef(label = "å
³å°ä½å°å") |
| | | private String closeEnd = Constant.YN_N; |
| | | |
| | | @Column(name = "CLOSE_END_FUN", length = 4) |
| | | @PropertyDef(label = "åè½å·") |
| | | private String closeEndFun = "99"; |
| | | |
| | | @Column(name = "OPEN_ERROR_", length = 10) |
| | | @PropertyDef(label = "弿
éå°å") |
| | | private String openError = Constant.YN_N; |
| | | |
| | | @Column(name = "OPEN_ERROR_FUN", length = 4) |
| | | @PropertyDef(label = "åè½å·") |
| | | private String openErrorFun = "99"; |
| | | |
| | | @Column(name = "CLOSE_ERROR_", length = 10) |
| | | @PropertyDef(label = "å
³æ
éå°å") |
| | | private String closeError = Constant.YN_N; |
| | | |
| | | @Column(name = "CLOSE_ERROR_FUN", length = 4) |
| | | @PropertyDef(label = "åè½å·") |
| | | private String closeErrorFun = "99"; |
| | | |
| | | //è½´æµé£æºåè½´æµçªå¯è½ä¸å¨ä¸ä¸ªåæºä¸ï¼IPä¸å |
| | | @Column(name = "SER_ID_", length = 10) |
| | | @PropertyDef(label = "æå±åæº") |
| | | private String serId; |
| | | |
| | | |
| | | @Transient |
| | | private List<GasModbus> listGas; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.models; |
| | | |
| | | import com.bstek.dorado.annotation.PropertyDef; |
| | | import com.ld.igds.constant.Constant; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.Table; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * é
ç½®æµæ°åæµè«çMODBUSï¼TCPé
ç½®ä¿¡æ¯ |
| | | */ |
| | | @Data |
| | | @Entity |
| | | @Table(name = "D_GAS_MODBUS") |
| | | public class GasModbus implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Id |
| | | @Column(name = "ID_", length = 40) |
| | | @PropertyDef(label = "ID") |
| | | private String id; |
| | | |
| | | @Column(name = "DEPOT_ID_", length = 50) |
| | | @PropertyDef(label = "æå±ä»åº") |
| | | private String depotId; |
| | | |
| | | @Column(name = "PASS_CODE_") |
| | | @PropertyDef(label = "éé") |
| | | private int passcode; |
| | | |
| | | @Column(name = "CO2_", length = 10) |
| | | @PropertyDef(label = "äºæ°§å碳") |
| | | private String co2 = Constant.YN_N; |
| | | |
| | | @Column(name = "CO2_FUN", length = 4) |
| | | @PropertyDef(label = "åè½å·") |
| | | private String co2Fun = "99"; |
| | | |
| | | @Column(name = "O2_", length = 10) |
| | | @PropertyDef(label = "æ°§æ°") |
| | | private String o2 = Constant.YN_N; |
| | | |
| | | @Column(name = "O2_FUN", length = 4) |
| | | @PropertyDef(label = "åè½å·") |
| | | private String o2Fun = "99"; |
| | | |
| | | @Column(name = "PH3_", length = 10) |
| | | @PropertyDef(label = "ç£·åæ°¢") |
| | | private String ph3= Constant.YN_N; |
| | | |
| | | @Column(name = "PH3_FUN", length = 4) |
| | | @PropertyDef(label = "åè½å·") |
| | | private String ph3Fun = "99"; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.modbus; |
| | | |
| | | import com.serotonin.modbus4j.ModbusFactory; |
| | | import com.serotonin.modbus4j.ModbusMaster; |
| | | import com.serotonin.modbus4j.exception.ErrorResponseException; |
| | | import com.serotonin.modbus4j.exception.ModbusInitException; |
| | | import com.serotonin.modbus4j.exception.ModbusTransportException; |
| | | import com.serotonin.modbus4j.ip.IpParameters; |
| | | import com.serotonin.modbus4j.locator.BaseLocator; |
| | | import com.serotonin.modbus4j.msg.*; |
| | | |
| | | /** |
| | | * Modbus å·¥å
·ç±» |
| | | */ |
| | | public class ModbusTest { |
| | | |
| | | /** |
| | | * å·¥å |
| | | */ |
| | | static ModbusFactory modbusFactory; |
| | | static ModbusMaster modbusMaster; |
| | | |
| | | static { |
| | | if (modbusFactory == null) { |
| | | modbusFactory = new ModbusFactory(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·åmaster |
| | | * |
| | | * @return |
| | | */ |
| | | public static ModbusMaster getMaster() throws ModbusInitException { |
| | | if (modbusMaster == null) { |
| | | IpParameters ipParameters = new IpParameters(); |
| | | ipParameters.setHost("127.0.0.1"); |
| | | ipParameters.setPort(502); |
| | | modbusMaster = modbusFactory.createTcpMaster(ipParameters, true); |
| | | modbusMaster.init(); |
| | | return modbusMaster; |
| | | } |
| | | return modbusMaster; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 读å线åå¼å
³ç¶ææ°æ® 0x01 |
| | | * |
| | | * @param slaveId |
| | | * @param offset |
| | | * @return |
| | | * @throws ModbusInitException |
| | | * @throws ModbusTransportException |
| | | * @throws ErrorResponseException |
| | | */ |
| | | public static Boolean readCoilStatus(int slaveId, int offset) throws ModbusInitException, ModbusTransportException, ErrorResponseException { |
| | | BaseLocator<Boolean> coilStatus = BaseLocator.coilStatus(slaveId, offset); |
| | | Boolean res = getMaster().getValue(coilStatus); |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * 读离æ£è¾å
¥å¯åå¨ç¶ææ°æ® 0x02 |
| | | * |
| | | * @param slaveId |
| | | * @param offset |
| | | * @return |
| | | * @throws ModbusInitException |
| | | * @throws ModbusTransportException |
| | | * @throws ErrorResponseException |
| | | */ |
| | | public static Boolean inputStatus(int slaveId, int offset) throws ModbusInitException, ModbusTransportException, ErrorResponseException { |
| | | BaseLocator<Boolean> inputStatus = BaseLocator.inputStatus(slaveId, offset); |
| | | Boolean res = getMaster().getValue(inputStatus); |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * è¯»ä¿æå¯å卿°æ® 0x03 |
| | | * |
| | | * @param slaveId |
| | | * @param offset |
| | | * @param dataType |
| | | * @return |
| | | * @throws ModbusInitException |
| | | * @throws ModbusTransportException |
| | | * @throws ErrorResponseException |
| | | */ |
| | | public static Number holdingRegister(int slaveId, int offset, int dataType) throws ModbusInitException, ModbusTransportException, ErrorResponseException { |
| | | BaseLocator<Number> holdingRegister = BaseLocator.holdingRegister(slaveId, offset, dataType); |
| | | Number value = getMaster().getValue(holdingRegister); |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * 读è¾å
¥å¯å卿°æ® 0x04 |
| | | * |
| | | * @param slaveId |
| | | * @param offset |
| | | * @param dataType |
| | | * @return |
| | | * @throws ModbusInitException |
| | | * @throws ModbusTransportException |
| | | * @throws ErrorResponseException |
| | | */ |
| | | public static Number inputRegister(int slaveId, int offset, int dataType) throws ModbusInitException, ModbusTransportException, ErrorResponseException { |
| | | BaseLocator<Number> inputRegister = BaseLocator.inputRegister(slaveId, offset, dataType); |
| | | Number value = getMaster().getValue(inputRegister); |
| | | return value; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å线åå¼å
³ç¶ææ°æ® 0x05 |
| | | * |
| | | * @param slaveId |
| | | * @param offset |
| | | * @param status |
| | | * @return |
| | | * @throws ModbusTransportException |
| | | * @throws ModbusInitException |
| | | */ |
| | | public static Boolean writeCoilStatus(int slaveId, int offset, boolean status) throws ModbusTransportException, ModbusInitException { |
| | | boolean coilValue = status; |
| | | WriteCoilRequest coilRequest = new WriteCoilRequest(slaveId, offset, coilValue); |
| | | WriteCoilResponse coilResponse = (WriteCoilResponse) getMaster().send(coilRequest); |
| | | return !coilResponse.isException(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ååä¸ªä¿æå¯å卿°æ® 0x06 |
| | | * |
| | | * @param slaveId |
| | | * @param offset |
| | | * @param vlaue |
| | | * @return |
| | | * @throws ModbusTransportException |
| | | * @throws ModbusInitException |
| | | */ |
| | | public static Boolean writeRegister(int slaveId, int offset, int vlaue) throws ModbusTransportException, ModbusInitException { |
| | | WriteRegisterRequest registerRequest = new WriteRegisterRequest(slaveId, offset, vlaue); |
| | | WriteRegisterResponse registerResponse = (WriteRegisterResponse) getMaster().send(registerRequest); |
| | | return !registerResponse.isException(); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * å线åå¼å
³ç¶ææ°æ®ãå¤ã 0x0f |
| | | * |
| | | * @param slaveId |
| | | * @param offset |
| | | * @param booleans |
| | | * @return |
| | | * @throws ModbusTransportException |
| | | * @throws ModbusInitException |
| | | */ |
| | | public static Boolean writeCoils(int slaveId, int offset, boolean[] booleans) throws ModbusTransportException, ModbusInitException { |
| | | WriteCoilsRequest writeCoils = new WriteCoilsRequest(slaveId, offset, booleans); |
| | | WriteCoilsResponse coilsResponse = (WriteCoilsResponse) getMaster().send(writeCoils); |
| | | return !coilsResponse.isException(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åä¿åå¯å卿°æ®ãå¤ã 0x10 |
| | | * |
| | | * @param slaveId |
| | | * @param offset |
| | | * @param nums |
| | | * @return |
| | | * @throws ModbusTransportException |
| | | * @throws ModbusInitException |
| | | */ |
| | | public static Boolean writeRegisters(int slaveId, int offset, short[] nums) throws ModbusTransportException, ModbusInitException { |
| | | WriteRegistersRequest writeRegisters = new WriteRegistersRequest(slaveId, offset, nums); |
| | | WriteRegistersResponse registersResponse = (WriteRegistersResponse) getMaster().send(writeRegisters); |
| | | return !registersResponse.isException(); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) throws ModbusInitException, ModbusTransportException, ErrorResponseException { |
| | | // 01æµè¯ |
| | | Boolean v0001 = readCoilStatus(1, 2148); |
| | | System.out.println("get 2148 :" + v0001); |
| | | |
| | | |
| | | // 03æµè¯ |
| | | // Number v0001 = holdingRegister(136, 3, DataType.TWO_BYTE_INT_SIGNED); |
| | | // Number v0003 = holdingRegister(1, 2, DataType.TWO_BYTE_INT_SIGNED); |
| | | // Number v0009 = holdingRegister(1, 8, DataType.TWO_BYTE_INT_SIGNED); |
| | | // System.out.println("get v0001 result:" + v0001); |
| | | // System.out.println("get v0003 result:" + v0003); |
| | | // System.out.println("get v0009 result:" + v0009); |
| | | |
| | | // 04æµè¯ |
| | | // Number v0001 = inputRegister(136, 0, DataType.TWO_BYTE_INT_SIGNED); |
| | | // Number v0003 = inputRegister(136, 2, DataType.TWO_BYTE_INT_SIGNED); |
| | | // Number v0009 = inputRegister(136, 8, DataType.TWO_BYTE_INT_SIGNED); |
| | | // System.out.println("get v0001 result:" + v0001); |
| | | // System.out.println("get v0003 result:" + v0003); |
| | | // System.out.println("get v0009 result:" + v0009); |
| | | |
| | | |
| | | // 05æµè¯ |
| | | // Boolean v0001 = writeCoilStatus(1, 0, true); |
| | | // Boolean v0002 = writeCoilStatus(1, 1, false); |
| | | // Boolean v0007 = writeCoilStatus(1, 6, true); |
| | | // System.out.println("update v0001 status result:" + v0001); |
| | | // System.out.println("update v0002 status result:" + v0002); |
| | | // System.out.println("update v0007 status result:" + v0007); |
| | | |
| | | |
| | | // 06æµè¯ |
| | | // Boolean v0001 = writeRegister(136, 0, 98); |
| | | // Boolean v0002 = writeRegister(136, 1, 0); |
| | | // Boolean v0007 = writeRegister(136, 6, 100); |
| | | // System.out.println("update v0001 status result:" + v0001); |
| | | // System.out.println("update v0002 status result:" + v0002); |
| | | // System.out.println("update v0007 status result:" + v0007); |
| | | |
| | | |
| | | // 0fæµè¯ |
| | | //Boolean res1 = writeCoils(1, 1, new boolean[]{true, true, false, true}); |
| | | // 10æµè¯ |
| | | //Boolean res2 = writeRegisters(136, 7, new short[]{1, 2, 3}); |
| | | //Boolean res3 = writeRegisters(136, 7, new short[]{991, 778, 25, 0}); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.modbus; |
| | | |
| | | import com.serotonin.modbus4j.ModbusFactory; |
| | | import com.serotonin.modbus4j.ModbusMaster; |
| | | import com.serotonin.modbus4j.code.DataType; |
| | | import com.serotonin.modbus4j.exception.ErrorResponseException; |
| | | import com.serotonin.modbus4j.exception.ModbusInitException; |
| | | import com.serotonin.modbus4j.exception.ModbusTransportException; |
| | | import com.serotonin.modbus4j.ip.IpParameters; |
| | | import com.serotonin.modbus4j.locator.BaseLocator; |
| | | import com.serotonin.modbus4j.msg.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @Desc: å·¥å
·ç±» |
| | | * @author: Andy |
| | | * @update-time: 2023/8/11 |
| | | */ |
| | | @Slf4j |
| | | public class ModbusUtil2 { |
| | | |
| | | //仿ºé»è®¤å¼ |
| | | private static Integer slaveId = 1; |
| | | |
| | | /** |
| | | * å·¥å |
| | | */ |
| | | static ModbusFactory modbusFactory; |
| | | |
| | | static { |
| | | if (modbusFactory == null) { |
| | | modbusFactory = new ModbusFactory(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·åmaster |
| | | * |
| | | * @return |
| | | */ |
| | | public static ModbusMaster getMaster(String ip, int port) throws ModbusInitException, InterruptedException { |
| | | |
| | | IpParameters ipParameters = new IpParameters(); |
| | | ipParameters.setHost(ip); |
| | | ipParameters.setPort(port); |
| | | ModbusMaster modbusMaster = modbusFactory.createTcpMaster(ipParameters, false); |
| | | modbusMaster.init(); |
| | | |
| | | //åå§åä¹åçå¾
ï¼é¿å
åºç°è¿æ¥æªå建 |
| | | Thread.sleep(2500); |
| | | |
| | | return modbusMaster; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 读å线åå¼å
³ç¶ææ°æ® 0x01 |
| | | * |
| | | * @param offset |
| | | * @return |
| | | * @throws ModbusInitException |
| | | * @throws ModbusTransportException |
| | | * @throws ErrorResponseException |
| | | */ |
| | | public static Boolean readCoilStatus(String ip, int port, int offset) throws ModbusInitException, ModbusTransportException, ErrorResponseException, InterruptedException { |
| | | BaseLocator<Boolean> coilStatus = BaseLocator.coilStatus(slaveId, offset); |
| | | Boolean res = getMaster(ip, port).getValue(coilStatus); |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * 读离æ£è¾å
¥å¯åå¨ç¶ææ°æ® 0x02 |
| | | * |
| | | * @param offset |
| | | * @return |
| | | * @throws ModbusInitException |
| | | * @throws ModbusTransportException |
| | | * @throws ErrorResponseException |
| | | */ |
| | | public static Boolean readInputStatus(String ip, int port, int offset) throws ModbusInitException, ModbusTransportException, ErrorResponseException, InterruptedException { |
| | | BaseLocator<Boolean> inputStatus = BaseLocator.inputStatus(slaveId, offset); |
| | | |
| | | // Thread.sleep(3000); |
| | | Boolean res = getMaster(ip, port).getValue(inputStatus); |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * è¯»ä¿æå¯å卿°æ® 0x03 |
| | | * |
| | | * @param offset |
| | | * @param dataType |
| | | * @return |
| | | * @throws ModbusInitException |
| | | * @throws ModbusTransportException |
| | | * @throws ErrorResponseException |
| | | */ |
| | | public static Number readHoldingRegister(String ip, int port, int offset, int dataType) throws ModbusInitException, ModbusTransportException, ErrorResponseException, InterruptedException { |
| | | BaseLocator<Number> holdingRegister = BaseLocator.holdingRegister(slaveId, offset, dataType); |
| | | Number value = getMaster(ip, port).getValue(holdingRegister); |
| | | return value; |
| | | } |
| | | |
| | | public static Number readHoldingRegister(String ip, int port, int offset) throws ModbusInitException, ModbusTransportException, ErrorResponseException, InterruptedException { |
| | | int dataType = DataType.TWO_BYTE_INT_SIGNED; |
| | | return readHoldingRegister(ip, port, offset, dataType); |
| | | } |
| | | |
| | | /** |
| | | * 读è¾å
¥å¯å卿°æ® 0x04 |
| | | * |
| | | * @param offset |
| | | * @param dataType |
| | | * @return |
| | | * @throws ModbusInitException |
| | | * @throws ModbusTransportException |
| | | * @throws ErrorResponseException |
| | | */ |
| | | public static Number readInputRegister(String ip, int port, int offset, int dataType) throws ModbusInitException, ModbusTransportException, ErrorResponseException, InterruptedException { |
| | | BaseLocator<Number> inputRegister = BaseLocator.inputRegister(slaveId, offset, dataType); |
| | | Number value = getMaster(ip, port).getValue(inputRegister); |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * 读è¾å
¥å¯å卿°æ® 0x04 |
| | | * |
| | | * @param offset |
| | | * @return |
| | | * @throws ModbusInitException |
| | | * @throws ModbusTransportException |
| | | * @throws ErrorResponseException |
| | | */ |
| | | public static Number readInputRegister(String ip, int port, int offset) throws ModbusInitException, ModbusTransportException, ErrorResponseException, InterruptedException { |
| | | int dataType = DataType.TWO_BYTE_INT_SIGNED; |
| | | return readInputRegister(ip, port, offset, dataType); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å线åå¼å
³ç¶ææ°æ® 0x05 |
| | | * |
| | | * @param offset |
| | | * @param status |
| | | * @return |
| | | * @throws ModbusTransportException |
| | | * @throws ModbusInitException |
| | | */ |
| | | public static Boolean writeCoilStatus(String ip, int port, int offset, boolean status) throws ModbusTransportException, ModbusInitException, InterruptedException { |
| | | WriteCoilRequest coilRequest = new WriteCoilRequest(slaveId, offset, status); |
| | | WriteCoilResponse coilResponse = (WriteCoilResponse) getMaster(ip, port).send(coilRequest); |
| | | return !coilResponse.isException(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ååä¸ªä¿æå¯å卿°æ® 0x06 |
| | | * |
| | | * @param offset |
| | | * @param value |
| | | * @return |
| | | * @throws ModbusTransportException |
| | | * @throws ModbusInitException |
| | | */ |
| | | public static Boolean writeRegister(String ip, int port, int offset, int value) throws ModbusTransportException, ModbusInitException, InterruptedException { |
| | | WriteRegisterRequest registerRequest = new WriteRegisterRequest(slaveId, offset, value); |
| | | WriteRegisterResponse registerResponse = (WriteRegisterResponse) getMaster(ip, port).send(registerRequest); |
| | | return !registerResponse.isException(); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * å线åå¼å
³ç¶ææ°æ®ãå¤ã 0x0f |
| | | * |
| | | * @param offset |
| | | * @param booleans |
| | | * @return |
| | | * @throws ModbusTransportException |
| | | * @throws ModbusInitException |
| | | */ |
| | | public static Boolean writeCoils(String ip, int port, int offset, boolean[] booleans) throws ModbusTransportException, ModbusInitException, InterruptedException { |
| | | WriteCoilsRequest writeCoils = new WriteCoilsRequest(slaveId, offset, booleans); |
| | | WriteCoilsResponse coilsResponse = (WriteCoilsResponse) getMaster(ip, port).send(writeCoils); |
| | | return !coilsResponse.isException(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åä¿åå¯å卿°æ®ãå¤ã 0x10 |
| | | * |
| | | * @param offset |
| | | * @param nums |
| | | * @return |
| | | * @throws ModbusTransportException |
| | | * @throws ModbusInitException |
| | | */ |
| | | public static Boolean writeRegisters(String ip, int port, int offset, short[] nums) throws ModbusTransportException, ModbusInitException, InterruptedException { |
| | | WriteRegistersRequest writeRegisters = new WriteRegistersRequest(slaveId, offset, nums); |
| | | WriteRegistersResponse registersResponse = (WriteRegistersResponse) getMaster(ip, port).send(writeRegisters); |
| | | return !registersResponse.isException(); |
| | | } |
| | | } |
| | |
| | | package com.ld.igds.protocol.modbus; |
| | | |
| | | import com.ld.igds.constant.Constant; |
| | | import com.ld.igds.constant.DeviceStatus; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | public class ServerUtil { |
| | | |
| | | |
| | | /** |
| | | * ç¨æ¥ç¼åï¼TCPè®¾å¤æ§è¡æ¶é´è®°å½key = TCPå¯ä¸æ å¿ï¼value = å½åæ§è¡æ¶é´ |
| | | */ |
| | | public static Map<String, Long> contextExeModbusTcp = new HashMap<>(); |
| | | |
| | | public static final String RUN_TAG = "RUN_TAG"; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | * @param status ä¸èè设å¤ç±»åï¼åªå¨éé䏿 è®°æ¯OPENæè
CLOSEå³å¯ |
| | | */ |
| | | public static void add2StatusMap(String companyId, String serId, String deviceCode, String status) { |
| | | // System.out.println(mainLink); |
| | | // //è¥ä¸ä¸ºç©ºï¼åæ¥è¯¢ä¸»è®¾å¤ç¶æ |
| | | // if(StringUtils.isNotEmpty(mainLink)){ |
| | | // String oldStatus = contextStatusMap.get(ContextUtil.buildDeviceStatusKey(companyId, serId, mainLink)); |
| | | // //è¥é£çªæé£å£å¼ |
| | | // if(DeviceStatus.OPEN.getCode().equals(oldStatus)){ |
| | | // //è¥é£æºå¼ |
| | | // if(DeviceStatus.OPEN.getCode().equals(status)){ |
| | | // status = DeviceStatus.F_OPEN.getCode(); |
| | | // } |
| | | // //è¥é£æºå
³ |
| | | // if(DeviceStatus.CLOSE.getCode().equals(status)){ |
| | | // status = DeviceStatus.W_OPEN.getCode(); |
| | | // } |
| | | // } |
| | | // //è¥é£çªæé£å£å¼ |
| | | // if(DeviceStatus.CLOSE.getCode().equals(oldStatus)){ |
| | | // //è¥é£æºå¼ |
| | | // if(DeviceStatus.OPEN.getCode().equals(status)){ |
| | | // status = DeviceStatus.ERROR.getCode(); |
| | | // } |
| | | // //è¥é£æºå
³ |
| | | // if(DeviceStatus.CLOSE.getCode().equals(status)){ |
| | | // status = DeviceStatus.W_CLOSE.getCode(); |
| | | // } |
| | | // } |
| | | // contextStatusMap.put(ContextUtil.buildDeviceStatusKey(companyId, serId, mainLink), status); |
| | | // return; |
| | | // } |
| | | contextStatusMap.put(ContextUtil.buildDeviceStatusKey(companyId, serId, deviceCode), status); |
| | | } |
| | | |
| | |
| | | return contextStatusMap; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static int getAddrExe(String temp) { |
| | | if (Constant.YN_N.equals(temp)) return 65535; |
| | | if (temp.length() > 4) { |
| | | temp = temp.substring(temp.length() - 4); |
| | | } |
| | | return Integer.valueOf(temp) - 1; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ld.igds.protocol.modbus.command; |
| | | |
| | | import com.ld.igds.common.CoreDeviceService; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.es.dto.EsData; |
| | | import com.ld.igds.es.service.CoreEsService; |
| | | import com.ld.igds.gas.CoreGasService; |
| | | import com.ld.igds.io.constant.OrderRespEnum; |
| | | import com.ld.igds.io.notify.NotifyWebInvoker; |
| | | import com.ld.igds.io.request.BaseRequest; |
| | | import com.ld.igds.io.request.CheckGasRequest; |
| | | import com.ld.igds.io.request.DeviceControlRequest; |
| | | import com.ld.igds.models.Gas; |
| | | import com.ld.igds.protocol.modbus.ServerUtil; |
| | | import com.ld.igds.protocol.modbus.data.ModbusGasResult; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import com.ld.igds.util.NumberUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.DecimalFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * è§£æ |
| | |
| | | public class AnalysisService { |
| | | |
| | | @Resource |
| | | private CoreDeviceService deviceService; |
| | | private CoreDeviceService coreDeviceService; |
| | | @Resource |
| | | private NotifyWebInvoker notifyInvoker; |
| | | @Autowired |
| | | private CoreGasService gasService; |
| | | @Autowired |
| | | private CoreEsService esService; |
| | | |
| | | |
| | | /** |
| | |
| | | Thread.sleep(sleepTime); |
| | | } |
| | | |
| | | deviceService.updateStatus(request.getCompanyId(), request.getSerId(), ServerUtil.getStatusMap()); |
| | | coreDeviceService.updateStatus(request.getCompanyId(), request.getSerId(), ServerUtil.getStatusMap()); |
| | | |
| | | notifyInvoker.notifyAnalysisStatusSuccess(request.getCompanyId(), request.getSerId(), OrderRespEnum.MSG_SUCCESS, "设å¤ç¶ææ¥è¯¢æåå¹¶å®æè§£æï¼"); |
| | | |
| | |
| | | log.error("---MODBUS-TCP-ç¶æè§£æå¼å¸¸{}", e); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è§£ææ°ä½æ£æµç»æ |
| | | * |
| | | * @param request |
| | | * @param results |
| | | */ |
| | | public void analysisGas(CheckGasRequest request, List<ModbusGasResult> results) { |
| | | |
| | | log.debug("----------å¼å§æ§è¡æ°ä½ç»æè§£æ----{}", request.getDepotId()); |
| | | |
| | | String batchId = ContextUtil.getDefaultBatchId(); |
| | | //主ä½ä¿¡æ¯ |
| | | Gas gas = new Gas(batchId, request.getCompanyId(), request.getDepotId(), new Date()); |
| | | gas.setCheckNum(results.size()); |
| | | gas.setGasEnd(results.size()); |
| | | gas.setGasStart(1); |
| | | gas.setReceiveDate(new Date()); |
| | | |
| | | int sumNum = results.size(); |
| | | double co2, o2, ph3, n2; |
| | | DecimalFormat df = new DecimalFormat("#0.00"); |
| | | double sumO2 = 0.0, sumCo2 = 0.0, sumPh3 = 0.0, sumN2 = 0.0; |
| | | int num = 1; |
| | | StringBuffer sb = new StringBuffer(); |
| | | for (ModbusGasResult gasResult : results) { |
| | | //äºæ°§å碳ï¼åä½ï¼PPMï¼ç´æ¥ä½¿ç¨ |
| | | co2 = gasResult.getCo2().doubleValue(); |
| | | //æ°§æ°ï¼é¤ä»¥10ï¼åä½ï¼ç¾åæ¯ |
| | | o2 = Double.valueOf(df.format(gasResult.getO2().doubleValue()*0.1)); |
| | | //ç£·åæ°¢ï¼åä½ï¼PPMï¼ç´æ¥ä½¿ç¨ |
| | | ph3 = gasResult.getPh3().doubleValue(); |
| | | n2 = Double.valueOf(df.format(99.9 - o2));; |
| | | |
| | | if(num == 1){ |
| | | gas.setPerCo2Min(co2); |
| | | gas.setPerO2Min(o2); |
| | | gas.setPerPh3Min(ph3); |
| | | gas.setPerN2Min(n2); |
| | | } |
| | | num ++; |
| | | if (gas.getPerCo2Max() < co2) { |
| | | gas.setPerCo2Max(co2); |
| | | } |
| | | if (gas.getPerCo2Min() > co2) { |
| | | gas.setPerCo2Min(co2); |
| | | } |
| | | if (gas.getPerO2Max() < o2) { |
| | | gas.setPerO2Max(o2); |
| | | } |
| | | if (gas.getPerO2Min() > o2) { |
| | | gas.setPerO2Min(o2); |
| | | } |
| | | if (gas.getPerPh3Max() < ph3) { |
| | | gas.setPerPh3Max(ph3); |
| | | } |
| | | if (gas.getPerPh3Min() > ph3) { |
| | | gas.setPerPh3Min(ph3); |
| | | } |
| | | if (gas.getPerN2Max() < n2) { |
| | | gas.setPerN2Max(n2); |
| | | } |
| | | if (gas.getPerN2Min() > n2) { |
| | | gas.setPerN2Min(n2); |
| | | } |
| | | |
| | | //åºå®ä¸ºï¼passCode,co2,o2,ph3,n2;passCode,co2,o2,ph3,n2;" |
| | | sb.append(gasResult.getPasscode()); |
| | | sb.append(","); |
| | | sb.append(co2); |
| | | sb.append(","); |
| | | sb.append(o2); |
| | | sb.append(","); |
| | | sb.append(ph3); |
| | | sb.append(","); |
| | | sb.append(n2); |
| | | sb.append(";"); |
| | | |
| | | sumCo2 += co2; |
| | | sumO2 += o2; |
| | | sumPh3 += ph3; |
| | | sumN2 += n2; |
| | | |
| | | } |
| | | gas.setPoints(sb.toString()); |
| | | gas.setPerCo2(NumberUtil.keepPrecision(sumCo2 / sumNum, 2)); |
| | | gas.setPerO2(NumberUtil.keepPrecision(sumO2 / sumNum, 2)); |
| | | gas.setPerN2(NumberUtil.keepPrecision(sumN2 / sumNum, 2)); |
| | | gas.setPerPh3(NumberUtil.keepPrecision(sumPh3 / sumNum, 2)); |
| | | |
| | | gasService.saveOrUpdateData(gas); |
| | | |
| | | // è°ç¨éç¥å端 |
| | | notifyInvoker.notifyWeb(gas.getCompanyId(), OrderRespEnum.MSG_SUCCESS, BizType.GAS, request.getDepotId() + " æ°ä½æ£æµï¼ç»æè¿åæå."); |
| | | log.info("æ§å¶æ----->>>å¹³å°ï¼æ°ä½è§£æå®æ-ä»åº={}", request.getDepotId()); |
| | | } |
| | | |
| | | /** |
| | | * è§£æè½èæ°æ® |
| | | * |
| | | * @param request |
| | | * @param result |
| | | */ |
| | | public void analysisEs(BaseRequest request, Number result) { |
| | | |
| | | log.debug("----------å¼å§æ§è¡è½èç»æè§£æ----{}", request.getDepotId()); |
| | | |
| | | |
| | | //æåçµè½å¤ææ¯å¦è¿åæææ°æ® |
| | | if (null == result) { |
| | | log.error("---è½èæ°æ®è¿åæ°æ®ä¸å®æ´ï¼åæ¢è§£æ----{}", result.toString()); |
| | | return; |
| | | } |
| | | |
| | | EsData esData = new EsData(); |
| | | esData.setCompanyId(request.getCompanyId()); |
| | | esData.setDepotId(request.getDepotId()); |
| | | esData.setUpdateTime(new Date()); |
| | | |
| | | esData.setEp(result.doubleValue()); |
| | | esData.setEs(result.doubleValue()); |
| | | |
| | | log.info("Modbusçµè¡¨----->>>å¹³å°ï¼è½èæ°æ®è§£æå®æ-ä»åº={}", esData.getDepotId()); |
| | | esService.saveAndUpdateInc(esData); |
| | | } |
| | | |
| | | /** |
| | | * è§£æç©ºè°ç¶æ |
| | | * |
| | | * @param request |
| | | * @param result |
| | | */ |
| | | public void analysisTempStatus(BaseRequest request, Number result) { |
| | | |
| | | log.debug("----------å¼å§æ§è¡è½èç»æè§£æ----{}", request.getDepotId()); |
| | | |
| | | |
| | | //æåçµè½å¤ææ¯å¦è¿åæææ°æ® |
| | | if (null == result) { |
| | | log.error("---è½èæ°æ®è¿åæ°æ®ä¸å®æ´ï¼åæ¢è§£æ----{}", result.toString()); |
| | | return; |
| | | } |
| | | |
| | | EsData esData = new EsData(); |
| | | esData.setCompanyId(request.getCompanyId()); |
| | | esData.setDepotId(request.getDepotId()); |
| | | esData.setUpdateTime(new Date()); |
| | | |
| | | esData.setEp(result.doubleValue()); |
| | | esData.setEs(result.doubleValue()); |
| | | |
| | | log.info("Modbusçµè¡¨----->>>å¹³å°ï¼è½èæ°æ®è§£æå®æ-ä»åº={}", esData.getDepotId()); |
| | | esService.saveAndUpdateInc(esData); |
| | | } |
| | | } |
| | |
| | | package com.ld.igds.protocol.modbus.command; |
| | | |
| | | import com.ld.igds.common.CoreDeviceService; |
| | | import com.ld.igds.common.CoreSerService; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.constant.Constant; |
| | | import com.ld.igds.constant.DeviceStatus; |
| | | import com.ld.igds.constant.DeviceType; |
| | | import com.ld.igds.io.RemoteControlService; |
| | | import com.ld.igds.io.constant.OrderRespEnum; |
| | | import com.ld.igds.io.constant.ProtocolEnum; |
| | |
| | | import com.ld.igds.io.request.ExeDevice; |
| | | import com.ld.igds.io.request.TempControlRequest; |
| | | import com.ld.igds.io.response.DeviceControlResponse; |
| | | import com.ld.igds.modbus.service.HModbusService; |
| | | import com.ld.igds.models.Device; |
| | | import com.ld.igds.protocol.modbus.ModbusUtil; |
| | | import com.ld.igds.models.DeviceModbus; |
| | | import com.ld.igds.models.DeviceSer; |
| | | import com.ld.igds.protocol.modbus.ModbusUtil2; |
| | | import com.ld.igds.protocol.modbus.ServerUtil; |
| | | import com.ld.igds.protocol.modbus.data.ModbusTcp; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | public static final String BEAN_ID = "modbus.remoteControlService"; |
| | | |
| | | @Resource |
| | | private CoreDeviceService deviceService; |
| | | private CoreDeviceService coreDeviceService; |
| | | @Resource |
| | | private HModbusService deviceModbusService; |
| | | @Resource |
| | | private AnalysisService analysisService; |
| | | @Resource |
| | | private ModbusUtil modbusUtil; |
| | | private CoreSerService coreSerService; |
| | | |
| | | |
| | | @Override |
| | | public String getProtocol() { |
| | | return ProtocolEnum.MODBUS_TCP.getCode(); |
| | | return ProtocolEnum.TCP_MODBUS.getCode(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | try { |
| | | Device device; |
| | | DeviceModbus deviceModbus; |
| | | ModbusTcp modbusTcp; |
| | | ModbusTcp modbusTcpLink = null; |
| | | String temp = Constant.YN_N; |
| | | DeviceSer deviceSer; |
| | | for (ExeDevice exeDevice : deviceList) { |
| | | device = deviceService.getCacheDeviceById(exeDevice.getCompanyId(), exeDevice.getId()); |
| | | deviceModbus = deviceModbusService.getCacheDeviceModbus(request.getCompanyId(), exeDevice.getPassCode() + ""); |
| | | |
| | | if (null == device) continue; |
| | | |
| | | if (null == device.getModbus()) continue; |
| | | |
| | | modbusTcp = new ModbusTcp(device.getModbus()); |
| | | modbusTcp.setIp(request.getIp()); |
| | | modbusTcp.setPort(request.getPort()); |
| | | modbusTcp.setDeviceCode(device.getPassCode() + ""); |
| | | modbusTcp.setSerId(request.getSerId()); |
| | | modbusTcp.setCompanyId(request.getCompanyId()); |
| | | |
| | | if (null != device.getLinkModbus()) { |
| | | modbusTcpLink = new ModbusTcp(device.getLinkModbus()); |
| | | modbusTcpLink.setIp(request.getIp()); |
| | | modbusTcpLink.setPort(request.getPort()); |
| | | modbusTcpLink.setDeviceCode(device.getLink()); |
| | | modbusTcpLink.setSerId(request.getSerId()); |
| | | modbusTcpLink.setCompanyId(request.getCompanyId()); |
| | | } |
| | | |
| | | //æ ¹æ®è®¾å¤ç®æ ç®æ ç¶æï¼éæ©éè¦æ§è¡çéé |
| | | if (DeviceStatus.CLOSE.getCode().equals(device.getTargetStatus())) { |
| | | temp = modbusTcp.getAddrClose(); |
| | | } |
| | | |
| | | if (DeviceStatus.OPEN.getCode().equals(device.getTargetStatus())) { |
| | | temp = modbusTcp.getAddrOpen(); |
| | | } |
| | | |
| | | if (null == modbusTcpLink) { |
| | | //æ ¹æ®è®¾å¤ç®æ ç¶æï¼è°ç¨MODBUSæ§è¡ |
| | | modbusTcp.setAddrExe(this.getAddrExe(temp)); |
| | | doWriteExe(modbusTcp, device.getTargetStatus()); |
| | | if (null == deviceModbus) { |
| | | log.error("å½å设å¤---{}{},为è·åå°é
ç½®çMODBUSä¿¡æ¯", exeDevice.getSerId(), exeDevice.getName()); |
| | | continue; |
| | | } |
| | | |
| | | modbusTcp = new ModbusTcp(deviceModbus); |
| | | modbusTcp.setIp(request.getIp()); |
| | | modbusTcp.setPort(request.getPort()); |
| | | //è¥Modbus设å¤é
ç½®åæºï¼åä½¿ç¨æé
ç½®åæºçIPãç«¯å£ |
| | | if (StringUtils.isNotEmpty(deviceModbus.getSerId())) { |
| | | deviceSer = coreSerService.getCacheSer(request.getCompanyId(), deviceModbus.getSerId()); |
| | | modbusTcp.setIp(deviceSer.getIp()); |
| | | modbusTcp.setPort(deviceSer.getPort()); |
| | | } |
| | | modbusTcp.setBizCode(exeDevice.getPassCode() + ""); |
| | | modbusTcp.setSerId(request.getSerId()); |
| | | modbusTcp.setCompanyId(request.getCompanyId()); |
| | | |
| | | //æ ¹æ®è®¾å¤ç®æ ç®æ ç¶æï¼éæ©éè¦æ§è¡çéé |
| | | if (DeviceStatus.CLOSE.getCode().equals(exeDevice.getTargetStatus())) { |
| | | temp = modbusTcp.getDeviceModbus().getClose(); |
| | | } |
| | | |
| | | if (DeviceStatus.OPEN.getCode().equals(exeDevice.getTargetStatus())) { |
| | | temp = modbusTcp.getDeviceModbus().getOpen(); |
| | | } |
| | | |
| | | //ç¯æµé£æº-å
³ |
| | | if (DeviceStatus.F_CLOSE.getCode().equals(exeDevice.getTargetStatus())) { |
| | | temp = modbusTcp.getDeviceModbus().getStop(); |
| | | } |
| | | |
| | | //ç¯æµé£æº-å¼ |
| | | if (DeviceStatus.F_OPEN.getCode().equals(exeDevice.getTargetStatus())) { |
| | | temp = modbusTcp.getDeviceModbus().getOpen(); |
| | | } |
| | | |
| | | if (StringUtils.isBlank(exeDevice.getLink()) || "null".equals(exeDevice.getLink())) { |
| | | //æ ¹æ®è®¾å¤ç®æ ç¶æï¼è°ç¨MODBUSæ§è¡ |
| | | modbusTcp.setAddrExe(ServerUtil.getAddrExe(temp)); |
| | | doWriteExe(modbusTcp, exeDevice.getTargetStatus()); |
| | | |
| | | continue; |
| | | } |
| | | |
| | | deviceModbus = deviceModbusService.getCacheDeviceModbus(request.getCompanyId(), exeDevice.getLink()); |
| | | if (null == deviceModbus) continue; |
| | | modbusTcpLink = new ModbusTcp(deviceModbus); |
| | | modbusTcpLink.setIp(request.getIp()); |
| | | modbusTcpLink.setPort(request.getPort()); |
| | | modbusTcpLink.setBizCode(exeDevice.getLink()); |
| | | modbusTcpLink.setSerId(request.getSerId()); |
| | | modbusTcpLink.setCompanyId(request.getCompanyId()); |
| | | |
| | | //è¥Modbus设å¤é
ç½®åæºï¼åä½¿ç¨æé
ç½®åæºçIPãç«¯å£ |
| | | if (StringUtils.isNotEmpty(deviceModbus.getSerId())) { |
| | | deviceSer = coreSerService.getCacheSer(request.getCompanyId(), deviceModbus.getSerId()); |
| | | modbusTcpLink.setIp(deviceSer.getIp()); |
| | | modbusTcpLink.setPort(deviceSer.getPort()); |
| | | } |
| | | |
| | | //妿æ¯å¼é£æº |
| | | if (DeviceStatus.F_OPEN.getCode().equals(device.getTargetStatus())) { |
| | | if (DeviceStatus.F_OPEN.getCode().equals(exeDevice.getTargetStatus())) { |
| | | |
| | | //å
å¼çªå£ |
| | | temp = modbusTcp.getAddrOpen(); |
| | | modbusTcp.setAddrExe(this.getAddrExe(temp)); |
| | | |
| | | temp = modbusTcp.getDeviceModbus().getOpen(); |
| | | modbusTcp.setAddrExe(ServerUtil.getAddrExe(temp)); |
| | | doWriteExe(modbusTcp, DeviceStatus.OPEN.getCode()); |
| | | |
| | | |
| | | Thread.sleep(300); |
| | | |
| | | //åå¼é£æº |
| | | temp = modbusTcpLink.getAddrOpen(); |
| | | modbusTcpLink.setAddrExe(this.getAddrExe(temp)); |
| | | temp = modbusTcpLink.getDeviceModbus().getOpen(); |
| | | modbusTcpLink.setAddrExe(ServerUtil.getAddrExe(temp)); |
| | | |
| | | doWriteExe(modbusTcpLink, DeviceStatus.OPEN.getCode()); |
| | | } |
| | | |
| | | //妿å
³é£æº |
| | | if (DeviceStatus.F_CLOSE.equals(device.getTargetStatus())) { |
| | | temp = modbusTcpLink.getAddrClose(); |
| | | modbusTcpLink.setAddrExe(this.getAddrExe(temp)); |
| | | if (DeviceStatus.F_CLOSE.getCode().equals(exeDevice.getTargetStatus())) { |
| | | temp = modbusTcpLink.getDeviceModbus().getStop(); |
| | | modbusTcpLink.setAddrExe(ServerUtil.getAddrExe(temp)); |
| | | |
| | | doWriteExe(modbusTcpLink, DeviceStatus.CLOSE.getCode()); |
| | | } |
| | | |
| | | |
| | | //妿å¼çª |
| | | if (DeviceStatus.W_OPEN.equals(device.getTargetStatus())) { |
| | | temp = modbusTcp.getAddrOpen(); |
| | | modbusTcp.setAddrExe(this.getAddrExe(temp)); |
| | | if (DeviceStatus.W_OPEN.getCode().equals(exeDevice.getTargetStatus())) { |
| | | temp = modbusTcp.getDeviceModbus().getOpen(); |
| | | modbusTcp.setAddrExe(ServerUtil.getAddrExe(temp)); |
| | | |
| | | doWriteExe(modbusTcp, device.getTargetStatus()); |
| | | doWriteExe(modbusTcp, exeDevice.getTargetStatus()); |
| | | } |
| | | |
| | | //妿æ¯å
³çªæ· |
| | | if (DeviceStatus.W_CLOSE.equals(device.getTargetStatus())) { |
| | | if (DeviceStatus.W_CLOSE.getCode().equals(exeDevice.getTargetStatus())) { |
| | | |
| | | //å
å
³é£æº |
| | | temp = modbusTcpLink.getAddrClose(); |
| | | modbusTcpLink.setAddrExe(this.getAddrExe(temp)); |
| | | temp = modbusTcpLink.getDeviceModbus().getStop(); |
| | | modbusTcpLink.setAddrExe(ServerUtil.getAddrExe(temp)); |
| | | doWriteExe(modbusTcpLink, DeviceStatus.CLOSE.getCode()); |
| | | |
| | | Thread.sleep(300); |
| | | |
| | | //å¨å
³çªæ· |
| | | temp = modbusTcp.getAddrClose(); |
| | | modbusTcp.setAddrExe(this.getAddrExe(temp)); |
| | | temp = modbusTcp.getDeviceModbus().getClose(); |
| | | modbusTcp.setAddrExe(ServerUtil.getAddrExe(temp)); |
| | | |
| | | doWriteExe(modbusTcp, DeviceStatus.CLOSE.getCode()); |
| | | } |
| | |
| | | return new DeviceControlResponse(OrderRespEnum.ORDER_SUCCESS); |
| | | } |
| | | |
| | | private int getAddrExe(String temp) { |
| | | if (Constant.YN_N.equals(temp)) return 65535; |
| | | if (temp.length() > 4) { |
| | | temp = temp.substring(temp.length() - 4); |
| | | } |
| | | return Integer.valueOf(temp) - 1; |
| | | } |
| | | |
| | | private void doWriteExe(ModbusTcp modbusTcp, String targetStatus) throws Exception { |
| | | boolean exeResult = modbusUtil.writeValue05(modbusTcp.getIp(), modbusTcp.getPort(), modbusTcp.getAddrExe(), true); |
| | | boolean exeResult = ModbusUtil2.writeCoilStatus(modbusTcp.getIp(), modbusTcp.getPort(), modbusTcp.getAddrExe(), true); |
| | | if (exeResult) { |
| | | ServerUtil.add2StatusMap(modbusTcp.getCompanyId(), modbusTcp.getSerId(), modbusTcp.getDeviceCode(), targetStatus); |
| | | //æ ¹æ®Modbus-TCPï¼å°åè¿çå¼ï¼æ¢å¤åæ¥çå¼ |
| | | ModbusUtil2.writeCoilStatus(modbusTcp.getIp(), modbusTcp.getPort(), modbusTcp.getAddrExe(), false); |
| | | |
| | | log.debug("--------åå
¥å¼---{}-{}-{}", modbusTcp.getSerId(), modbusTcp.getBizCode(), targetStatus); |
| | | ServerUtil.add2StatusMap(modbusTcp.getCompanyId(), modbusTcp.getSerId(), modbusTcp.getBizCode(), targetStatus); |
| | | } |
| | | } |
| | | |
| | |
| | | @Override |
| | | public DeviceControlResponse queryStatus(DeviceControlRequest request) { |
| | | try { |
| | | List<Device> list = deviceService.getCacheDeviceBySerId(request.getCompanyId(), request.getSerId()); |
| | | List<Device> list = coreDeviceService.getCacheDeviceBySerId(request.getCompanyId(), request.getSerId()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | return new DeviceControlResponse(OrderRespEnum.ORDER_ERROR.getCode(), "æªè·åå°è®¾å¤å表信æ¯"); |
| | | } |
| | | |
| | | DeviceModbus deviceModbus; |
| | | ModbusTcp modbusTcp; |
| | | ModbusTcp modbusTcpLink; |
| | | int addrExe; |
| | | for (Device device : list) { |
| | | deviceModbus = deviceModbusService.getCacheDeviceModbus(request.getCompanyId(), device.getPassCode() + ""); |
| | | |
| | | if (null == device.getModbus()) continue; |
| | | //空è°è®¾å¤åç¬æ¥è¯¢ |
| | | if(DeviceType.TYPE_05.getCode().equals(device.getType())){ |
| | | deviceModbus = deviceModbusService.getCacheDeviceModbus(request.getCompanyId(), device.getPassCode() + "", BizType.TEMPCONTROL.getCode()); |
| | | } |
| | | |
| | | if (null == deviceModbus) { |
| | | log.error("å½å设å¤---{}{},为è·åå°é
ç½®çMODBUSä¿¡æ¯", device.getSerId(), device.getName()); |
| | | continue; |
| | | } |
| | | |
| | | modbusTcp = new ModbusTcp(device.getModbus()); |
| | | if (Constant.YN_N.equals(deviceModbus.getOpen())) continue; |
| | | |
| | | modbusTcp = new ModbusTcp(deviceModbus); |
| | | modbusTcp.setIp(request.getIp()); |
| | | modbusTcp.setPort(request.getPort()); |
| | | modbusTcp.setDeviceCode(device.getPassCode() + ""); |
| | | modbusTcp.setBizCode(device.getPassCode() + ""); |
| | | modbusTcp.setSerId(device.getSerId()); |
| | | modbusTcp.setCompanyId(device.getCompanyId()); |
| | | |
| | | //空è°ç¶æåç¬è¯»å |
| | | if(DeviceType.TYPE_05.getCode().equals(device.getType())){ |
| | | doReadTempStatus(modbusTcp); |
| | | continue; |
| | | } |
| | | |
| | | if (Constant.YN_N.equals(modbusTcp.getAddrOpenEnd())) continue; |
| | | doReadStatus(modbusTcp, false); |
| | | |
| | | addrExe = Integer.valueOf(modbusTcp.getAddrOpenEnd()) - 1; |
| | | modbusTcp.setAddrExe(addrExe); |
| | | |
| | | doReadExe(modbusTcp); |
| | | |
| | | if (null == device.getLinkModbus()) continue; |
| | | if (StringUtils.isBlank(device.getLink()) || "null".equals(device.getLink())) continue; |
| | | |
| | | Thread.sleep(300); |
| | | |
| | | modbusTcpLink = new ModbusTcp(device.getModbus()); |
| | | deviceModbus = deviceModbusService.getCacheDeviceModbus(request.getCompanyId(), device.getLink()); |
| | | |
| | | if (null == deviceModbus) continue; |
| | | |
| | | modbusTcpLink = new ModbusTcp(deviceModbus); |
| | | modbusTcpLink.setIp(request.getIp()); |
| | | modbusTcpLink.setPort(request.getPort()); |
| | | modbusTcpLink.setSerId(device.getSerId()); |
| | | modbusTcpLink.setDeviceCode(device.getLink()); |
| | | modbusTcpLink.setBizCode(device.getLink()); |
| | | modbusTcpLink.setCompanyId(device.getCompanyId()); |
| | | addrExe = Integer.valueOf(modbusTcpLink.getAddrOpenEnd()) - 1; |
| | | modbusTcpLink.setAddrExe(addrExe); |
| | | |
| | | doReadExe(modbusTcpLink); |
| | | modbusTcpLink.setAddrExe(ServerUtil.getAddrExe(modbusTcp.getDeviceModbus().getOpenEnd())); |
| | | |
| | | doReadStatus(modbusTcpLink, true); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | log.error("è°ç¨MODBUS-TCPæ§è¡å¼å¸¸ï¼{}", e); |
| | | return new DeviceControlResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åå°æ§è¡å¼å¸¸ï¼" + e.getMessage()); |
| | | return new DeviceControlResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åå°æ§è¡å¼å¸¸ï¼" + e.getLocalizedMessage()); |
| | | } |
| | | |
| | | analysisService.analysisDevice(request, 3000); |
| | |
| | | * 读åç¶æï¼åæ¶è¯»åå¼ç¶æåå
³éç¶æ |
| | | * |
| | | * @param modbusTcp |
| | | * @param flag æ¯å¦æ¯å
³èè®¾å¤ |
| | | * @throws Exception |
| | | */ |
| | | private void doReadExe(ModbusTcp modbusTcp) throws Exception { |
| | | private void doReadStatus(ModbusTcp modbusTcp, Boolean flag) throws Exception { |
| | | |
| | | if (Constant.YN_N.equals(modbusTcp.getAddrOpenEnd())) return; |
| | | if (Constant.YN_N.equals(modbusTcp.getDeviceModbus().getOpen())) return; |
| | | if (Constant.YN_N.equals(modbusTcp.getDeviceModbus().getOpenEnd())) return; |
| | | |
| | | boolean[] result = modbusUtil.readStatus02(modbusTcp.getIp(), modbusTcp.getPort(), modbusTcp.getAddrExe(), 2); |
| | | log.debug("---------读åç¶æ------{}--{}", modbusTcp.getDeviceCode(), result.toString()); |
| | | |
| | | if (result[0]) { |
| | | ServerUtil.add2StatusMap(modbusTcp.getCompanyId(), modbusTcp.getSerId(), modbusTcp.getDeviceCode(), DeviceStatus.OPEN.getCode()); |
| | | int addrExe = ServerUtil.getAddrExe(modbusTcp.getDeviceModbus().getOpenEnd()); |
| | | boolean result = ModbusUtil2.readInputStatus(modbusTcp.getIp(), modbusTcp.getPort(), addrExe); |
| | | log.debug("---------读é£çªé£å£å¼å°ä½ç¶æ(æå
¶ä»è®¾å¤è¿è¡ç¶æ)------{}-{}-{}", modbusTcp.getBizCode(), addrExe, result); |
| | | String statusOpen = DeviceStatus.OPEN.getCode(); |
| | | String statusClose = DeviceStatus.CLOSE.getCode(); |
| | | if(flag){ |
| | | statusOpen = DeviceStatus.F_OPEN.getCode(); |
| | | statusClose = DeviceStatus.F_CLOSE.getCode(); |
| | | } |
| | | if (result[1]) { |
| | | ServerUtil.add2StatusMap(modbusTcp.getCompanyId(), modbusTcp.getSerId(), modbusTcp.getDeviceCode(), DeviceStatus.CLOSE.getCode()); |
| | | if (result) { |
| | | ServerUtil.add2StatusMap(modbusTcp.getCompanyId(), modbusTcp.getSerId(), modbusTcp.getBizCode(), statusOpen); |
| | | }else { |
| | | ServerUtil.add2StatusMap(modbusTcp.getCompanyId(), modbusTcp.getSerId(), modbusTcp.getBizCode(), statusClose); |
| | | } |
| | | |
| | | if (Constant.YN_N.equals(modbusTcp.getDeviceModbus().getCloseEnd())) return; |
| | | addrExe = ServerUtil.getAddrExe(modbusTcp.getDeviceModbus().getCloseEnd()); |
| | | result = ModbusUtil2.readInputStatus(modbusTcp.getIp(), modbusTcp.getPort(), addrExe); |
| | | log.debug("---------读é£çªé£å£å
³å°ä½ç¶æ------{}-{}-{}", modbusTcp.getBizCode(), addrExe, result); |
| | | if (result) { |
| | | ServerUtil.add2StatusMap(modbusTcp.getCompanyId(), modbusTcp.getSerId(), modbusTcp.getBizCode(), DeviceStatus.CLOSE.getCode()); |
| | | }else { |
| | | ServerUtil.add2StatusMap(modbusTcp.getCompanyId(), modbusTcp.getSerId(), modbusTcp.getBizCode(), DeviceStatus.OPEN.getCode()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 读å空è°è®¾å¤ç¶æ |
| | | * |
| | | * @param modbusTcp |
| | | * @throws Exception |
| | | */ |
| | | private void doReadTempStatus(ModbusTcp modbusTcp) throws Exception { |
| | | |
| | | if (Constant.YN_N.equals(modbusTcp.getDeviceModbus().getOpenEnd())) return; |
| | | |
| | | int addrExe = ServerUtil.getAddrExe(modbusTcp.getDeviceModbus().getOpenEnd()); |
| | | Number number = ModbusUtil2.readHoldingRegister(modbusTcp.getIp(), modbusTcp.getPort(), addrExe); |
| | | log.debug("---------读空è°è¿è¡ç¶æ------{}-{}-{}", modbusTcp.getBizCode(), addrExe, number); |
| | | |
| | | int num = number.intValue(); |
| | | if(num == 1){ |
| | | ServerUtil.add2StatusMap(modbusTcp.getCompanyId(), modbusTcp.getSerId(), modbusTcp.getBizCode(), DeviceStatus.OPEN.getCode()); |
| | | } |
| | | if(num == 2){ |
| | | ServerUtil.add2StatusMap(modbusTcp.getCompanyId(), modbusTcp.getSerId(), modbusTcp.getBizCode(), DeviceStatus.CLOSE.getCode()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public DeviceControlResponse tempControl(TempControlRequest request) { |
| | | return new DeviceControlResponse(OrderRespEnum.ORDER_ERROR.getCode(), "ç»ç«¯æä½æªæ¥å
¥å½åæ§å¶"); |
| | | ExeDevice exeDevice = request.getExeDevice(); |
| | | |
| | | if (null == exeDevice) { |
| | | return new DeviceControlResponse(OrderRespEnum.ORDER_ERROR.getCode(), "没æéè¦æ§è¡ç设å¤"); |
| | | } |
| | | |
| | | try { |
| | | ModbusTcp modbusTcp; |
| | | String temp = Constant.YN_N; |
| | | DeviceSer deviceSer; |
| | | |
| | | DeviceModbus deviceModbus = deviceModbusService.getCacheDeviceModbus(request.getCompanyId(), exeDevice.getPassCode() + "", BizType.TEMPCONTROL.getCode()); |
| | | if (null == deviceModbus) { |
| | | return new DeviceControlResponse(OrderRespEnum.ORDER_ERROR.getCode(), "æªè·åå°é
ç½®çMODBUSä¿¡æ¯"); |
| | | } |
| | | |
| | | modbusTcp = new ModbusTcp(deviceModbus); |
| | | modbusTcp.setIp(request.getIp()); |
| | | modbusTcp.setPort(request.getPort()); |
| | | |
| | | //è¥Modbus设å¤é
ç½®åæºï¼åä½¿ç¨æé
ç½®åæºçIPãç«¯å£ |
| | | if (StringUtils.isNotEmpty(deviceModbus.getSerId())) { |
| | | deviceSer = coreSerService.getCacheSer(request.getCompanyId(), deviceModbus.getSerId()); |
| | | modbusTcp.setIp(deviceSer.getIp()); |
| | | modbusTcp.setPort(deviceSer.getPort()); |
| | | } |
| | | |
| | | modbusTcp.setBizCode(exeDevice.getPassCode() + ""); |
| | | modbusTcp.setSerId(request.getSerId()); |
| | | modbusTcp.setCompanyId(request.getCompanyId()); |
| | | |
| | | //å¼ç©ºè°æ¶ï¼éè¦åé两æ¡å½ä»¤ï¼ä¸æ¡è®¾ç½®æ¸©åº¦å½ä»¤ï¼ä¸æ¡å¼å¯å½ä»¤ |
| | | if (DeviceStatus.OPEN.getCode().equals(exeDevice.getTargetStatus())) { |
| | | |
| | | //设置温度 |
| | | temp = modbusTcp.getDeviceModbus().getClose(); |
| | | modbusTcp.setAddrExe(ServerUtil.getAddrExe(temp)); |
| | | doWriteExe(modbusTcp, exeDevice.getTargetStatus()); |
| | | boolean exeResult = ModbusUtil2.writeRegister(modbusTcp.getIp(), modbusTcp.getPort(), modbusTcp.getAddrExe(), Integer.valueOf(request.getTargetTemp())); |
| | | |
| | | //å¼ç©ºè° |
| | | if (exeResult) { |
| | | temp = modbusTcp.getDeviceModbus().getOpen(); |
| | | modbusTcp.setAddrExe(ServerUtil.getAddrExe(temp)); |
| | | doWriteExe(modbusTcp, exeDevice.getTargetStatus()); |
| | | } |
| | | } |
| | | |
| | | //å
³ç©ºè°æ¶ï¼åªåé䏿¡å
³éå½ä»¤ |
| | | if (DeviceStatus.CLOSE.getCode().equals(exeDevice.getTargetStatus())) { |
| | | temp = modbusTcp.getDeviceModbus().getStop(); |
| | | modbusTcp.setAddrExe(ServerUtil.getAddrExe(temp)); |
| | | doWriteExe(modbusTcp, exeDevice.getTargetStatus()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("è°ç¨MODBUS-TCPæ§è¡å¼å¸¸ï¼{}", e); |
| | | return new DeviceControlResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åå°æ§è¡å¼å¸¸ï¼" + e.getMessage()); |
| | | } |
| | | |
| | | return new DeviceControlResponse(OrderRespEnum.ORDER_SUCCESS); |
| | | } |
| | | |
| | | @Override |
| | |
| | | package com.ld.igds.protocol.modbus.command; |
| | | |
| | | import com.ld.igds.common.CoreSerService; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.io.RemoteEsService; |
| | | import com.ld.igds.io.constant.OrderRespEnum; |
| | | import com.ld.igds.io.constant.ProtocolEnum; |
| | | import com.ld.igds.io.request.BaseRequest; |
| | | import com.ld.igds.io.response.BaseResponse; |
| | | import com.ld.igds.io.response.GasResponse; |
| | | import com.ld.igds.modbus.service.HModbusService; |
| | | import com.ld.igds.models.DeviceModbus; |
| | | import com.ld.igds.models.DeviceSer; |
| | | import com.ld.igds.protocol.modbus.ModbusUtil2; |
| | | import com.ld.igds.protocol.modbus.ServerUtil; |
| | | import com.ld.igds.protocol.modbus.data.ModbusTcp; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Component; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å½ååè®®é对æ åModbus-TCPåè®® |
| | |
| | | |
| | | public static final String BEAN_ID = "modbus.remoteEsService"; |
| | | |
| | | @Resource |
| | | private HModbusService modbusService; |
| | | @Resource |
| | | private AnalysisService analysisService; |
| | | @Resource |
| | | private CoreSerService coreSerService; |
| | | |
| | | @Override |
| | | public String getProtocol() { |
| | | return null; |
| | | return ProtocolEnum.TCP_MODBUS.getCode(); |
| | | } |
| | | |
| | | @Override |
| | | public BaseResponse checkEs(BaseRequest request) { |
| | | return null; |
| | | |
| | | String passCode = request.getDepotId(); |
| | | |
| | | try { |
| | | //è·åéè¦æ§è¡ç设å¤é
ç½® |
| | | List<DeviceModbus> list = modbusService.getDataByBizType(BizType.ES.getCode(), request.getSerId()); |
| | | |
| | | if(null == list || list.isEmpty()){ |
| | | return new GasResponse(OrderRespEnum.ORDER_ERROR.getCode(), "æªè·åå°Modbusè½èé
置信æ¯"); |
| | | } |
| | | ModbusTcp modbusTcp; |
| | | DeviceSer deviceSer; |
| | | for (DeviceModbus deviceModbus : list) { |
| | | modbusTcp = new ModbusTcp(deviceModbus); |
| | | modbusTcp.setIp(request.getIp()); |
| | | modbusTcp.setPort(request.getPort()); |
| | | |
| | | //è¥Modbus设å¤é
ç½®åæºï¼åä½¿ç¨æé
ç½®åæºçIPãç«¯å£ |
| | | if(StringUtils.isNotEmpty(deviceModbus.getSerId())){ |
| | | deviceSer = coreSerService.getCacheSer(request.getCompanyId(), deviceModbus.getSerId()); |
| | | modbusTcp.setIp(deviceSer.getIp()); |
| | | modbusTcp.setPort(deviceSer.getPort()); |
| | | } |
| | | |
| | | modbusTcp.setBizCode(passCode); |
| | | modbusTcp.setSerId(request.getSerId()); |
| | | modbusTcp.setCompanyId(request.getCompanyId()); |
| | | |
| | | modbusTcp.setAddrExe(ServerUtil.getAddrExe(deviceModbus.getOpen())); |
| | | |
| | | log.debug("--------å¯å¨è½èæ¥è¯¢---{}-{}", modbusTcp.getSerId(), modbusTcp.getBizCode()); |
| | | Number check = ModbusUtil2.readHoldingRegister(modbusTcp.getIp(), modbusTcp.getPort(), modbusTcp.getAddrExe()); |
| | | |
| | | //è§£æè½èæ°æ® |
| | | analysisService.analysisEs(request, check); |
| | | } |
| | | } catch (Exception e) { |
| | | return new GasResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åå°æ§è¡å¼å¸¸ï¼" + e.getLocalizedMessage()); |
| | | } |
| | | |
| | | return new GasResponse(OrderRespEnum.ORDER_SUCCESS); |
| | | } |
| | | } |
| | |
| | | package com.ld.igds.protocol.modbus.command; |
| | | |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.constant.RedisConst; |
| | | import com.ld.igds.io.RemoteGasService; |
| | | import com.ld.igds.io.constant.OrderRespEnum; |
| | | import com.ld.igds.io.constant.ProtocolEnum; |
| | | import com.ld.igds.io.request.CheckGasRequest; |
| | | import com.ld.igds.io.response.DeviceControlResponse; |
| | | import com.ld.igds.io.response.GasResponse; |
| | | import com.ld.igds.modbus.service.HModbusService; |
| | | import com.ld.igds.models.DeviceModbus; |
| | | import com.ld.igds.models.GasModbus; |
| | | import com.ld.igds.protocol.modbus.ModbusUtil2; |
| | | import com.ld.igds.protocol.modbus.ServerUtil; |
| | | import com.ld.igds.protocol.modbus.data.ModbusGasResult; |
| | | import com.ld.igds.protocol.modbus.data.ModbusTcp; |
| | | import com.ld.igds.util.RedisUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å½ååè®®é对æ åModbus-TCPåè®® |
| | |
| | | |
| | | public static final String BEAN_ID = "modbus.remoteGasService"; |
| | | |
| | | @Resource |
| | | private HModbusService modbusService; |
| | | @Resource |
| | | private AnalysisService analysisService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | @Override |
| | | public String getProtocol() { |
| | | return null; |
| | | return ProtocolEnum.TCP_MODBUS.getCode(); |
| | | } |
| | | |
| | | @Override |
| | | public GasResponse checkGas(CheckGasRequest request) { |
| | | return null; |
| | | |
| | | boolean isRun = isRun(request); |
| | | if (isRun) { |
| | | return new GasResponse(OrderRespEnum.ORDER_ERROR.getCode(), "æéï¼å½å仿£å¨æ§è¡æ£æµ"); |
| | | } |
| | | |
| | | String passCode = request.getDepotId(); |
| | | |
| | | try { |
| | | //è·åéè¦æ§è¡ç设å¤é
ç½® |
| | | DeviceModbus deviceModbus = modbusService.getCacheDeviceModbus(request.getCompanyId(), passCode, BizType.GAS.getCode()); |
| | | |
| | | ModbusTcp modbusTcp = new ModbusTcp(deviceModbus); |
| | | modbusTcp.setIp(request.getIp()); |
| | | modbusTcp.setPort(request.getPort()); |
| | | modbusTcp.setBizCode(passCode); |
| | | modbusTcp.setSerId(request.getSerId()); |
| | | modbusTcp.setCompanyId(request.getCompanyId()); |
| | | |
| | | modbusTcp.setAddrExe(ServerUtil.getAddrExe(deviceModbus.getOpen())); |
| | | |
| | | boolean exeResult = ModbusUtil2.writeCoilStatus(modbusTcp.getIp(), modbusTcp.getPort(), modbusTcp.getAddrExe(), true); |
| | | if (exeResult) { |
| | | addRun(request); |
| | | //è°ç¨å¼æ¥è·åç»æ |
| | | progressGasResult(request, modbusTcp); |
| | | log.debug("--------å¯å¨æµæ°---{}-{}", modbusTcp.getSerId(), modbusTcp.getBizCode()); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | return new GasResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åå°æ§è¡å¼å¸¸ï¼" + e.getLocalizedMessage()); |
| | | } |
| | | |
| | | return new GasResponse(OrderRespEnum.ORDER_SUCCESS); |
| | | } |
| | | |
| | | private void addRun(CheckGasRequest request) { |
| | | String key = RedisConst.buildKey(request.getCompanyId(), ServerUtil.RUN_TAG, request.getDepotId()); |
| | | |
| | | redisUtil.set(key, request, 6 * 60); |
| | | } |
| | | |
| | | private void delRun(CheckGasRequest request) { |
| | | String key = RedisConst.buildKey(request.getCompanyId(), ServerUtil.RUN_TAG, request.getDepotId()); |
| | | |
| | | redisUtil.del(key); |
| | | } |
| | | |
| | | private boolean isRun(CheckGasRequest request) { |
| | | String key = RedisConst.buildKey(request.getCompanyId(), ServerUtil.RUN_TAG, request.getDepotId()); |
| | | |
| | | Object obj = redisUtil.get(key); |
| | | if (null == obj) return false; |
| | | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 弿¥æ§è¡è¿åº¦æ¥è¯¢ |
| | | * |
| | | * @param modbusTcp |
| | | */ |
| | | @Async |
| | | public void progressGasResult(CheckGasRequest request, ModbusTcp modbusTcp) { |
| | | |
| | | |
| | | log.debug("--------------弿¥æ§è¡æ°ä½æ£æµè®°è¿è·å-------------"); |
| | | |
| | | try { |
| | | List<GasModbus> list = modbusService.listGasModBus(modbusTcp.getBizCode()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("------------æ´æ°æ°ä½æ£æµç»æè¿åº¦å¤±è´¥ï¼æ²¡æè·åå°æ£æµééé
置信æ¯-----{}", modbusTcp.getBizCode()); |
| | | return; |
| | | } |
| | | |
| | | //æ ¹æ®ééæ°é线ç¨çå¾
ï¼æ¯ä¸ªééçå¾
60ç§ |
| | | Thread.sleep(list.size() * 50 * 1000); |
| | | log.debug("--------------çå¾
æ¶é´å®æï¼å¼å§è·åæ£æµç»æ-------------{}", modbusTcp.getBizCode()); |
| | | |
| | | boolean isRun = isRun(request); |
| | | if (!isRun) { |
| | | log.info("--------------å½åä»åºæ£æµå·²ç»åæ¢ï¼åæ¶ç»ææ¥è¯¢-------------{}", modbusTcp.getBizCode()); |
| | | return; |
| | | } |
| | | |
| | | ModbusTcp modbusTcpTemp = modbusTcp; |
| | | List<ModbusGasResult> results = new ArrayList<>(); |
| | | ModbusGasResult gasResult; |
| | | Number check; |
| | | for (GasModbus gasModbus : list) { |
| | | gasResult = new ModbusGasResult(); |
| | | gasResult.setPasscode(gasModbus.getPasscode()); |
| | | |
| | | //äºæ°§å碳 |
| | | modbusTcpTemp.setAddrExe(ServerUtil.getAddrExe(gasModbus.getCo2())); |
| | | check = ModbusUtil2.readHoldingRegister(modbusTcpTemp.getIp(), modbusTcpTemp.getPort(), modbusTcpTemp.getAddrExe()); |
| | | gasResult.setCo2(check); |
| | | |
| | | //æ°§æ° |
| | | modbusTcpTemp.setAddrExe(ServerUtil.getAddrExe(gasModbus.getO2())); |
| | | check = ModbusUtil2.readHoldingRegister(modbusTcpTemp.getIp(), modbusTcpTemp.getPort(), modbusTcpTemp.getAddrExe()); |
| | | gasResult.setO2(check); |
| | | |
| | | //ç£·åæ°¢ |
| | | modbusTcpTemp.setAddrExe(ServerUtil.getAddrExe(gasModbus.getPh3())); |
| | | check = ModbusUtil2.readHoldingRegister(modbusTcpTemp.getIp(), modbusTcpTemp.getPort(), modbusTcpTemp.getAddrExe()); |
| | | gasResult.setPh3(check); |
| | | log.debug("----éé{}ï¼Co2={}ï¼O2={}ï¼Ph3={}", gasModbus.getPasscode(), gasResult.getCo2(), gasResult.getO2(), gasResult.getPh3()); |
| | | results.add(gasResult); |
| | | } |
| | | |
| | | //å é¤è¿è¡æ è®° |
| | | delRun(request); |
| | | |
| | | log.debug("----è·åçæ°ä½æ£æµç»æ---{}--{}", request.getDepotId(), results.toString()); |
| | | //éç¥è§£æ |
| | | analysisService.analysisGas(request, results); |
| | | } catch (Exception e) { |
| | | log.error("------------æ´æ°æ°ä½æ£æµç»æè¿åº¦å¤±è´¥ï¼æ§è¡å¼å¸¸-----{}--{}", modbusTcp.getBizCode(), e); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public GasResponse checkGasByPoint(CheckGasRequest request) { |
| | | return null; |
| | | return new GasResponse(OrderRespEnum.ORDER_ERROR.getCode(), "å½åæ§å¶æä¸æ¯æéæ©ç¹ä½éé"); |
| | | } |
| | | |
| | | @Override |
| | | public GasResponse stopCheckGas(CheckGasRequest request) { |
| | | return null; |
| | | String passCode = request.getDepotId(); |
| | | |
| | | try { |
| | | //è·åéè¦æ§è¡ç设å¤é
ç½® |
| | | DeviceModbus deviceModbus = modbusService.getCacheDeviceModbus(request.getCompanyId(), passCode, BizType.GAS.getCode()); |
| | | |
| | | ModbusTcp modbusTcp = new ModbusTcp(deviceModbus); |
| | | modbusTcp.setIp(request.getIp()); |
| | | modbusTcp.setPort(request.getPort()); |
| | | modbusTcp.setBizCode(passCode); |
| | | modbusTcp.setSerId(request.getSerId()); |
| | | modbusTcp.setCompanyId(request.getCompanyId()); |
| | | |
| | | modbusTcp.setAddrExe(ServerUtil.getAddrExe(deviceModbus.getStop())); |
| | | |
| | | boolean exeResult = ModbusUtil2.writeCoilStatus(modbusTcp.getIp(), modbusTcp.getPort(), modbusTcp.getAddrExe(), true); |
| | | if (exeResult) { |
| | | log.debug("--------å
³éæµæ°---{}-{}", modbusTcp.getSerId(), modbusTcp.getBizCode()); |
| | | |
| | | //éç¥å¼æ¥ç»æç»æéé |
| | | delRun(request); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | return new GasResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åå°æ§è¡å¼å¸¸ï¼" + e.getLocalizedMessage()); |
| | | } |
| | | |
| | | return new GasResponse(OrderRespEnum.ORDER_SUCCESS); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.modbus.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Desc: ç¨äºå°è£
ModBUsTCPçä¿¡æ¯ |
| | | * @author: andy.jia |
| | | * @update-time: 2023/8/12 15:29 |
| | | */ |
| | | @Data |
| | | public class ModbusGasResult { |
| | | |
| | | private int passcode; |
| | | |
| | | private Number co2; |
| | | |
| | | private Number o2; |
| | | |
| | | private Number ph3; |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "GasResult{" + |
| | | "passcode=" + passcode + |
| | | ", co2=" + co2 + |
| | | ", o2=" + o2 + |
| | | ", ph3=" + ph3 + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | package com.ld.igds.protocol.modbus.data; |
| | | |
| | | import com.ld.igds.constant.Constant; |
| | | import com.ld.igds.models.DeviceModbus; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | private String companyId; |
| | | |
| | | private String deviceCode; |
| | | |
| | | //ä¸å¡ç¸å
³ç¼ç |
| | | private String bizCode; |
| | | |
| | | private String serId; |
| | | |
| | |
| | | |
| | | private int port; |
| | | |
| | | /** |
| | | * å¼å°å |
| | | **/ |
| | | private String addrOpen = Constant.YN_N; |
| | | private DeviceModbus deviceModbus; |
| | | |
| | | /** |
| | | * å
³å°å |
| | | **/ |
| | | private String addrClose = Constant.YN_N; |
| | | |
| | | /** |
| | | * åå°å |
| | | **/ |
| | | private String addrStop = Constant.YN_N; |
| | | |
| | | /** |
| | | * å¼å°ä½å°å |
| | | **/ |
| | | private String addrOpenEnd = Constant.YN_N; |
| | | |
| | | /** |
| | | * å
³å°ä½å°å |
| | | **/ |
| | | private String addrCloseEnd = Constant.YN_N; |
| | | |
| | | /** |
| | | * 弿
éå°å |
| | | **/ |
| | | private String addrOpenError = Constant.YN_N; |
| | | |
| | | /** |
| | | * å
³æ
éå°å |
| | | **/ |
| | | private String addrCloseError = Constant.YN_N; |
| | | |
| | | private int addrExe = 65535; |
| | | |
| | | private int addrExe; |
| | | |
| | | public ModbusTcp() { |
| | | super(); |
| | | } |
| | | |
| | | public ModbusTcp(String modbusStr) { |
| | | //modbusè§åï¼å¼å°å-å
³å°å-åå°å-å¼å°ä½-å
³å°ä½-弿
é-å
³æ
éï¼æ å°åç¨Nä»£æ¿ |
| | | String[] addr = modbusStr.split("-"); |
| | | this.addrOpen = addr[0]; |
| | | this.addrClose = addr[1]; |
| | | this.addrStop = addr[2]; |
| | | this.addrOpenEnd = addr[3]; |
| | | this.addrCloseEnd = addr[4]; |
| | | this.addrOpenError = addr[5]; |
| | | this.addrCloseError = addr[6]; |
| | | public ModbusTcp(DeviceModbus deviceModbus) { |
| | | this.deviceModbus = deviceModbus; |
| | | } |
| | | // |
| | | // public ModbusTcp(String modbusStr) { |
| | | // //modbusè§åï¼å¼å°å-å
³å°å-åå°å-å¼å°ä½-å
³å°ä½-弿
é-å
³æ
éï¼æ å°åç¨Nä»£æ¿ |
| | | // String[] addr = modbusStr.split("-"); |
| | | // String temp = addr[0]; |
| | | // if (!Constant.YN_N.equals(temp)) this.addrOpen = temp; |
| | | // temp = addr[1]; |
| | | // if (!Constant.YN_N.equals(temp)) this.addrClose = temp; |
| | | // temp = addr[2]; |
| | | // if (!Constant.YN_N.equals(temp)) this.addrStop = temp; |
| | | // temp = addr[3]; |
| | | // if (!Constant.YN_N.equals(temp)) this.addrOpenEnd = temp; |
| | | // temp = addr[4]; |
| | | // if (!Constant.YN_N.equals(temp)) this.addrCloseEnd = temp; |
| | | // temp = addr[5]; |
| | | // if (!Constant.YN_N.equals(temp)) this.addrOpenError = temp; |
| | | // temp = addr[6]; |
| | | // if (!Constant.YN_N.equals(temp)) this.addrCloseError = temp; |
| | | // } |
| | | |
| | | public ModbusTcp(String companyId, String bizCode, String serId, String ip, int port, DeviceModbus deviceModbus) { |
| | | this.companyId = companyId; |
| | | this.bizCode = bizCode; |
| | | this.serId = serId; |
| | | this.ip = ip; |
| | | this.port = port; |
| | | this.deviceModbus = deviceModbus; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <groupId>com.ld.igds</groupId> |
| | | <artifactId>igds-protocol-zldz</artifactId> |
| | | <version>4.0.0-RELEASE</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <properties> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <java.version>1.8</java.version> |
| | | <igds.version>4.0.0-RELEASE</igds.version> |
| | | </properties> |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- å¼å
¥ä¹å¡æ ¸å¿å
--> |
| | | <dependency> |
| | | <groupId>com.ld.igds</groupId> |
| | | <artifactId>igds-core</artifactId> |
| | | <version>${igds.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- å¼å
¥IOå
--> |
| | | <dependency> |
| | | <groupId>com.ld.base.io</groupId> |
| | | <artifactId>base-io-netty</artifactId> |
| | | <version>1.0.0-SNAPSHOT</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <configuration> |
| | | <source>1.8</source> |
| | | <target>1.8</target> |
| | | <compilerArguments> |
| | | <extdirs>src\main\webapp\WEB-INF\lib</extdirs> |
| | | </compilerArguments> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz; |
| | | |
| | | import com.ld.igds.data.ConfigData; |
| | | import com.ld.igds.protocol.zldz.server.ZldzServerEngine; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.CommandLineRunner; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * å¯ä»¥æ ¹æ®é
ç½®æä»¶çµæ´»è°æ´ |
| | | * é
ç½®éç³»ç»èªå¨å¯å¨æå¡ -- æ§è¡é¡ºåº20-29 |
| | | */ |
| | | @Component(ServerRunner.BEAN_ID) |
| | | @Order(value = 22) |
| | | public class ServerRunner implements CommandLineRunner { |
| | | |
| | | public static final String BEAN_ID = "zldz.serverRunner"; |
| | | |
| | | @Autowired |
| | | private ConfigData configData; |
| | | |
| | | @Override |
| | | public void run(String... strings) throws Exception { |
| | | // |
| | | if ("fzzy".equals(configData.getActive())) { |
| | | ZldzServerEngine.start(9201); |
| | | return; |
| | | } |
| | | |
| | | //飿£è´è¿é»è®¤é¨ç½²æå¡å½ååºç¨ä½¿ç¨9000ç«¯å£ |
| | | if (configData.getActive().equals("dev")) { |
| | | ZldzServerEngine.start(9201); |
| | | return; |
| | | } |
| | | |
| | | //飿£è´è¿é»è®¤é¨ç½²æå¡å½ååºç¨ä½¿ç¨9000ç«¯å£ |
| | | if (configData.getActive().indexOf("pro") >= 0) { |
| | | //FZZYå¹³å° |
| | | // ZldzServerEngine.start(9201); |
| | | //å
¶ä»å¹³å° |
| | | ZldzServerEngine.start(9000); |
| | | return; |
| | | } |
| | | |
| | | //请注æï¼æ£æ¥çµåæ¬äºæå¡å¨é¨ç½²ç¨çç«¯å£æ¯ï¼8000 |
| | | if (configData.getActive().equals("zldz")) { |
| | | ZldzServerEngine.start(ZldzServerEngine.PORT); |
| | | return; |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.analysis; |
| | | |
| | | import com.ld.igds.common.CoreSerService; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.constant.Constant; |
| | | import com.ld.igds.constant.RedisConst; |
| | | import com.ld.igds.grain.dto.GrainSerCableData; |
| | | import com.ld.igds.io.notify.NotifyWebInvoker; |
| | | import com.ld.igds.io.constant.OrderRespEnum; |
| | | import com.ld.igds.io.request.GrainSerConfRequest; |
| | | import com.ld.igds.models.DeviceSer; |
| | | import com.ld.igds.protocol.zldz.analysis.message.ReMessage; |
| | | import com.ld.igds.protocol.zldz.command.BaseRemoteImpl; |
| | | import com.ld.igds.protocol.zldz.command.builder.CommandBuilder8829; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.task.CommandReSendService; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | import com.ld.igds.util.RedisUtil; |
| | | import com.ld.igds.view.manager.TempManager; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author vince |
| | | */ |
| | | @Slf4j |
| | | @Component(AnalysisConf.BEAN_ID) |
| | | public class AnalysisConf extends BaseRemoteImpl { |
| | | |
| | | public static final String BEAN_ID = "zldz.analysisConf"; |
| | | |
| | | @Autowired |
| | | private NotifyWebInvoker notifyWebInvoker; |
| | | |
| | | @Autowired |
| | | private CoreSerService serService; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private TempManager thManager; |
| | | |
| | | @Autowired |
| | | private CommandReSendService commandReSendService; |
| | | |
| | | /** |
| | | * è§£æåæºé
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param message |
| | | * @param ser |
| | | */ |
| | | public void analysis8816(ReMessage message, DeviceSer ser) { |
| | | |
| | | log.debug("åæº---->>>å¹³å°ï¼æ¶æ¯ç±»å=8816----{}-{}.{}", ser.getCompanyId(), |
| | | ser.getIp(), ser.getPort()); |
| | | |
| | | // æ¸
é¤ç¼å |
| | | commandReSendService.cleanKey(message.getCompanyId(), message.getIp(), |
| | | message.getPort(), ServerUtils.MSG_TYPE_8816); |
| | | |
| | | // æ¸
æ¥åå§åç»éçè§£æ |
| | | commandReSendService.cleanKey(ServerUtils.DEFAULT_COMPANY, |
| | | message.getIp(), message.getPort(), ServerUtils.MSG_TYPE_8816); |
| | | |
| | | ser.setStatus(Constant.YN_Y); |
| | | |
| | | String content = message.getBody().getContent(); |
| | | |
| | | // è¯»åæ å¿ |
| | | int start = 0, len = 1; |
| | | String temp = content.substring(start * 2, start * 2 + len * 2); |
| | | int readTag = BytesUtil.hexToInt(temp); |
| | | |
| | | // 设å¤IDï¼å
¨å±å¯ä¸ |
| | | start = 1; |
| | | len = 2; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | |
| | | // ç½ç»ID |
| | | start = 3; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | |
| | | // ä¿¡é |
| | | start = 4; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | |
| | | // éç |
| | | start = 5; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | |
| | | // 屿° |
| | | start = 6; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | ser.setCableZ(BytesUtil.hexToInt(temp)); |
| | | |
| | | // è¡æ° |
| | | start = 7; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | ser.setCableY(BytesUtil.hexToInt(temp)); |
| | | |
| | | // åæ° |
| | | start = 8; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | ser.setCableX(BytesUtil.hexToInt(temp)); |
| | | |
| | | // çµç¼å¶å¼ |
| | | start = 9; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | ser.setCableFormat("0" + BytesUtil.hexToInt(temp)); |
| | | |
| | | // çµç¼ç±»å |
| | | start = 10; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | ser.setCableType("0" + BytesUtil.hexToInt(temp)); |
| | | |
| | | // ä¾çµæ¨¡å¼ |
| | | start = 11; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | ser.setPowerModel("0" + BytesUtil.hexToInt(temp)); |
| | | |
| | | String msg = ser.getName() + " è¿ç¨è·åé
ç½®æåï¼è¯·å·æ°æ°æ®æ¥çï¼"; |
| | | |
| | | // ç»ç»ç¼ç |
| | | start = 12; |
| | | temp = content.substring(start * 2); |
| | | if (readTag == 1) {// 表示åçæåè¿å |
| | | ser.setOrgId(ser.getCompanyId()); |
| | | msg = ser.getName() + " è¿ç¨åå
¥æåï¼è¯·å·æ°æ°æ®æ¥çï¼"; |
| | | } else { |
| | | ser.setOrgId(BytesUtil.hexToInt(BytesUtil.tran_LH(temp)) + ""); |
| | | } |
| | | |
| | | if (null == ser.getSn()) { |
| | | ser.setSn(ser.getId()); |
| | | } |
| | | ser.setIp(message.getIp()); |
| | | ser.setPort(message.getPort()); |
| | | |
| | | // å¼å§åé»è®¤=1 |
| | | if (ser.getCableStart() == 0) { |
| | | ser.setCableStart(1); |
| | | } |
| | | |
| | | log.info("åæº---->>>å¹³å°ï¼åæºé
置解æå®æ----{}-{}-{}-{}ï¼æ´æ°å°ææå¡å¨", |
| | | ser.getCompanyId(), ser.getIp(), ser.getPort(), ser.getName()); |
| | | serService.updateSerById(ser); |
| | | |
| | | // æ´æ°ä¼è¯ä¿¡æ¯ |
| | | super.updateSession(ser.getIp(), ser.getPort(), ser.getCompanyId()); |
| | | |
| | | notifyWebInvoker.notifyWeb(ser.getCompanyId(), |
| | | OrderRespEnum.MSG_SUCCESS, BizType.SYS, msg); |
| | | |
| | | //åæºä¸çº¿è¿è¡ä¸æ¬¡æ¸©æ¹¿åº¦éé |
| | | thManager.checkThBySer(ser.getCompanyId(), ser.getId()); |
| | | } |
| | | |
| | | /** |
| | | * çµç¼åå§åæå |
| | | * |
| | | * @param reMessage |
| | | * @param ser |
| | | */ |
| | | public void analysis8822(ReMessage reMessage, DeviceSer ser) { |
| | | log.debug("-----------analysis8822------------{}-{}.{}", |
| | | ser.getCompanyId(), ser.getIp(), ser.getPort()); |
| | | |
| | | // æ¸
é¤ç¼å |
| | | commandReSendService.cleanKey(reMessage.getCompanyId(), |
| | | reMessage.getIp(), reMessage.getPort(), |
| | | ServerUtils.MSG_TYPE_8822); |
| | | |
| | | String msg = ser.getName() + " åå§åçµç¼å®æï¼ï¼"; |
| | | notifyWebInvoker.notifyWeb(ser.getCompanyId(), |
| | | OrderRespEnum.MSG_SUCCESS, BizType.SYS, msg); |
| | | } |
| | | |
| | | /** |
| | | * çµç¼ä¿®æ¹è¿åï¼ |
| | | * |
| | | * @param reMessage |
| | | * @param ser |
| | | */ |
| | | public void analysis8826(ReMessage reMessage, DeviceSer ser) { |
| | | log.debug("-----------analysis8826------------{}-{}.{}", |
| | | ser.getCompanyId(), ser.getIp(), ser.getPort()); |
| | | |
| | | // æ¸
é¤ç¼å |
| | | commandReSendService.cleanKey(reMessage.getCompanyId(), |
| | | reMessage.getIp(), reMessage.getPort(), |
| | | ServerUtils.MSG_TYPE_8826); |
| | | |
| | | String msg = ser.getName() + " çµç¼ä¿®æ¹æä½å®æ"; |
| | | |
| | | notifyWebInvoker.notifyWeb(ser.getCompanyId(), |
| | | OrderRespEnum.MSG_SUCCESS, BizType.SYS, msg); |
| | | } |
| | | |
| | | /** |
| | | * ééçµç¼è·åè¿åï¼åæºè¿åæ¶å°å½ä»¤ä¿¡æ¯ï¼å®é
è¿åå¼å¨8829ä¸è¯´æ |
| | | * |
| | | * @param reMessage |
| | | * @param ser |
| | | */ |
| | | public void analysis8825(ReMessage reMessage, DeviceSer ser) { |
| | | |
| | | log.debug("-----------analysis8825------------{}-{}.{}", |
| | | ser.getCompanyId(), ser.getIp(), ser.getPort()); |
| | | |
| | | // æ¸
é¤ç¼å |
| | | commandReSendService.cleanKey(reMessage.getCompanyId(), |
| | | reMessage.getIp(), reMessage.getPort(), |
| | | ServerUtils.MSG_TYPE_8825); |
| | | |
| | | String msg = ser.getName() + " 读åééçµç¼å¼å§è¿å"; |
| | | |
| | | notifyWebInvoker.notifyWeb(ser.getCompanyId(), |
| | | OrderRespEnum.MSG_SUCCESS, BizType.SYS, msg); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * ç»ç«¯åéééçµç¼æ°æ®ç»åå°ï¼åæºä¸»å¨æ¨é |
| | | * |
| | | * @param reMessage |
| | | * @param ser |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public void analysis1129(ReMessage reMessage, DeviceSer ser) { |
| | | |
| | | // å¼å§è§£æ |
| | | String content = reMessage.getBody().getContent(); |
| | | |
| | | // ééå· |
| | | int start = 0, len = 1; |
| | | String temp = content.substring(start * 2, start * 2 + len * 2); |
| | | int passCode = BytesUtil.hexToInt(temp); |
| | | |
| | | // ç¹åºå·ï¼æç
§è¿å顺åºå¡«åä»1å¼å§ |
| | | start = 1; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | int iotNum = BytesUtil.hexToInt(temp); |
| | | |
| | | // æ»å
æ° |
| | | start = 2; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | int sumPacket = BytesUtil.hexToInt(temp); |
| | | |
| | | // å½åå
|
| | | start = 3; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | int curPacket = BytesUtil.hexToInt(temp); |
| | | |
| | | // -----------å端éç¥ç»ç«¯æ¶å°ä¿¡æ¯----------------------// |
| | | GrainSerConfRequest request = new GrainSerConfRequest(); |
| | | request.setSerId(ser.getId()); |
| | | request.setBizType(BizType.SYS.getCode()); |
| | | request.setIp(ser.getIp()); |
| | | request.setPort(ser.getPort()); |
| | | request.setCompanyId(ser.getCompanyId()); |
| | | request.setValue1(curPacket); |
| | | |
| | | Message message = CommandBuilder8829.getInstance() |
| | | .buildMessage(request); |
| | | log.info("å¹³å°------>>>åæºï¼" + request.getSerName() + "åå°æ¶å°çµç¼æ°æ®åºç=" |
| | | + message.toString()); |
| | | // åéå½ä»¤ |
| | | send(request.getIp(), request.getPort(), message.getByteMsg()); |
| | | |
| | | // -----------å端éç¥ç»ç«¯æ¶å°ä¿¡æ¯ EDN----------------------// |
| | | |
| | | log.info("åæº------>>>å¹³å°ï¼è¿åçµç¼ä¿¡æ¯ï¼åæº={}ï¼å½åå
ï¼{}ï¼ä¿¡æ¯={}", ser.getName(), |
| | | curPacket, content); |
| | | |
| | | // 详ç»ä¿¡æ¯ï¼æ¯é¿åº¦5为ä¸ç»æ°æ® |
| | | start = 4; |
| | | temp = content.substring(start * 2); |
| | | |
| | | String redisKey = RedisConst.buildKey(ser.getCompanyId(), |
| | | RedisConst.KEY_TEMP_PREFIX, "CABLE_DATA_" + ser.getId() + "_" |
| | | + passCode); |
| | | |
| | | List<GrainSerCableData> dataList = null; |
| | | if (curPacket != 1) { |
| | | dataList = (List<GrainSerCableData>) redisUtil.get(redisKey); |
| | | } |
| | | if (null == dataList) |
| | | dataList = new ArrayList<>(); |
| | | |
| | | GrainSerCableData data; |
| | | |
| | | String str1 = temp.substring(0, 160);// æ¸©åº¦ç¹ 40个 |
| | | String str2 = temp.substring(160, 400);// 1ä¸ªæ ¹å·ï¼1个ç¹å·ï¼1个é
ç½®ï¼åè½40ç» |
| | | String temp1, temp2; |
| | | for (int i = 0; i < 40; i++) { |
| | | data = new GrainSerCableData(); |
| | | data.setPassCode(passCode); |
| | | data.setIotNum(i + 1); |
| | | data.setReceiveDate(new Date()); |
| | | //data.setPointIndex(dataList.size() + i + 1); |
| | | |
| | | // 温度 |
| | | temp1 = str1.substring(i * 4, i * 4 + 4); |
| | | data.setTemp(BytesUtil.hexToInt(BytesUtil.tran_LH(temp1)) / 10.0); |
| | | |
| | | //æ ¹å· |
| | | temp2 = str2.substring(i * 6, i * 6 + 6); |
| | | data.setRootIndex(BytesUtil.hexToInt(temp2.substring(0, 2))); |
| | | |
| | | //ç¹å· |
| | | data.setPointIndex(BytesUtil.hexToInt(temp2.substring(2, 4))); |
| | | |
| | | //é
ç½® |
| | | data.setConf(temp2.substring(4, 6)); |
| | | |
| | | dataList.add(data); |
| | | } |
| | | |
| | | // åæ¾ç·©å |
| | | redisUtil.set(redisKey, dataList, 5 * 60); |
| | | |
| | | notifyWebInvoker.notifyWeb(ser.getCompanyId(), |
| | | OrderRespEnum.MSG_SUCCESS, BizType.SYS, "ç³»ç»æ¶å°çµç¼é
置信æ¯ï¼è¯·æå¨å·æ°ï¼åæº=" |
| | | + ser.getName() + ",éé=" + passCode + ",æ»å
=" |
| | | + sumPacket + ",å½åå
=" + curPacket); |
| | | } |
| | | |
| | | /** |
| | | * çµç¼æ±æ»åºç |
| | | * |
| | | * @param reMessage |
| | | * @param ser |
| | | */ |
| | | public void analysis8823(ReMessage reMessage, DeviceSer ser) { |
| | | // å¼å§è§£æ |
| | | String content = reMessage.getBody().getContent(); |
| | | |
| | | // å¨ææ¼æ¥å¯¹è±¡ |
| | | List<GrainSerCableData> dataList = new ArrayList<GrainSerCableData>(); |
| | | String tempStr; |
| | | GrainSerCableData cableData; |
| | | for (int i = 0; i < content.length() / 4; i++) { |
| | | tempStr = content.substring(i * 4, i * 4 + 4); |
| | | cableData = new GrainSerCableData(); |
| | | cableData.setPassCode(i + 1); |
| | | cableData.setReceiveDate(new Date()); |
| | | cableData.setIotNum(BytesUtil.hexToInt(tempStr.substring(0, 2))); |
| | | cableData.setIotErrNum(BytesUtil.hexToInt(tempStr.substring(2, 4))); |
| | | |
| | | dataList.add(cableData); |
| | | } |
| | | |
| | | String redisKey = RedisConst.buildKey(ser.getCompanyId(), |
| | | RedisConst.KEY_TEMP_PREFIX, "CABLE_DATA_" + ser.getId()); |
| | | |
| | | // åæ¾ç·©å |
| | | redisUtil.set(redisKey, dataList, 5 * 60); |
| | | |
| | | notifyWebInvoker.notifyWeb(ser.getCompanyId(), |
| | | OrderRespEnum.MSG_SUCCESS, BizType.SYS, |
| | | "ç³»ç»æ¶å°çµç¼æ±æ»ä¿¡æ¯ï¼è¯·æå¨æ´æ°æ¥çï¼è¿åä¿¡æ¯ï¼åæº=" + ser.getName()); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.analysis; |
| | | |
| | | import com.ld.igds.common.CoreCommonService; |
| | | import com.ld.igds.common.dto.THDto; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.constant.Constant; |
| | | import com.ld.igds.constant.DepotType; |
| | | import com.ld.igds.grain.GrainUtil; |
| | | import com.ld.igds.grain.dto.GrainItemInfo; |
| | | import com.ld.igds.io.notify.NotifyGrainInvoker; |
| | | import com.ld.igds.io.constant.OrderRespEnum; |
| | | import com.ld.igds.io.request.BaseRequest; |
| | | import com.ld.igds.models.DepotConf; |
| | | import com.ld.igds.models.DeviceSer; |
| | | import com.ld.igds.models.DicSysConf; |
| | | import com.ld.igds.models.Grain; |
| | | import com.ld.igds.order.ExeOrderService; |
| | | import com.ld.igds.order.data.ExeRequest; |
| | | import com.ld.igds.protocol.zldz.analysis.message.ReMessage; |
| | | import com.ld.igds.protocol.zldz.command.RemoteGrainServiceImpl; |
| | | import com.ld.igds.protocol.zldz.task.CommandReSendService; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.th.CoreThService; |
| | | import com.ld.igds.util.BytesUtil; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import com.ld.igds.warn.WarnUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ç²®æ
è§£æ |
| | | * |
| | | * @author Andy |
| | | */ |
| | | @Slf4j |
| | | @Component(AnalysisGrain.BEAN_ID) |
| | | public class AnalysisGrain { |
| | | |
| | | public static final String BEAN_ID = "zldz.analysisGrain"; |
| | | |
| | | @Autowired |
| | | private CoreCommonService commonService; |
| | | @Autowired |
| | | private CoreThService thService; |
| | | @Autowired |
| | | private ExeOrderService exeOrderService; |
| | | @Autowired |
| | | private GrainUtil grainUtil; |
| | | @Autowired |
| | | private NotifyGrainInvoker notifyGrainInvoker; |
| | | @Autowired |
| | | private RemoteGrainServiceImpl remoteGrainService; |
| | | @Autowired |
| | | private CommandReSendService commandReSendService; |
| | | @Autowired |
| | | private WarnUtils warnUtils; |
| | | |
| | | public static Map<String, Map<String, String>> contextMap = new HashMap<>(); |
| | | |
| | | public static double ERROR_CHECK_TAG = -100.0; |
| | | |
| | | public static double FAULT_CHECK_TAG = 85.0; |
| | | |
| | | public static double ERROR_CHECK_TAG2 = 50; |
| | | |
| | | public static double MAX_TEMP = -50.0; |
| | | public static double MIN_TEMP = 50.0; |
| | | |
| | | /** |
| | | * åå°åé请æ±åï¼ç»ç«¯çååº |
| | | * |
| | | * @param reMessage |
| | | * @param ser |
| | | */ |
| | | public void analysis8815(ReMessage reMessage, DeviceSer ser) { |
| | | BaseRequest request = new BaseRequest(); |
| | | request.setSerId(ser.getId()); |
| | | request.setCompanyId(ser.getCompanyId()); |
| | | request.setIp(reMessage.getIp()); |
| | | request.setPort(reMessage.getPort()); |
| | | request.setSerName(ser.getName()); |
| | | |
| | | remoteGrainService.reply8815(request); |
| | | } |
| | | |
| | | /** |
| | | * æ¥æ¶å°ç²®æ
çåå¤ |
| | | * |
| | | * @param reMessage |
| | | * @param ser |
| | | */ |
| | | public void reply8817(ReMessage reMessage, DeviceSer ser) { |
| | | String bodyMsg = reMessage.getBody().getContent(); |
| | | |
| | | log.info("åæº------>>>å¹³å°ï¼æ¶å°çç²®æ
ä¿¡æ¯-{}-{}-{}", ser.getCompanyId(), |
| | | ser.getName(), reMessage.getStrMsg()); |
| | | // Step1æ ¹æ®éè¦ç®åéè¦çä¿¡æ¯ |
| | | String ua = bodyMsg.substring(0 * 2, 1 * 2); |
| | | log.debug("è·åå°ççµåä¿¡æ¯ï¼ç³»ç»ä¸ä¿ç={}", ua); |
| | | |
| | | // æ»å
æ° |
| | | // int sumPacket = BytesUtil.hexToInt(bodyMsg.substring(1 * 2, 1 * 2 + 1 |
| | | // * 2)); |
| | | // å½åå
|
| | | String hexCurPacket = bodyMsg.substring(2 * 2, 2 * 2 + 1 * 2); |
| | | // int curPacket = BytesUtil.hexToInt(hexCurPacket); |
| | | |
| | | BaseRequest request = new BaseRequest(); |
| | | request.setSerId(ser.getId()); |
| | | request.setCompanyId(ser.getCompanyId()); |
| | | request.setIp(reMessage.getIp()); |
| | | request.setPort(reMessage.getPort()); |
| | | request.setSerName(ser.getName()); |
| | | |
| | | remoteGrainService.reply8817(request, hexCurPacket); |
| | | } |
| | | |
| | | @Transactional |
| | | public void analysis8817(ReMessage msg, DeviceSer ser) { |
| | | // æ¥å°ä¿¡æ¯åå¤--ä¸»æº |
| | | reply8817(msg, ser); |
| | | |
| | | // é¦å
è·åå°ç³»ç»åæ°ï¼å¤ææ¯å¦éè¦æ¹æ¬¡èªå¨ä¼å |
| | | DicSysConf sysConf = commonService.getCacheSysConf(ser.getCompanyId()); |
| | | |
| | | List<ExeRequest> list = exeOrderService.getInProgressOrderBySerId(BizType.GRAIN.getCode(), ser.getId()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | String info = "ç²®æ
è§£æå¤±è´¥:åæº=" + ser.getName() + "没æè·åå°æå±ä»åºä¿¡æ¯ã"; |
| | | log.error("åæº------>>>å¹³å°ï¼" + info); |
| | | notifyGrainInvoker.notifyWeb(ser.getCompanyId(), |
| | | OrderRespEnum.MSG_ERROR, BizType.GRAIN, info); |
| | | return; |
| | | } |
| | | ExeRequest exeRequest = list.get(0); |
| | | log.info("è·åç²®æ
å½ä»¤ä¿¡æ¯={}", exeRequest); |
| | | DepotConf depotConf = commonService.getCacheDepotConf( |
| | | exeRequest.getCompanyId(), exeRequest.getDepotId()); |
| | | if (null == depotConf) { |
| | | String info = "ç²®æ
è§£æå¤±è´¥:åæº=" + ser.getName() + "没æè·åå°ç²®æ
åæ°é
置信æ¯ã"; |
| | | log.error("åæº------>>>å¹³å°ï¼" + info); |
| | | notifyGrainInvoker.notifyWeb(ser.getCompanyId(), |
| | | OrderRespEnum.MSG_ERROR, BizType.GRAIN, info); |
| | | return; |
| | | } |
| | | |
| | | analysisStep(depotConf, msg, ser, exeRequest, sysConf); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¼å§è§£æ |
| | | * |
| | | * @param ser |
| | | * @param msg |
| | | * @throws Exception |
| | | */ |
| | | private void analysisStep(DepotConf depotConf, ReMessage msg, |
| | | DeviceSer ser, ExeRequest exeRequest, DicSysConf sysConf) { |
| | | // ç²®æ
çæ¹æ¬¡å·éæ°æ ¹æ®é¢çè°æ´ |
| | | msg.setBatchId(ContextUtil.getBatchIdByFireq(depotConf.getGrainFreq())); |
| | | |
| | | String bodyMsg = msg.getBody().getContent(); |
| | | |
| | | log.debug("{}-{}=æ¶å°çç²®æ
ä¿¡æ¯={}", ser.getCompanyId(), ser.getName(), |
| | | msg.getStrMsg()); |
| | | |
| | | // Step1æ ¹æ®éè¦ç®åéè¦çä¿¡æ¯ |
| | | String ua = bodyMsg.substring(0 * 2, 1 * 2); |
| | | log.debug("è·åå°ççµåä¿¡æ¯ï¼ç³»ç»ä¸ä¿ç={}", ua); |
| | | |
| | | // æ»å
æ° |
| | | int sumPacket = BytesUtil.hexToInt(bodyMsg.substring(1 * 2, |
| | | 1 * 2 + 1 * 2)); |
| | | // å½åå
|
| | | String hexCurPacket = bodyMsg.substring(2 * 2, 2 * 2 + 1 * 2); |
| | | int curPacket = BytesUtil.hexToInt(hexCurPacket); |
| | | |
| | | log.debug("åæº={},å
æ»æ°={},å½åå
={}", ser.getName(), sumPacket, curPacket); |
| | | |
| | | // ç²®é£æ¸©åº¦ä¿¡æ¯ |
| | | String grainStr = bodyMsg.substring(3 * 2); |
| | | |
| | | String contextKey = this.buildContextKey(msg, depotConf.getDepotId()); |
| | | String curKey = this.buildCurKey(msg, curPacket); |
| | | |
| | | Map<String, String> curMap = contextMap.get(contextKey); |
| | | if (null == curMap) { |
| | | curMap = new HashMap<>(); |
| | | contextMap.put(contextKey, curMap); |
| | | } |
| | | contextMap.get(contextKey).put(curKey, grainStr); |
| | | |
| | | // æ°æ®åå¤å¥½ï¼å¼å§æ§è¡è§£æ |
| | | if (curPacket == sumPacket) { |
| | | analysisStep0(depotConf, msg, ser, exeRequest, contextKey, |
| | | sumPacket, sysConf); |
| | | |
| | | log.info("åæº------>>>å¹³å°ï¼å½ä»¤ç±»å=8817--ç²®æ
å
¨é¨æ¶å°ï¼å¼å§è§£æ-{}-{}", |
| | | ser.getCompanyId(), ser.getName()); |
| | | // æ¸
é¤å½ä»¤ |
| | | commandReSendService.cleanKey(msg.getCompanyId(), msg.getIp(), |
| | | msg.getPort(), ServerUtils.MSG_TYPE_8817); |
| | | } |
| | | } |
| | | |
| | | private void analysisStep0(DepotConf depotConf, ReMessage msg, |
| | | DeviceSer ser, ExeRequest exeRequest, String contextKey, |
| | | int sumPacket, DicSysConf sysConf) { |
| | | |
| | | Map<String, String> curMap = contextMap.get(contextKey); |
| | | |
| | | List<DepotConf> depotConfs = null; |
| | | |
| | | // ä¸åæºå¤ä»ï¼æèµ·å§åæ¾å°æå¤§è¿è¡éé |
| | | if (Constant.YN_Y.equals(sysConf.getGrainMoreTag())) { |
| | | depotConfs = commonService.getCacheDepotConfBySerId2( |
| | | depotConf.getCompanyId(), ser.getId()); |
| | | } |
| | | |
| | | if (null == depotConfs) {// ä¸ä¸ªåæº1ä¸ªä» |
| | | if (DepotType.TYPE_02.getCode().equals(depotConf.getDepotType())) { |
| | | analysisStep2(depotConf, msg, ser, exeRequest, curMap, sumPacket, sysConf); |
| | | } else if (DepotType.TYPE_04.getCode().equals(depotConf.getDepotType())) { |
| | | analysisStep2(depotConf, msg, ser, exeRequest, curMap, sumPacket, sysConf); |
| | | } else { |
| | | analysisStep1(depotConf, msg, ser, exeRequest, curMap, sumPacket, sysConf); |
| | | } |
| | | |
| | | return; |
| | | } |
| | | |
| | | // ä¸åå å¤ä»æ
åµï¼èèåä»ééåå¤ä»éé |
| | | // åä»ééæ¶åæ°æ®ä»0è¿å |
| | | if (StringUtils.isEmpty(exeRequest.getDepotIds())) { |
| | | |
| | | depotConf.setCableEnd(depotConf.getCableEnd() - depotConf.getCableStart() + 1); |
| | | depotConf.setCableStart(ser.getCableStart()); |
| | | |
| | | if (DepotType.TYPE_02.getCode().equals(depotConf.getDepotType())) { |
| | | analysisStep2(depotConf, msg, ser, exeRequest, curMap, sumPacket, sysConf); |
| | | } else if (DepotType.TYPE_04.getCode().equals(depotConf.getDepotType())) { |
| | | analysisStep2(depotConf, msg, ser, exeRequest, curMap, sumPacket, sysConf); |
| | | } else { |
| | | analysisStep1(depotConf, msg, ser, exeRequest, curMap, sumPacket, sysConf); |
| | | } |
| | | |
| | | return; |
| | | |
| | | } |
| | | |
| | | // æ¹éééææå
³èä¸èµ·ééï¼éåæ§è¡ |
| | | for (DepotConf depotConfTemp : depotConfs) { |
| | | if (DepotType.TYPE_02.getCode().equals(depotConfTemp.getDepotType())) { |
| | | analysisStep2(depotConfTemp, msg, ser, exeRequest, curMap, sumPacket, sysConf); |
| | | } else if (DepotType.TYPE_04.getCode().equals(depotConfTemp.getDepotType())) { |
| | | analysisStep2(depotConfTemp, msg, ser, exeRequest, curMap, sumPacket, sysConf); |
| | | } else { |
| | | analysisStep1(depotConfTemp, msg, ser, exeRequest, curMap, sumPacket, sysConf); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åçä»çç²®æ
è§£æ |
| | | * |
| | | * @param depotConf |
| | | * @param msg |
| | | * @param ser |
| | | * @param exeRequest |
| | | * @param packetMap |
| | | * @param sumPackets |
| | | */ |
| | | private void analysisStep2(DepotConf depotConf, ReMessage msg, |
| | | DeviceSer ser, ExeRequest exeRequest, |
| | | Map<String, String> packetMap, int sumPackets, DicSysConf sysConf) { |
| | | if (StringUtils.isEmpty(depotConf.getCableRule()) |
| | | || StringUtils.isEmpty(depotConf.getCableCir())) { |
| | | log.error("åæº------>>>å¹³å°ï¼å½åä»åºï¼{}-{}ï¼æ²¡ææ²¡æé
ç½®å¸çº¿è§åï¼æ æ³è§£æç²®æ
ä¿¡æ¯â¦â¦", |
| | | ser.getCompanyId(), depotConf.getDepotName()); |
| | | return; |
| | | } |
| | | |
| | | String[] cableRuleAtt = depotConf.getCableRule().split("-"); |
| | | String[] cableCirAtt = depotConf.getCableCir().split("-"); |
| | | |
| | | if (cableRuleAtt.length != cableCirAtt.length) { |
| | | log.error("åæº------>>>å¹³å°ï¼å½åä»åºï¼{}-{}ï¼å¸çº¿è§å䏿£ç¡®ï¼æ æ³è§£æç²®æ
ä¿¡æ¯â¦â¦", ser.getCompanyId(), depotConf.getDepotName()); |
| | | return; |
| | | } |
| | | |
| | | |
| | | //é¿å
空æé |
| | | if (null == depotConf.getCableCone()) depotConf.setCableCone(Constant.CABLE_CONE_0); |
| | | |
| | | // è·åæå¤§çå±é
ç½®--é»è®¤æ¯ä¸åé½ä¸æ · |
| | | int layMax = Integer.valueOf(cableCirAtt[0]); |
| | | for (int i = 0; i < cableCirAtt.length; i++) { |
| | | if (Integer.valueOf(cableCirAtt[i]) >= layMax) layMax = Integer.valueOf(cableCirAtt[i]); |
| | | } |
| | | |
| | | // è·å宿´çç²®æ
å
ä¿¡æ¯ |
| | | String strPoints = ""; |
| | | for (int i = 1; i <= sumPackets; i++) { |
| | | strPoints += packetMap.get(buildCurKey(msg, i)); |
| | | } |
| | | |
| | | log.info("------çä»å®æ´çç²®æ
æ¥æ={}------", strPoints); |
| | | |
| | | int sumNum = 0, cableZ = 1;// sumNum å
±å¤å°æ ¹çµç¼ï¼cableZ å±çæå¤§å¼ï¼é¥å½¢ä»è¡¥é½æå¤§å± |
| | | for (int i = 0; i < cableCirAtt.length; i++) { |
| | | if (Integer.valueOf(cableCirAtt[i]) > cableZ) { |
| | | cableZ = Integer.valueOf(cableCirAtt[i]); |
| | | } |
| | | sumNum += Integer.valueOf(cableRuleAtt[i]); |
| | | } |
| | | |
| | | // æ ¹æ®å±è¡åè·åæå®é¿åº¦ |
| | | int start = 4 * (depotConf.getCableStart() - ser.getCableStart()) * cableZ; |
| | | int len = 4 * cableZ * sumNum; |
| | | |
| | | strPoints = strPoints.substring(start, start + len); |
| | | log.info("åæº------>>>å¹³å°ï¼è¿åç²®æ
宿´ä¿¡æ¯ï¼æå±ç»ç»={}ï¼åæº={}", ser.getCompanyId(), ser.getName()); |
| | | |
| | | // å°ç²®æ
è§£æææ°ç» |
| | | List<Double> temps = new ArrayList<>(); |
| | | double tempValue; |
| | | String temp; |
| | | int curLay = 1;//æå¨å±ä»1å¼å§ |
| | | int curRoot = 1;//æå¨æ ¹ |
| | | int curCir = 1;//æå¨å |
| | | int cirLay = 1;//å½ååçå± |
| | | for (int i = 0; i < strPoints.length() / 4; i++) { |
| | | temp = strPoints.substring(i * 4, i * 4 + 4); |
| | | if (temp == null) { |
| | | temp = "0000"; |
| | | } |
| | | tempValue = BytesUtil.hexToInt(BytesUtil.tran_LH(temp)) / 10.0; |
| | | |
| | | //éæ£å¸¸å¼ |
| | | if (tempValue > ERROR_CHECK_TAG2) { |
| | | tempValue = Constant.ERROR_TEMP; |
| | | } |
| | | |
| | | // æ
éå¼å¤ç |
| | | if (tempValue >= FAULT_CHECK_TAG) { |
| | | tempValue = Constant.FAULT_TEMP; |
| | | } |
| | | |
| | | // å¤ç¨å¼ |
| | | if (tempValue == ERROR_CHECK_TAG) { |
| | | tempValue = Constant.ERROR_TEMP; |
| | | |
| | | |
| | | //éªè¯æ¯ä¸æ¯é¥å½¢ä»è¡¥å¿å¼ |
| | | curLay = (i % layMax) + 1; |
| | | curRoot = (i / layMax) + 1; |
| | | curCir = getCurCir(curRoot, cableRuleAtt); |
| | | |
| | | cirLay = Integer.valueOf(cableCirAtt[curCir - 1]); |
| | | |
| | | //æ¯å¦é
ç½®äº5å±ä½æ¯å½åæ¯6å±ï¼è¯´æå½åç¹ä¸ºè¡¥å¿ç¹ |
| | | if (curLay > cirLay) { |
| | | tempValue = Constant.ADD_TEMP; |
| | | |
| | | //夿æ¯ä¸æ¯ä¸é¥å½¢ï¼å°è¡¥ç¹è½¬ç§»å°ä¸æ¹ |
| | | if (Constant.CABLE_CONE_1.equals(depotConf.getCableCone())) { |
| | | int index = i - curLay - 1; |
| | | temps.add(index, tempValue); |
| | | }else { |
| | | temps.add(tempValue); |
| | | } |
| | | |
| | | } else { |
| | | temps.add(tempValue); |
| | | } |
| | | |
| | | } else { |
| | | temps.add(tempValue); |
| | | } |
| | | } |
| | | |
| | | log.debug("-------CheckGrainRequest--={}", exeRequest.toString()); |
| | | THDto thDto = thService.getCacheTH(exeRequest.getCompanyId(), exeRequest.getTempSerId(), exeRequest.getThConf()); |
| | | if (null != thDto) { |
| | | log.debug("-------THDto--={}", thDto.toString()); |
| | | } |
| | | |
| | | // å°éåè§£ææåæ æ°æ® |
| | | addPoint2(temps, msg, depotConf, exeRequest, thDto, sysConf); |
| | | } |
| | | |
| | | /** |
| | | * è·åå½åè·æå¨å |
| | | * |
| | | * @param curRoot |
| | | * @param cableRuleAtt |
| | | * @return |
| | | */ |
| | | private int getCurCir(int curRoot, String[] cableRuleAtt) { |
| | | |
| | | int sum = 0; |
| | | for (int i = 0; i < cableRuleAtt.length; i++) { |
| | | sum += Integer.valueOf(cableRuleAtt[i]); |
| | | if (curRoot <= sum) return i + 1; |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * å¹³æ¹ä»çè§£æï¼è§£æéè¦èèå½åæ¯å¦å¯ç¨çä¸åæºå¤ä» |
| | | * |
| | | * @param depotConf |
| | | * @param msg |
| | | * @param ser |
| | | * @param exeRequest |
| | | * @param packetMap |
| | | * @param sumPackets |
| | | */ |
| | | private void analysisStep1(DepotConf depotConf, ReMessage msg, |
| | | DeviceSer ser, ExeRequest exeRequest, |
| | | Map<String, String> packetMap, int sumPackets, DicSysConf sysConf) { |
| | | // è·å宿´çç²®æ
å
ä¿¡æ¯ |
| | | String strPoints = ""; |
| | | for (int i = 1; i <= sumPackets; i++) { |
| | | strPoints += packetMap.get(buildCurKey(msg, i)); |
| | | } |
| | | String[] attCable = depotConf.getCableRule().split("-"); |
| | | int cableZ = Integer.valueOf(attCable[0]); |
| | | int cableY = Integer.valueOf(attCable[1]); |
| | | int cableX = Integer.valueOf(attCable[2]); |
| | | |
| | | // æ ¹æ®å±è¡åè·åæå®é¿åº¦ |
| | | int start = 4 * (depotConf.getCableStart() - ser.getCableStart()) |
| | | * cableZ * cableY; |
| | | int len = 4 * cableZ * cableY * cableX; |
| | | |
| | | log.info("åæº------>>>å¹³å°ï¼è¿åç²®æ
宿´ä¿¡æ¯ï¼æå±ç»ç»={}ï¼åæº={}", ser.getCompanyId(), ser.getName()); |
| | | |
| | | strPoints = strPoints.substring(start, start + len); |
| | | |
| | | // å°ç²®æ
è§£æææ°ç» |
| | | List<Double> temps = new ArrayList<>(); |
| | | double tempValue; |
| | | String temp; |
| | | for (int i = 0; i < strPoints.length() / 4; i++) { |
| | | temp = strPoints.substring(i * 4, i * 4 + 4); |
| | | if (temp == null) { |
| | | temp = "0000"; |
| | | } |
| | | tempValue = BytesUtil.hexToInt(BytesUtil.tran_LH(temp)) / 10.0; |
| | | // 说æè§£æçæ°æ®æé®é¢ |
| | | if (tempValue == ERROR_CHECK_TAG || tempValue == ERROR_CHECK_TAG2) { |
| | | tempValue = Constant.ERROR_TEMP; |
| | | } |
| | | // æ
éå¼å¤ç |
| | | if (tempValue >= FAULT_CHECK_TAG) { |
| | | tempValue = Constant.FAULT_TEMP; |
| | | } |
| | | temps.add(tempValue); |
| | | } |
| | | |
| | | log.debug("-------CheckGrainRequest--={}", exeRequest.toString()); |
| | | THDto thDto = thService.getCacheTH(exeRequest.getCompanyId(), |
| | | exeRequest.getTempSerId(), exeRequest.getThConf()); |
| | | if (null != thDto) { |
| | | log.debug("-------THDto--={}", thDto.toString()); |
| | | } |
| | | // å°éåè§£ææåæ æ°æ® |
| | | addPoint1(temps, msg, depotConf, ser, exeRequest, thDto, sysConf); |
| | | } |
| | | |
| | | private String buildCurKey(ReMessage msg, int curPacket) { |
| | | return msg.getSourceId() + "_" + curPacket; |
| | | } |
| | | |
| | | private String buildContextKey(ReMessage msg, String depotId) { |
| | | return msg.getCompanyId() + "_" + msg.getSourceId() + "_" + depotId; |
| | | } |
| | | |
| | | /** |
| | | * å¹³æ¿ä»ï¼è§£æç¬¬äºæ¥ï¼è§£æå°åæ æ°æ® |
| | | * |
| | | * @param temps |
| | | * @throws Exception |
| | | */ |
| | | private void addPoint1(List<Double> temps, ReMessage msg, |
| | | DepotConf depotConf, DeviceSer ser, ExeRequest exeRequest, |
| | | THDto thDto, DicSysConf sysConf) { |
| | | |
| | | //æ ¹æ®çµç¼èµ·å§æ¹ä½åå¸çº¿æ¹åï¼å¯¹ç²®æ
æ°æ®è¿è¡è°æ´ |
| | | if (null != depotConf.getStartOrientation()) { |
| | | temps = reversalGrainPoint(temps, depotConf); |
| | | } |
| | | |
| | | //è¥èµ·ç¹ç¹ä½ä¸ºåºé¨ï¼åå°ç²®æ
æ°æ®è¿è¡ç¿»è½¬ |
| | | if (null != depotConf.getStartPoint() |
| | | && Constant.GRAIN_START_POINT_BELOW.equals(depotConf.getStartPoint())) { |
| | | temps = grainUtil.reversalUpAndDown(temps, depotConf.getCableRule()); |
| | | } |
| | | |
| | | //è¥é
ç½®å±è¡è½¬æ¢ï¼åå°ç²®æ
æ°æ®è¿è¡å±è¡è½¬æ¢ |
| | | if (StringUtils.isNotEmpty(depotConf.getStartConvert())) { |
| | | temps = convertGrainPoint(temps, depotConf); |
| | | String[] cableRule = depotConf.getCableRule().split("-"); |
| | | //转æ¢å±è¡åé
ç½® |
| | | if(Constant.GRAIN_CONVERT_CLOCKWISE.equals(depotConf.getStartConvert()) |
| | | || Constant.GRAIN_CONVERT_ANTICLOCKWISE.equals(depotConf.getStartConvert())){ |
| | | depotConf.setCableRule(Integer.valueOf(cableRule[1]) + "-" + Integer.valueOf(cableRule[0]) + "-" + Integer.valueOf(cableRule[2])); |
| | | } |
| | | } |
| | | |
| | | String[] attCable = depotConf.getCableRule().split("-"); |
| | | int cableZ = Integer.valueOf(attCable[0]); |
| | | int cableY = Integer.valueOf(attCable[1]); |
| | | int cableX = Integer.valueOf(attCable[2]); |
| | | |
| | | Grain grain = new Grain(); |
| | | grain.setDepotId(depotConf.getDepotId()); |
| | | grain.setCompanyId(depotConf.getCompanyId()); |
| | | grain.setCable(depotConf.getCableRule()); |
| | | grain.setBatchId(msg.getBatchId()); |
| | | grain.setTempIn(Constant.ERROR_TEMP); |
| | | grain.setHumidityIn(Constant.ERROR_TEMP); |
| | | |
| | | if (null != thDto) { |
| | | log.debug("ç²®æ
è§£æä¸è·åå°ç温湿度信æ¯={}", thDto.toString()); |
| | | grain.setHumidityIn(thDto.getHumidityIn()); |
| | | grain.setTempIn(thDto.getTempIn()); |
| | | } |
| | | grain.setReceiveDate(msg.getReceiveDate()); |
| | | grain.setRemark("粮温æ£å¸¸"); |
| | | |
| | | // è·åç¼åä¸çå½ä»¤ä¿¡æ¯ |
| | | grain.setCheckUser(exeRequest.getExeUser()); |
| | | |
| | | double max = MAX_TEMP, min = MIN_TEMP, sumT = 0.0, sumNum = cableX |
| | | * cableY * cableZ; |
| | | |
| | | // æ ¡éªåå®ç°ç»è®¡ï¼çæééç¹ä¿¡æ¯ |
| | | List<GrainItemInfo> listGrainItems = new ArrayList<>(); |
| | | int i = 1; |
| | | for (Double temp : temps) { |
| | | if (temp == Constant.ERROR_TEMP || temp == Constant.FAULT_TEMP || temp == Constant.ADD_TEMP) { |
| | | sumNum--; |
| | | } else { |
| | | sumT += temp; |
| | | if (temp > max) { |
| | | max = temp; |
| | | } |
| | | if (temp < min) { |
| | | min = temp; |
| | | } |
| | | } |
| | | listGrainItems.add(new GrainItemInfo(i, temp)); |
| | | i++; |
| | | } |
| | | |
| | | if (sumNum == 0) { |
| | | sumNum = 1; |
| | | grain.setRemark("å½åç²®æ
ééå¼å¸¸"); |
| | | } |
| | | //è¿æ»¤æ¯è¾ç¨çæå¤§æå°å¼ |
| | | if(max == MAX_TEMP){ |
| | | max = 0.0; |
| | | } |
| | | if(min == MIN_TEMP){ |
| | | min = 0.0; |
| | | } |
| | | if (null != depotConf.getTempMax() && max > depotConf.getTempMax()) { |
| | | grain.setRemark("ä»åºé
ç½®é«æ¸©è¦åå¼ï¼" + depotConf.getTempMax() + "ï¼å½åæ£æµé«æ¸©å¼ï¼" |
| | | + max); |
| | | warnUtils.addGrainWarn(depotConf, grain); |
| | | } |
| | | |
| | | grain.setTempAve(sumT / sumNum); |
| | | grain.setTempMax(max); |
| | | grain.setTempMin(min); |
| | | grain.setPoints(StringUtils.join(temps, ",")); |
| | | |
| | | String depotIds = exeRequest.getDepotIds(); |
| | | |
| | | boolean notifyWeb = true; |
| | | if (null != depotIds && depotIds.indexOf(depotConf.getDepotId()) == -1) { |
| | | notifyWeb = false; |
| | | } |
| | | // ç¨æ·å°è£
å¥½æ°æ®å³å¯ |
| | | notifyGrainInvoker.analysisSuccess(grain, listGrainItems, depotConf, |
| | | sysConf, notifyWeb, exeRequest); |
| | | } |
| | | |
| | | /** |
| | | * åçä»è§£ææ¥éª¤ |
| | | * |
| | | * @param temps |
| | | * @param msg |
| | | * @param depotConf |
| | | * @param exeRequest |
| | | * @param thDto |
| | | */ |
| | | private void addPoint2(List<Double> temps, ReMessage msg, |
| | | DepotConf depotConf, ExeRequest exeRequest, THDto thDto, |
| | | DicSysConf sysConf) { |
| | | |
| | | Grain grain = new Grain(); |
| | | grain.setDepotId(depotConf.getDepotId()); |
| | | grain.setCompanyId(depotConf.getCompanyId()); |
| | | grain.setCable(depotConf.getCableRule()); |
| | | grain.setCableCir(depotConf.getCableCir()); |
| | | grain.setBatchId(msg.getBatchId()); |
| | | grain.setTempIn(Constant.ERROR_TEMP); |
| | | grain.setHumidityIn(Constant.ERROR_TEMP); |
| | | if (null != thDto) { |
| | | log.debug("ç²®æ
è§£æä¸è·åå°ç温湿度信æ¯={}", thDto.toString()); |
| | | grain.setHumidityIn(thDto.getHumidityIn()); |
| | | grain.setTempIn(thDto.getTempIn()); |
| | | } |
| | | grain.setReceiveDate(msg.getReceiveDate()); |
| | | grain.setRemark("粮温æ£å¸¸"); |
| | | grain.setCheckUser(exeRequest.getExeUser()); |
| | | |
| | | double max = MAX_TEMP, min = MIN_TEMP, sumT = 0.0; |
| | | |
| | | int sumNum = temps.size(); |
| | | List<GrainItemInfo> listGrainItems = new ArrayList<>(); |
| | | int i = 1; |
| | | for (Double temp : temps) { |
| | | if (temp == Constant.ERROR_TEMP || temp == Constant.FAULT_TEMP || temp == Constant.ADD_TEMP) { |
| | | sumNum--; |
| | | } else { |
| | | sumT += temp; |
| | | if (temp > max) { |
| | | max = temp; |
| | | } |
| | | if (temp < min) { |
| | | min = temp; |
| | | } |
| | | } |
| | | listGrainItems.add(new GrainItemInfo(i, temp)); |
| | | i++; |
| | | } |
| | | |
| | | if (sumNum == 0) { |
| | | sumNum = 1; |
| | | grain.setRemark("å½åç²®æ
ééå¼å¸¸"); |
| | | } |
| | | //è¿æ»¤æ¯è¾ç¨çæå¤§æå°å¼ |
| | | if(max == MAX_TEMP){ |
| | | max = 0.0; |
| | | } |
| | | if(min == MIN_TEMP){ |
| | | min = 0.0; |
| | | } |
| | | if (null != depotConf.getTempMax() && max > depotConf.getTempMax()) { |
| | | grain.setRemark("ä»åºé
ç½®é«æ¸©è¦åå¼ï¼" + depotConf.getTempMax() + "ï¼å½åæ£æµé«æ¸©å¼ï¼" |
| | | + max); |
| | | warnUtils.addGrainWarn(depotConf, grain); |
| | | } |
| | | |
| | | grain.setTempAve(sumT / sumNum); |
| | | grain.setTempMax(max); |
| | | grain.setTempMin(min); |
| | | grain.setPoints(StringUtils.join(temps, ",")); |
| | | |
| | | String depotIds = exeRequest.getDepotIds(); |
| | | boolean notifyWeb = true; |
| | | if (null != depotIds && depotIds.indexOf(depotConf.getDepotId()) == -1) { |
| | | notifyWeb = false; |
| | | } |
| | | |
| | | // ç¨æ·å°è£
å¥½æ°æ®å³å¯ |
| | | notifyGrainInvoker.analysisSuccess(grain, listGrainItems, depotConf, |
| | | sysConf, notifyWeb, exeRequest); |
| | | } |
| | | |
| | | private List<Double> convertGrainPoint(List<Double> temps, DepotConf conf) { |
| | | if (Constant.GRAIN_CONVERT_DEFAULT.equals(conf.getStartConvert())) { |
| | | //è¥å±è¡è½¬æ¢ä¸ºé»è®¤ï¼åç´æ¥è¿å |
| | | return temps; |
| | | } |
| | | |
| | | //顺æ¶éè½¬æ¢ |
| | | if(Constant.GRAIN_CONVERT_CLOCKWISE.equals(conf.getStartConvert())){ |
| | | return grainUtil.convertRight(temps, conf.getCableRule()); |
| | | } |
| | | //éæ¶éè½¬æ¢ |
| | | if(Constant.GRAIN_CONVERT_ANTICLOCKWISE.equals(conf.getStartConvert())){ |
| | | return grainUtil.convertLeft(temps, conf.getCableRule()); |
| | | } |
| | | |
| | | return temps; |
| | | } |
| | | |
| | | private List<Double> reversalGrainPoint(List<Double> temps, DepotConf conf) { |
| | | if (StringUtils.isEmpty(conf.getStartOrientation())) { |
| | | //è¥èµ·å§æ¹ä½ä¸ºç©ºï¼åé»è®¤èµ·å§æ¹ä½åæ¹åï¼ç´æ¥è¿å |
| | | return temps; |
| | | } |
| | | //èµ·å§æ¹ä½ä¸ºå³è¾¹æ¶ |
| | | if (Constant.GRAIN_START_ORIENTATION_RIGHT.equals(conf.getStartOrientation())) { |
| | | if (StringUtils.isEmpty(conf.getStartDirection())) { |
| | | //å³è¾¹èµ·å§ï¼é»è®¤çºµåå¸çº¿ï¼ç´æ¥è¿å |
| | | return temps; |
| | | } |
| | | if (Constant.GRAIN_START_DIRECTION_TRANSVERSE.equals(conf.getStartDirection())) { |
| | | //å³è¾¹èµ·å§ï¼æ¨ªåå¸çº¿ |
| | | return grainUtil.reversalRight1(temps, conf.getCableRule()); |
| | | } |
| | | //å³è¾¹èµ·å§ï¼é»è®¤çºµåå¸çº¿ï¼ç´æ¥è¿å |
| | | return temps; |
| | | } |
| | | //èµ·å§æ¹ä½ä¸ºå³ä¸æ¶ |
| | | if (Constant.GRAIN_START_ORIENTATION_RIGHT_UP.equals(conf.getStartOrientation())) { |
| | | if (StringUtils.isEmpty(conf.getStartDirection())) { |
| | | //å³ä¸èµ·å§ï¼é»è®¤çºµåå¸çº¿ |
| | | return grainUtil.reversalRightUp2(temps, conf.getCableRule()); |
| | | } |
| | | if (Constant.GRAIN_START_DIRECTION_TRANSVERSE.equals(conf.getStartDirection())) { |
| | | //å³ä¸èµ·å§ï¼æ¨ªåå¸çº¿ |
| | | return grainUtil.reversalRightUp1(temps, conf.getCableRule()); |
| | | } |
| | | //å³ä¸èµ·å§ï¼é»è®¤çºµåå¸çº¿ |
| | | return grainUtil.reversalRightUp2(temps, conf.getCableRule()); |
| | | } |
| | | //èµ·å§æ¹ä½ä¸ºå·¦è¾¹æ¶ |
| | | if (Constant.GRAIN_START_ORIENTATION_LEFT.equals(conf.getStartOrientation())) { |
| | | if (StringUtils.isEmpty(conf.getStartDirection())) { |
| | | //左边起å§ï¼é»è®¤çºµåå¸çº¿ |
| | | return grainUtil.reversalLeft2(temps, conf.getCableRule()); |
| | | } |
| | | if (Constant.GRAIN_START_DIRECTION_TRANSVERSE.equals(conf.getStartDirection())) { |
| | | //左边起å§ï¼æ¨ªåå¸çº¿ |
| | | return grainUtil.reversalLeft1(temps, conf.getCableRule()); |
| | | } |
| | | //左边起å§ï¼é»è®¤çºµåå¸çº¿ |
| | | return grainUtil.reversalLeft2(temps, conf.getCableRule()); |
| | | } |
| | | //èµ·å§æ¹ä½ä¸ºå·¦ä¸æ¶ |
| | | if (Constant.GRAIN_START_ORIENTATION_LEFT_UP.equals(conf.getStartOrientation())) { |
| | | if (StringUtils.isEmpty(conf.getStartDirection())) { |
| | | //å·¦ä¸èµ·å§ï¼é»è®¤çºµåå¸çº¿ |
| | | return grainUtil.reversalLeftUp2(temps, conf.getCableRule()); |
| | | } |
| | | if (Constant.GRAIN_START_DIRECTION_TRANSVERSE.equals(conf.getStartDirection())) { |
| | | //å·¦ä¸èµ·å§ï¼æ¨ªåå¸çº¿ |
| | | return grainUtil.reversalLeftUp1(temps, conf.getCableRule()); |
| | | } |
| | | //å·¦ä¸èµ·å§ï¼é»è®¤çºµåå¸çº¿ |
| | | return grainUtil.reversalLeftUp2(temps, conf.getCableRule()); |
| | | } |
| | | |
| | | return temps; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.analysis; |
| | | |
| | | import com.ld.igds.common.CoreSerService; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.io.constant.OrderRespEnum; |
| | | import com.ld.igds.io.notify.NotifyWebInvoker; |
| | | import com.ld.igds.models.DeviceSer; |
| | | import com.ld.igds.order.ExeOrderService; |
| | | import com.ld.igds.order.data.ExeRequest; |
| | | import com.ld.igds.protocol.zldz.analysis.builder.ReMessageBuilder; |
| | | import com.ld.igds.protocol.zldz.analysis.message.ReMessage; |
| | | import com.ld.igds.protocol.zldz.task.CommandReSendService; |
| | | import com.ld.igds.protocol.zldz.util.CRC8; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å议解æå
¥å£ |
| | | * |
| | | * @author jiazx |
| | | */ |
| | | @Slf4j |
| | | @Component(AnalysisService.BEAN_ID) |
| | | public class AnalysisService { |
| | | |
| | | public static final String BEAN_ID = "zldz.analysisService"; |
| | | |
| | | @Autowired |
| | | private CoreSerService coreSerService; |
| | | @Autowired |
| | | private AnalysisTH analysisTH; |
| | | @Autowired |
| | | private AnalysisGrain analysisGrain; |
| | | @Autowired |
| | | private AnalysisConf analysisConf; |
| | | @Autowired |
| | | private NotifyWebInvoker notifyWebInvoker; |
| | | @Autowired |
| | | private ExeOrderService exeOrderService; |
| | | @Autowired |
| | | private CommandReSendService commandReSendService; |
| | | |
| | | |
| | | /** |
| | | * @param sessionKey ip:port |
| | | * @param strMsg |
| | | */ |
| | | public void analysis2(String sessionKey, String strMsg) { |
| | | String[] attr = sessionKey.split(":"); |
| | | String ip = attr[0]; |
| | | Integer port = Integer.valueOf(attr[1]); |
| | | |
| | | ReMessage reMessage = ReMessageBuilder.getInstance().buildMessage(null, ip, port, strMsg); |
| | | |
| | | if (null == reMessage || null == reMessage.getCompanyId()) { |
| | | log.error("åæº----->>>å¹³å°ï¼è¿åä¿¡æ¯æ²¡æè·åç»ç»ç¼ç ä¿¡æ¯ï¼æ æ³ç»§ç»è§£æ----{}", sessionKey); |
| | | return; |
| | | } |
| | | |
| | | DeviceSer ser = coreSerService.getCacheSer(reMessage.getCompanyId(), reMessage.getSourceId()); |
| | | |
| | | if (null == ser) { |
| | | String info = "åæº=" + reMessage.getSourceId() + "è¿åä¿¡æ¯æ²¡æå¹é
å°åæºï¼ç³»ç»è¸¢åºç¦»çº¿ã"; |
| | | log.error("åæº----->>>å¹³å°ï¼" + info); |
| | | notifyWebInvoker.notifyWeb(reMessage.getCompanyId(), OrderRespEnum.MSG_ERROR, BizType.SYS, info); |
| | | |
| | | // æ¸
é¤ç¼å并鿝龿¥ |
| | | commandReSendService.destoryAndDelCache(reMessage.getCompanyId(), ip, port, reMessage.getMessageType()); |
| | | return; |
| | | } |
| | | |
| | | log.debug("åæº----->>>å¹³å°ï¼æå±ç»ç»-{}ï¼åæº-{} è¿åçå½ä»¤ä¿¡æ¯={}", ser.getCompanyId(), ser.getName(), reMessage.toString()); |
| | | |
| | | String checkMsg = this.checkMsg(reMessage, ser); |
| | | if (null != checkMsg) { |
| | | // ç³»ç»æ¦æªå°äºå¼å¸¸åå ï¼ä¸è¸¢åºè¿æ¥ |
| | | if (ServerUtils.MSG_TYPE_8815.equals(reMessage.getMessageType()) || ServerUtils.MSG_TYPE_8817.equals(reMessage.getMessageType())) { |
| | | commandReSendService.cleanKey(ser.getCompanyId(), ser.getIp(), ser.getPort(), ServerUtils.MSG_TYPE_8817); |
| | | |
| | | List<ExeRequest> list = exeOrderService.getInProgressOrderBySerId(BizType.GRAIN.getCode(), ser.getId()); |
| | | |
| | | if (null != list && list.size() > 0) { |
| | | exeOrderService.progressError(ser.getCompanyId(), BizType.GRAIN.getCode(), list.get(0).getDepotId(), checkMsg); |
| | | } else { |
| | | notifyWebInvoker.notifyWeb(ser.getCompanyId(), OrderRespEnum.MSG_ERROR, BizType.SYS, checkMsg); |
| | | } |
| | | } else { |
| | | commandReSendService.cleanKey(ser.getCompanyId(), ser.getIp(), ser.getPort(), reMessage.getMessageType()); |
| | | |
| | | notifyWebInvoker.notifyWeb(ser.getCompanyId(), OrderRespEnum.MSG_ERROR, BizType.SYS, checkMsg); |
| | | } |
| | | |
| | | log.error("åæº----->>>å¹³å°ï¼å½ä»¤éªè¯å¼å¸¸ï¼æå±ç»ç»-{}ï¼å¼å¸¸ä¿¡æ¯-{}ï¼æ¥æä¿¡æ¯-{}", ser.getCompanyId(), checkMsg, reMessage.getStrMsg()); |
| | | return; |
| | | } |
| | | |
| | | switch (reMessage.getMessageType()) { |
| | | case ServerUtils.MSG_TYPE_8828:// 温湿度解æ |
| | | analysisTH.analysis8828(reMessage, ser); |
| | | break; |
| | | |
| | | case ServerUtils.MSG_TYPE_8815:// ç»ç«¯åºçç²®æ
è¯·æ± |
| | | analysisGrain.analysis8815(reMessage, ser); |
| | | break; |
| | | |
| | | case ServerUtils.MSG_TYPE_1117:// ç²®æ
æ°æ®ä¿¡æ¯ |
| | | analysisGrain.analysis8817(reMessage, ser); |
| | | break; |
| | | |
| | | |
| | | case ServerUtils.MSG_TYPE_1129:// ç»ç«¯åéééçµç¼æ°æ®ç»åå° |
| | | analysisConf.analysis1129(reMessage, ser); |
| | | break; |
| | | |
| | | case ServerUtils.MSG_TYPE_8816:// è§£æé
ç½® |
| | | analysisConf.analysis8816(reMessage, ser); |
| | | break; |
| | | |
| | | case ServerUtils.MSG_TYPE_8822:// çµç¼åå§åæå |
| | | analysisConf.analysis8822(reMessage, ser); |
| | | break; |
| | | |
| | | case ServerUtils.MSG_TYPE_8823:// çµç¼æ±æ»åºç |
| | | analysisConf.analysis8823(reMessage, ser); |
| | | break; |
| | | |
| | | case ServerUtils.MSG_TYPE_8825:// 读åééçµç¼é
ç½® |
| | | analysisConf.analysis8825(reMessage, ser); |
| | | break; |
| | | |
| | | case ServerUtils.MSG_TYPE_8826:// ä¿®æ¹çµç¼çè¿å |
| | | analysisConf.analysis8826(reMessage, ser); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªï¼æ£å¸¸è¿åNULLï¼å¼å¸¸è¿åå¼å¸¸åå ï¼æ£å¸¸å¼å¸¸åå è¿åä¸è¸¢æéæ°è¿æ¥ |
| | | * |
| | | * @param message |
| | | * @param ser |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | private String checkMsg(ReMessage message, DeviceSer ser) { |
| | | String result; |
| | | if (message.getResult() == 1) { |
| | | result = "åæº=" + ser.getName() + " å议解æå¤±è´¥ï¼åå ï¼æ¥æ¶çåºçæ ¡éªå¼å¸¸"; |
| | | return result; |
| | | } |
| | | if (message.getResult() == 2) { |
| | | result = "åæº=" + ser.getName() + " å议解æå¤±è´¥ï¼åå ï¼åéçæ°æ®æ ¡éªå¼å¸¸"; |
| | | return result; |
| | | } |
| | | if (message.getResult() == 3) { |
| | | result = "åæº=" + ser.getName() + " å议解æå¤±è´¥ï¼åå ï¼æéä¸"; |
| | | return result; |
| | | } |
| | | if (message.getResult() == 4) { |
| | | result = "åæº=" + ser.getName() + " å议解æå¤±è´¥ï¼åå ï¼åéè¶
æ¶é误"; |
| | | return result; |
| | | } |
| | | if (message.getResult() == 9) { |
| | | result = "åæº=" + ser.getName() + " å议解æå¤±è´¥ï¼åå ï¼Io模åä¸å¨çº¿"; |
| | | return result; |
| | | } |
| | | if (message.getResult() == 10) { |
| | | result = "åæº=" + ser.getName() + " å议解æå¤±è´¥ï¼åå ï¼åéä¸"; |
| | | return result; |
| | | } |
| | | if (message.getResult() == 11) { |
| | | result = "åæº=" + ser.getName() + " å议解æå¤±è´¥ï¼åå ï¼æ 线模åæ
é"; |
| | | return result; |
| | | } |
| | | if (message.getResult() == 12) { |
| | | result = "åæº=" + ser.getName() |
| | | + " å议解æå¤±è´¥ï¼åå ï¼ä¸»è¦æ¯åé¦åæ ç¹äº¤æ¢å½ä»¤æè
æ¯çµç¼ä¿®æ¹å½ä»¤çéè¯¯ï¼æè
ç²®æ
ééçåæ°ä¸å¯¹"; |
| | | return result; |
| | | } |
| | | if (message.getResult() == 13) { |
| | | result = "åæº=" + ser.getName() + " å议解æå¤±è´¥ï¼åå ï¼ç½å
³æªæ³¨å"; |
| | | return result; |
| | | } |
| | | |
| | | // è·åæ ¡éªçæ¥æä¿¡æ¯ |
| | | int end = 4 + 18 * 2 + message.getBody().getLength() * 2; |
| | | String checkStr = message.getStrMsg().substring(4, end); |
| | | |
| | | byte[] byteCrc16 = BytesUtil.hexStrToBytes(checkStr); |
| | | short crc16Hex2 = CRC8.calculateCrc16(byteCrc16, (short) 0, |
| | | (short) (byteCrc16.length)); |
| | | byte[] crc16Hex2Bytes = BytesUtil.shortToByte(crc16Hex2); |
| | | int crc16 = BytesUtil.bytesToInt(crc16Hex2Bytes); |
| | | String hexCrc16 = BytesUtil.intToHexStr(crc16); |
| | | |
| | | if (message.getHexCrc16().equals(hexCrc16)) { |
| | | return null; |
| | | } else { |
| | | result = "åæº=" + ser.getName() + " å议解æå¤±è´¥ï¼åå ï¼CRC16æ ¡éªå¼å¸¸"; |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.analysis; |
| | | |
| | | import com.ld.igds.common.dto.THDto; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.constant.Constant; |
| | | import com.ld.igds.io.notify.NotifyWebInvoker; |
| | | import com.ld.igds.io.constant.OrderRespEnum; |
| | | import com.ld.igds.models.DeviceSer; |
| | | import com.ld.igds.order.ExeOrderService; |
| | | import com.ld.igds.order.data.ExeRequest; |
| | | import com.ld.igds.protocol.zldz.analysis.message.ReMessage; |
| | | import com.ld.igds.th.CoreThService; |
| | | import com.ld.igds.util.BytesUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * è§£ææ¸©æ¹¿åº¦ä¿¡æ¯ |
| | | * |
| | | * @author Andy |
| | | */ |
| | | @Slf4j |
| | | @Component(AnalysisTH.BEAN_ID) |
| | | public class AnalysisTH { |
| | | |
| | | public static final String BEAN_ID = "zldz.analysisTH"; |
| | | |
| | | @Autowired |
| | | private CoreThService thService; |
| | | |
| | | @Autowired |
| | | private NotifyWebInvoker notifyWebInvoker; |
| | | |
| | | @Autowired |
| | | private ExeOrderService exeOrderService; |
| | | |
| | | public static int ERROR_TH_TAG = -50; |
| | | |
| | | /** |
| | | * è§£æä»åºæ¸©æ¹¿åº¦ä¿¡æ¯ï¼å°ä¿¡æ¯æ¾å¨ç¼åä¸ï¼ä»¥ä¾¿ç²®æ
ä½¿ç¨ |
| | | * |
| | | * @param msg |
| | | * @param ser |
| | | */ |
| | | public void analysis8828(ReMessage msg, DeviceSer ser) { |
| | | |
| | | log.debug("-----------analysis8828------------{}-{}.{}", ser.getCompanyId(), ser.getIp(), ser.getPort()); |
| | | |
| | | String content = msg.getBody().getContent(); |
| | | |
| | | //温湿度å°å,æªå4ä½ |
| | | String temp = content.substring(0, 0 + 2 * 2); |
| | | //é«ä½ä½è½¬æ¢ |
| | | temp = BytesUtil.tran_LH(temp); |
| | | int thConf = BytesUtil.hexToInt(temp); |
| | | |
| | | List<ExeRequest> list = exeOrderService.getInProgressOrderBySerId(BizType.SYS.getCode(), ser.getId() + "_" + thConf); |
| | | ExeRequest exeRequest = list.get(0); |
| | | |
| | | int t, h; |
| | | |
| | | THDto th = new THDto(); |
| | | th.setCompanyId(ser.getCompanyId()); |
| | | th.setTempIn(Constant.ERROR_TEMP); |
| | | th.setHumidityIn(Constant.ERROR_TEMP); |
| | | |
| | | //温度 |
| | | int start = 2, len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | t = BytesUtil.hexToInt(temp); |
| | | if (t > 127) {//è¯´ææ¯è´æ° |
| | | t = BytesUtil.hexToInt("FF" + temp); |
| | | } |
| | | if (t == ERROR_TH_TAG) { |
| | | log.error("{}温湿度解æå¼å¸¸ï¼åå ï¼æ²¡ææ£æµå°ä¼ æå¨", ser.getName()); |
| | | th.setRemark(ser.getName() + "温湿度解æå¼å¸¸ï¼åå ï¼æ²¡ææ£æµå°ä¼ æå¨"); |
| | | } else { |
| | | th.setTempIn(Double.valueOf(t)); |
| | | } |
| | | |
| | | //湿度 |
| | | start = 3; |
| | | len = 1; |
| | | temp = content.substring(start * 2, start * 2 + len * 2); |
| | | h = BytesUtil.hexToInt(temp); |
| | | if (h > 127) {//è¯´ææ¯è´æ° |
| | | h = BytesUtil.hexToInt("FF" + temp); |
| | | } |
| | | if (h == ERROR_TH_TAG) { |
| | | log.error("{}温湿度解æå¼å¸¸ï¼åå ï¼æ²¡ææ£æµå°ä¼ æå¨", ser.getName()); |
| | | th.setRemark(ser.getName() + "温湿度解æå¼å¸¸ï¼åå ï¼æ²¡ææ£æµå°ä¼ æå¨"); |
| | | } else { |
| | | th.setHumidityIn(Double.valueOf(h)); |
| | | } |
| | | |
| | | th.setSerId(ser.getId()); |
| | | if (null != exeRequest) { |
| | | th.setThConf(exeRequest.getThConf()); |
| | | } else { |
| | | th.setThConf(thConf + ""); |
| | | } |
| | | |
| | | log.info("仿¸©ä»æ¹¿è§£æå®æ={}", th.toString()); |
| | | |
| | | //æç
§åæºééæ¥ç¡®å® |
| | | thService.setCacheTH(th); |
| | | |
| | | String info = ser.getName() + " 温湿度è·å宿"; |
| | | if (null != exeRequest) { |
| | | //宿 |
| | | exeRequest.setMsg(info); |
| | | exeOrderService.completeCache(exeRequest, false); |
| | | } |
| | | notifyWebInvoker.notifyWeb(ser.getCompanyId(), OrderRespEnum.MSG_SUCCESS, BizType.SYS, info); |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.analysis.builder; |
| | | |
| | | import com.ld.igds.protocol.zldz.analysis.message.ReMessage; |
| | | import com.ld.igds.protocol.zldz.analysis.message.ReMessageBody; |
| | | import com.ld.igds.util.BytesUtil; |
| | | import com.ld.igds.util.ContextUtil; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æ ¹æ®æ¥æ¶å°çä¿¡æ¯è¿è¡å°è£
|
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class ReMessageBuilder { |
| | | |
| | | private final static ReMessageBuilder instance = new ReMessageBuilder(); |
| | | |
| | | private ReMessageBuilder() { |
| | | } |
| | | |
| | | public static ReMessageBuilder getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ä¸åç°CRC16å¯è½ä»¥EEç»å°¾ï¼NETTY误以为æ¯ç»å°¾å¯¼è´æªåå°äºä¸ä¸ªEEï¼å½åæ¹æ³å¿
é¡»ä»å¤´ååæªåï¼ä¿è¯CRC16çä½ç½®åç¡® |
| | | * |
| | | * @param bytes |
| | | * @param ip |
| | | * @param port |
| | | * @param strMsg |
| | | * @return |
| | | */ |
| | | public ReMessage buildMessage(byte[] bytes, String ip, int port, String strMsg) { |
| | | |
| | | ReMessage message = new ReMessage(); |
| | | message.setIp(ip); |
| | | message.setPort(port); |
| | | message.setStrMsg(strMsg); |
| | | message.setByteMsg(bytes); |
| | | |
| | | // æºIDï¼åæºå¯ä¸ID |
| | | int start = 2, len = 2; |
| | | String temp = strMsg.substring(start * 2, start * 2 + len * 2); |
| | | message.setSourceId(BytesUtil.hexToInt(BytesUtil.tran_LH(temp)) + ""); |
| | | |
| | | //åæºæå±ç»ç»ç¼ç |
| | | String companyId = ContextUtil.getCompanyIdBySn(message.getSourceId()); |
| | | |
| | | // ç®æ ID |
| | | start = 4; |
| | | len = 2; |
| | | temp = strMsg.substring(start * 2, start * 2 + len * 2); |
| | | message.setTargetId(BytesUtil.hexToInt(BytesUtil.tran_LH(temp)) + ""); |
| | | |
| | | // åéID |
| | | start = 6; |
| | | len = 2; |
| | | temp = strMsg.substring(start * 2, start * 2 + len * 2); |
| | | message.setSendId(BytesUtil.hexToInt(BytesUtil.tran_LH(temp)) + ""); |
| | | |
| | | // è·¯ç±ä¿¡æ¯ï¼ä¸è§£æ |
| | | |
| | | // æ¶æ¯ç±»å |
| | | start = 12; |
| | | len = 2; |
| | | temp = strMsg.substring(start * 2, start * 2 + len * 2); |
| | | message.setMessageType(BytesUtil.tran_LH(temp)); |
| | | |
| | | // å¤çç»æ |
| | | start = 14; |
| | | len = 1; |
| | | temp = strMsg.substring(start * 2, start * 2 + len * 2); |
| | | message.setResult(BytesUtil.hexToInt(temp)); |
| | | |
| | | // ç»ç»ç¼ç |
| | | start = 15; |
| | | len = 2; |
| | | temp = strMsg.substring(start * 2, start * 2 + len * 2); |
| | | if(null == companyId){ |
| | | message.setCompanyId(BytesUtil.hexToInt(BytesUtil.tran_LH(temp)) + ""); |
| | | }else{ |
| | | message.setCompanyId(companyId); |
| | | } |
| | | |
| | | //å
å¤´æ ¡éª |
| | | start = 17; |
| | | len = 1; |
| | | temp = strMsg.substring(start * 2, start * 2 + len * 2); |
| | | message.setHexCrc8(temp); |
| | | |
| | | // å½ä»¤ä½-é¿åº¦ |
| | | message.setBody(buildBody()); |
| | | start = 18; |
| | | len = 2; |
| | | temp = strMsg.substring(start * 2, start * 2 + len * 2); |
| | | int bodyLen = BytesUtil.hexToInt(BytesUtil.tran_LH(temp)); |
| | | message.getBody().setLength(bodyLen); |
| | | |
| | | //å½ä»¤ä½-å
容 |
| | | start = 20; |
| | | len = bodyLen; |
| | | temp = strMsg.substring(start * 2, start * 2 + len * 2); |
| | | message.getBody().setContent(temp); |
| | | |
| | | // crc16éªè¯ |
| | | start = 20 + bodyLen; |
| | | len = 2; |
| | | temp = strMsg.substring(start * 2, start * 2 + len * 2); |
| | | message.setHexCrc16(temp); |
| | | |
| | | message.setReceiveDate(new Date()); |
| | | message.setBatchId(ContextUtil.getDefaultBatchId()); |
| | | return message; |
| | | } |
| | | |
| | | /** |
| | | * å建BODY对象 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | public ReMessageBody buildBody() { |
| | | ReMessageBody body = new ReMessageBody(); |
| | | body.setLength(0); |
| | | body.setContent(""); |
| | | return body; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.analysis.message; |
| | | |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | import static java.lang.annotation.ElementType.FIELD; |
| | | |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target(FIELD) |
| | | public @interface Metadata { |
| | | |
| | | String label() default ""; |
| | | |
| | | int bytes() default 0; |
| | | |
| | | int startIndex() default 0; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.analysis.message; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æ¶æ¯å¤´å¯¹è±¡ |
| | | * |
| | | * @author Andy |
| | | * |
| | | */ |
| | | @Data |
| | | public class ReMessage { |
| | | |
| | | private String ip; |
| | | |
| | | private int port; |
| | | |
| | | private String begin; |
| | | |
| | | private String sourceId;// æº ID |
| | | |
| | | private String targetId;// ç®æ ID |
| | | |
| | | private String sendId;//åéè
ID |
| | | |
| | | private String gateway1;//è·¯ç±1 |
| | | |
| | | private String gateway2;//è·¯ç±2 |
| | | |
| | | private String messageType;// æ¶æ¯ç±»å |
| | | |
| | | private int result;// å¤çç»æ |
| | | |
| | | private String companyId;// ç»ç»ç¼ç |
| | | |
| | | private String hexCrc8;//crc8å
å¤´æ ¡éª |
| | | |
| | | private ReMessageBody body; |
| | | |
| | | private String hexCrc16;//crc16æ ¡éª |
| | | |
| | | private String end; |
| | | |
| | | private byte[] byteMsg;// å½åå½ä»¤çåèä¿¡æ¯ |
| | | |
| | | private String strMsg;// å½åå½ä»¤è½¬æ¢ä¸ºå符串çä¿¡æ¯ |
| | | |
| | | private String batchId; |
| | | |
| | | private Date receiveDate; |
| | | |
| | | // å¼å¸¸ä¿¡æ¯ |
| | | private String error; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ReMessage{" + |
| | | "ip='" + ip + '\'' + |
| | | ", port=" + port + |
| | | ", sourceId='" + sourceId + '\'' + |
| | | ", targetId='" + targetId + '\'' + |
| | | ", sendId='" + sendId + '\'' + |
| | | ", messageType='" + messageType + '\'' + |
| | | ", result=" + result + |
| | | ", companyId='" + companyId + '\'' + |
| | | ", hexCrc8='" + hexCrc8 + '\'' + |
| | | ", hexCrc16='" + hexCrc16 + '\'' + |
| | | ", strMsg='" + strMsg + '\'' + |
| | | '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.analysis.message; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * æ¶æ¯-æ¶æ¯ä½ |
| | | * |
| | | * @author Andy |
| | | * |
| | | */ |
| | | @Data |
| | | public class ReMessageBody { |
| | | |
| | | private int length; |
| | | |
| | | private String content; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command; |
| | | |
| | | import com.ld.igds.io.constant.ProtocolEnum; |
| | | import com.ld.igds.protocol.zldz.server.ZldzServerEngine; |
| | | import com.ld.io.api.InvokeResult; |
| | | import com.ld.io.api.IoSession; |
| | | |
| | | public class BaseRemoteImpl { |
| | | |
| | | public String getProtocol() { |
| | | return ProtocolEnum.TCP_ZLDZ_GRAIN_V1.getCode(); |
| | | } |
| | | |
| | | /** |
| | | * åéå½ä»¤ |
| | | * |
| | | * @param ip |
| | | * @param port |
| | | * @param msg |
| | | * @return |
| | | */ |
| | | public InvokeResult send(String ip, int port, byte[] msg) { |
| | | IoSession session = ZldzServerEngine.getSession(ip,port); |
| | | if (null == session) { |
| | | return InvokeResult.CHANNEL_CLOSED; |
| | | } |
| | | return session.invoke(msg); |
| | | } |
| | | |
| | | public static void updateSession(String ip, int port, String companyId) { |
| | | IoSession ioSession = ZldzServerEngine.getSession(ip,port); |
| | | if(null != ioSession){ |
| | | ioSession.setCompanyId(companyId); |
| | | } |
| | | } |
| | | |
| | | public static InvokeResult destory(String ip, int port) { |
| | | IoSession session = ZldzServerEngine.getSession(ip,port); |
| | | if (null == session) { |
| | | return InvokeResult.SUCCESS; |
| | | } |
| | | // æ§è¡è¿æ¥éæ¯ |
| | | session.destroy(); |
| | | return InvokeResult.SUCCESS; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command; |
| | | |
| | | import com.ld.igds.io.RemoteCommonService; |
| | | import com.ld.igds.io.constant.OrderRespEnum; |
| | | import com.ld.igds.io.request.*; |
| | | import com.ld.igds.io.response.BaseResponse; |
| | | import com.ld.igds.io.response.GrainResponse; |
| | | import com.ld.igds.protocol.zldz.command.builder.*; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.task.CommandReSendService; |
| | | import com.ld.igds.protocol.zldz.task.CommandTask; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.io.api.InvokeResult; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * å½ååè®®å®ç°ï¼ç²®æ
模åå½ä»¤æ¥å£ |
| | | * |
| | | * @author jiazx |
| | | */ |
| | | @Slf4j |
| | | @Component(RemoteCommonImpl.BEAN_ID) |
| | | public class RemoteCommonImpl extends BaseRemoteImpl implements RemoteCommonService { |
| | | |
| | | public static final String BEAN_ID = "zldz.remoteCommonService"; |
| | | |
| | | @Autowired |
| | | private CommandReSendService commandReSendService; |
| | | |
| | | @Override |
| | | public BaseResponse heartBeat(BaseRequest request) { |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åè®®ä¸æ¯æ"); |
| | | } |
| | | |
| | | @Override |
| | | public BaseResponse pullDevice(BaseRequest request) { |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åè®®ä¸æ¯æ"); |
| | | } |
| | | |
| | | @Override |
| | | public BaseResponse pullDepot(BaseRequest request) { |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åè®®ä¸æ¯æ"); |
| | | } |
| | | |
| | | @Override |
| | | public BaseResponse pullAccess(AccessRequest request) { |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åè®®ä¸æ¯æ"); |
| | | } |
| | | |
| | | @Override |
| | | public BaseResponse pullDepotStatus(DepotStatusRequest request) { |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åè®®ä¸æ¯æ"); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public BaseResponse checkTh(CheckThRequest request) { |
| | | try { |
| | | Message message = CommandBuilder1128.getInstance().buildMessage(request); |
| | | |
| | | log.info("å¹³å°------>>>åæºï¼" + request.getSerName() + "-温湿度å½ä»¤ä¿¡æ¯=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº=" + request.getSerName() + "å鿏©æ¹¿åº¦å½ä»¤æå"); |
| | | } else { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº=" + request.getSerName() + "å鿏©æ¹¿åº¦å½ä»¤å¤±è´¥ï¼" + result.getMessage()); |
| | | } |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åæº=" + request.getSerName() + "温湿度å½ä»¤å¤±è´¥ï¼" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public BaseResponse writeConf(GrainSerConfRequest request) { |
| | | try { |
| | | // Step1 çæå½ä»¤ |
| | | Message message = CommandBuilder1116_1.getInstance().buildMessage(request); |
| | | |
| | | log.info("å¹³å°------>>>åæºï¼" + request.getSerName() + "-åå
¥é
ç½®å½ä»¤=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | |
| | | CommandTask commandData = new CommandTask(); |
| | | commandData.setCompanyId(request.getCompanyId()); |
| | | commandData.setIp(request.getIp()); |
| | | commandData.setPort(request.getPort()); |
| | | commandData.setByteCommand(message.getByteMsg()); |
| | | commandData.setCommand(message.getStrMsg()); |
| | | commandData.setResultType(ServerUtils.MSG_TYPE_8816); |
| | | commandReSendService.reSendTask(commandData); |
| | | |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº=" + request.getSerName() + "åå
¥é
ç½®å½ä»¤åéæå"); |
| | | } else { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº=" + request.getSerName() + "åå
¥é
ç½®å½ä»¤åéå¼å¸¸ï¼" + result.getMessage()); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åæº=" + request.getSerName() + "åå
¥é
ç½®å½ä»¤åéå¼å¸¸ï¼" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public BaseResponse readConf(GrainSerConfRequest request) { |
| | | try { |
| | | // Step1 çæå½ä»¤ |
| | | Message message = CommandBuilder1116_0.getInstance().buildMessage(request); |
| | | |
| | | log.info("å¹³å°------>>>åæºï¼" + request.getSerName() + "-读åé
ç½®å½ä»¤=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | CommandTask commandData = new CommandTask(); |
| | | commandData.setCompanyId(request.getCompanyId()); |
| | | commandData.setIp(request.getIp()); |
| | | commandData.setPort(request.getPort()); |
| | | commandData.setByteCommand(message.getByteMsg()); |
| | | commandData.setCommand(message.getStrMsg()); |
| | | commandData.setResultType(ServerUtils.MSG_TYPE_8816); |
| | | commandReSendService.reSendTask(commandData); |
| | | |
| | | return new GrainResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº=" + request.getSerName() + "读åé
ç½®å½ä»¤åéæå"); |
| | | } else { |
| | | |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº=" + request.getSerName() + "读åé
ç½®å½ä»¤åéå¼å¸¸ï¼" + result.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åæº=" + request.getSerName() + "读åé
ç½®å½ä»¤åéå¼å¸¸ï¼" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public BaseResponse initCable(BaseRequest request) { |
| | | try { |
| | | // Step1 çæç²®æ
ä¿¡æ¯ |
| | | Message message = CommandBuilder1122.getInstance().buildMessage(request); |
| | | |
| | | log.info("å¹³å°------>>>åæºï¼" + request.getSerName() + "-åå§åçµç¼å½ä»¤=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), |
| | | message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | CommandTask commandData = new CommandTask(); |
| | | commandData.setCompanyId(request.getCompanyId()); |
| | | commandData.setIp(request.getIp()); |
| | | commandData.setPort(request.getPort()); |
| | | commandData.setByteCommand(message.getByteMsg()); |
| | | commandData.setCommand(message.getStrMsg()); |
| | | commandData.setResultType(ServerUtils.MSG_TYPE_8822); |
| | | commandReSendService.reSendTask(commandData); |
| | | |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº=" + request.getSerName() + "åå§åçµç¼åéæå"); |
| | | } else { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº=" + request.getSerName() + "åå§åçµç¼å½ä»¤åé失败ï¼" + result.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åæº=" + request.getSerName() + "åå§åçµç¼å½ä»¤æ§è¡å¤±è´¥ï¼" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public BaseResponse updateGrainSerCable(GrainSerConfRequest request) { |
| | | if (null == request.getEditTag()) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "å½åæä½æ²¡æå¶å®ä¿®æ¹æ è¯ï¼æ æ³æ§è¡ï¼"); |
| | | } |
| | | |
| | | //æ ¹æ®ä¿®æ¹æ è¯å¤çä¸åçé»è¾ -- 2ç¹å·ä¿®æ¹ 3åå·ä¿®æ¹ï¼4æ ¹å·ä¿®æ¹ï¼5忥çµç¼ï¼6æ ¹å·æ¿æ¢ |
| | | if (2 == request.getEditTag()) { |
| | | return updateGrainSerCable2(request); |
| | | } |
| | | if (3 == request.getEditTag()) { |
| | | return updateGrainSerCable3(request); |
| | | } |
| | | if (4 == request.getEditTag()) { |
| | | return updateGrainSerCable4(request); |
| | | } |
| | | if (5 == request.getEditTag()) { |
| | | return updateGrainSerCable5(request); |
| | | } |
| | | if (6 == request.getEditTag()) { |
| | | return updateGrainSerCable6(request); |
| | | } |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "没æå¹é
å°å½åéè¦æä½çæ è¯ï¼æ è¯=" + request.getEditTag()); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹å·æ¿æ¢ |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | private BaseResponse updateGrainSerCable6(GrainSerConfRequest request) { |
| | | if (null == request.getValue1() || null == request.getValue2()) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "æ¿æ¢æä½ä¸ï¼æ²¡æè·åå°æ°æ§åæ°é
ç½®ï¼"); |
| | | } |
| | | |
| | | // Step1 |
| | | Message message = CommandBuilder1126.getInstance().buildMessage(request); |
| | | |
| | | log.info("å¹³å°------>>>åæºï¼" + request.getSerName() + "çµç¼-æ ¹å·æ¿æ¢å½ä»¤=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), |
| | | message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº=" + request.getSerName() + "çµç¼-æ ¹å·æ¿æ¢åéæåï¼"); |
| | | } else { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº=" + request.getSerName() + "çµç¼-æ ¹å·æ¿æ¢åé失败ï¼" + result.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * @param request |
| | | * @return |
| | | */ |
| | | private BaseResponse updateGrainSerCable5(GrainSerConfRequest request) { |
| | | if (null == request.getValue1() || null == request.getValue2()) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "忥çµç¼å¤±è´¥ï¼åæ¥çµç¼åæ°ä¸å®æ´"); |
| | | } |
| | | |
| | | |
| | | // Step1 |
| | | Message message = CommandBuilder1126.getInstance().buildMessage(request); |
| | | |
| | | log.info("å¹³å°------>>>åæºï¼" + request.getSerName() + "忥çµç¼-å½ä»¤=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), |
| | | message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº=" + request.getSerName() + "çµç¼-æ ¹å·æ¿æ¢åéæåï¼"); |
| | | } else { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº=" + request.getSerName() + "çµç¼-æ ¹å·æ¿æ¢åé失败ï¼" + result.getMessage()); |
| | | } |
| | | } |
| | | |
| | | private BaseResponse updateGrainSerCable4(GrainSerConfRequest request) { |
| | | if (null == request.getValue1() || null == request.getValue2()) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "æ¿æ¢æä½ä¸ï¼æ²¡æè·åå°æ°æ§åæ°é
ç½®ï¼"); |
| | | } |
| | | |
| | | //è¾å
¥å¼éè¦-1 |
| | | request.setValue1(request.getValue1() - 1); |
| | | request.setValue2(request.getValue2() - 1); |
| | | |
| | | // Step1 |
| | | Message message = CommandBuilder1126.getInstance().buildMessage(request); |
| | | |
| | | log.info("å¹³å°------>>>åæºï¼" + request.getSerName() + "-çµç¼-æ ¹å·ä¿®æ¹å½ä»¤=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), |
| | | message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº=" + request.getSerName() + "çµç¼-æ ¹å·ä¿®æ¹å½ä»¤åéæåï¼"); |
| | | } else { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº=" + request.getSerName() + "çµç¼-æ ¹å·ä¿®æ¹å½ä»¤åé失败ï¼" + result.getMessage()); |
| | | } |
| | | } |
| | | |
| | | private BaseResponse updateGrainSerCable3(GrainSerConfRequest request) { |
| | | |
| | | if (null == request.getEditCol()) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "æ¿æ¢æä½ä¸ï¼æ²¡æè·åååæ°ï¼"); |
| | | } |
| | | |
| | | // Step1 |
| | | Message message = CommandBuilder1126.getInstance().buildMessage(request); |
| | | |
| | | log.info("å¹³å°------>>>åæºï¼" + request.getSerName() + "çµç¼-åå·ä¿®æ¹å½ä»¤=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), |
| | | message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº=" + request.getSerName() + "çµç¼-åå·ä¿®æ¹å½ä»¤åéæåï¼"); |
| | | } else { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº=" + request.getSerName() + "çµç¼-åå·ä¿®æ¹å½ä»¤åé失败ï¼" + result.getMessage()); |
| | | } |
| | | } |
| | | |
| | | private BaseResponse updateGrainSerCable2(GrainSerConfRequest request) { |
| | | |
| | | if (null == request.getValue1() || null == request.getValue2()) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "æ¿æ¢æä½ä¸ï¼æ²¡æè·åå°æ°æ§åæ°é
ç½®ï¼"); |
| | | } |
| | | |
| | | //è¾å
¥å¼éè¦-1 |
| | | request.setValue1(request.getValue1() - 1); |
| | | request.setValue2(request.getValue2() == null ? 0 : request.getValue2()); |
| | | |
| | | // Step1 çæå½ä»¤ |
| | | Message message = CommandBuilder1126.getInstance().buildMessage(request); |
| | | |
| | | log.info("å¹³å°------>>>åæºï¼" + request.getSerName() + "çµç¼-ç¹å·ä¿®æ¹å½ä»¤=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº=" + request.getSerName() + "çµç¼-ç¹å·ä¿®æ¹å½ä»¤åéæåï¼"); |
| | | } else { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº=" + request.getSerName() + "çµç¼-ç¹å·ä¿®æ¹å½ä»¤åé失败ï¼" + result.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·åééçµç¼ |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @Override |
| | | public BaseResponse checkGrainSerCable(GrainSerConfRequest request) { |
| | | |
| | | // Step1 çæç²®æ
ä¿¡æ¯ |
| | | Message message = CommandBuilder1125.getInstance().buildMessage(request); |
| | | |
| | | log.info("å¹³å°------>>>åæºï¼" + request.getSerName() + "è·åééçµç¼å½ä»¤=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº=" + request.getSerName() + "è·åééçµç¼å½ä»¤åéæåï¼"); |
| | | } else { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº=" + request.getSerName() + "è·åééçµç¼å½ä»¤åé失败ï¼" + result.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public BaseResponse destroyCon(BaseRequest request) { |
| | | InvokeResult result = destory(request.getIp(), request.getPort()); |
| | | if (InvokeResult.SUCCESS == result) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº=" + request.getSerName() + "æå¼è¿æ¥æ§è¡æå"); |
| | | } else { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), "åæº=" + request.getSerName() + "æå¼è¿æ¥å¤±è´¥ï¼" + result.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public BaseResponse updateSysDepotConf(BaseRequest request) { |
| | | return new BaseResponse(OrderRespEnum.NO_FUNCTION); |
| | | } |
| | | |
| | | @Override |
| | | public BaseResponse sumGrainSerCable(GrainSerConfRequest request) { |
| | | // Step1 |
| | | Message message = CommandBuilder1123.getInstance().buildMessage(request); |
| | | |
| | | log.info("å¹³å°------>>>åæºï¼" + request.getSerName() + "çµç¼æ±æ»å½ä»¤=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº=" + request.getSerName() + "çµç¼æ±æ»å½ä»¤åéæåï¼"); |
| | | } else { |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº=" + request.getSerName() + "çµç¼æ±æ»å½ä»¤åé失败ï¼" + result.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command; |
| | | |
| | | import com.ld.igds.io.RemoteGrainService; |
| | | import com.ld.igds.io.constant.OrderRespEnum; |
| | | import com.ld.igds.io.request.BaseRequest; |
| | | import com.ld.igds.io.request.CheckGrainRequest; |
| | | import com.ld.igds.io.response.BaseResponse; |
| | | import com.ld.igds.io.response.GrainResponse; |
| | | import com.ld.igds.protocol.zldz.command.builder.CommandBuilder1115; |
| | | import com.ld.igds.protocol.zldz.command.builder.CommandBuilder8815; |
| | | import com.ld.igds.protocol.zldz.command.builder.CommandBuilder8817; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.task.CommandReSendService; |
| | | import com.ld.igds.protocol.zldz.task.CommandTask; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.io.api.InvokeResult; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * ç²®æ
åè®®ï¼ç´æ¥è·åç²®æ
ï¼æ¸©æ¹¿åº¦ä¿¡æ¯éè¿å¿è·³å®æ¶è·åã |
| | | * |
| | | * @author jiazx |
| | | */ |
| | | @Slf4j |
| | | @Component(RemoteGrainServiceImpl.BEAN_ID) |
| | | public class RemoteGrainServiceImpl extends BaseRemoteImpl implements |
| | | RemoteGrainService { |
| | | |
| | | public static final String BEAN_ID = "zldz.remoteGrainService"; |
| | | |
| | | @Autowired |
| | | private CommandReSendService commandReSendService; |
| | | |
| | | /** |
| | | * ç²®æ
æ£æµï¼é¦å
éè¦æ§è¡æ¸©æ¹¿åº¦æ£æµï¼æ¸©æ¹¿åº¦æ£æµå®æåï¼åè¿ç²®æ
æ£æµã |
| | | * 温湿度çä¿¡æ¯æ ¹æ®åæºå温湿度å°ååå¨ç¼å30åéï¼30åéå
ä¸éå¤ééï¼ç³»ç»å¤æä¸å½åæ¶é´å·®è·ç¦»å½åæ¶é´æ¯å¦è¶
è¿25åé |
| | | * ï¼è¶
è¿éæ°è·åï¼æ²¡æè¶
è¿ç´æ¥ééç²®æ
|
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @Override |
| | | public GrainResponse checkGrain(CheckGrainRequest request) { |
| | | // Step1 çæç²®æ
ä¿¡æ¯ |
| | | Message message = CommandBuilder1115.getInstance().buildMessage(request); |
| | | |
| | | log.info("å¹³å°------>>>åæºï¼" +request.getSerName() + "-ç²®æ
ééå½ä»¤=" + message.toString()); |
| | | |
| | | InvokeResult result = send(request.getIp(), request.getPort(), message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | CommandTask commandData = new CommandTask(); |
| | | commandData.setCompanyId(request.getCompanyId()); |
| | | commandData.setIp(request.getIp()); |
| | | commandData.setPort(request.getPort()); |
| | | commandData.setByteCommand(message.getByteMsg()); |
| | | commandData.setCommand(message.getStrMsg()); |
| | | commandData.setResultType(ServerUtils.MSG_TYPE_8817); |
| | | commandData.setCableRule(request.getCableRule()); |
| | | commandData.setSerName(request.getSerName()); |
| | | commandData.setDepotId(request.getDepotId()); |
| | | commandReSendService.reSendGrainTask(commandData); |
| | | return new GrainResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "ç²®æ
ééå½ä»¤åéæå"); |
| | | } else { |
| | | log.info("åæº" + request.getSerName() + "ç²®æ
ééå½ä»¤åé失败ï¼" + result.getMessage()); |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), result.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æå¡å¨åå¤ç»ç«¯çæ¶å°è¯·æ± |
| | | * |
| | | * @param request |
| | | */ |
| | | public BaseResponse reply8815(BaseRequest request) { |
| | | // Step1 çæç²®æ
ä¿¡æ¯ |
| | | Message message = CommandBuilder8815.getInstance().buildMessage( |
| | | request); |
| | | |
| | | log.debug("å¹³å°------>>>åæºï¼" +request.getSerName() + "-ç²®æ
æå¡ç«¯åå¤å½ä»¤=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), |
| | | message.getByteMsg()); |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº" + request.getSerName() + "ç²®æ
æå¡ç«¯åå¤å½ä»¤åéæå"); |
| | | } else { |
| | | log.error("åæº" + request.getSerName() + "ç²®æ
æå¡ç«¯åå¤å½ä»¤åé失败ï¼" + result.getMessage()); |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº" + request.getSerName() + "ç²®æ
æå¡ç«¯åå¤å½ä»¤åé失败ï¼" + result.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå¤å½ä»¤ |
| | | * |
| | | * @param request |
| | | * @param hexCurPacket å½åå
çhex |
| | | */ |
| | | public BaseResponse reply8817(BaseRequest request, String hexCurPacket) { |
| | | // Step1 çæç²®æ
ä¿¡æ¯ï¼æä¿¡æ¯æ¾å¨request |
| | | request.setBizType(hexCurPacket); |
| | | |
| | | Message message = CommandBuilder8817.getInstance().buildMessage(request); |
| | | |
| | | log.debug("å¹³å°------>>>åæºï¼" +request.getSerName() + "-ç²®æ
æå¡ç«¯å夿¶å°ç²®æ
å
å½ä»¤=" + message.toString()); |
| | | |
| | | // åéå½ä»¤ |
| | | InvokeResult result = send(request.getIp(), request.getPort(), |
| | | message.getByteMsg()); |
| | | |
| | | // å°è£
è¿åä¿¡æ¯ |
| | | if (InvokeResult.SUCCESS == result) { |
| | | return new BaseResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "åæº" + request.getSerName() + "ç²®æ
æå¡ç«¯å夿¶å°ç²®æ
å
å½ä»¤åéæå"); |
| | | } else { |
| | | log.info("åæº" + request.getSerName() + "ç²®æ
æå¡ç«¯å夿¶å°ç²®æ
å
å½ä»¤åé失败ï¼" + result.getMessage()); |
| | | |
| | | return new BaseResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åæº" + request.getSerName() + "ç²®æ
æå¡ç«¯å夿¶å°ç²®æ
å
å½ä»¤åé失败ï¼" + result.getMessage()); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.BaseRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.command.message.MessageBody; |
| | | import com.ld.igds.protocol.zldz.util.CRC8; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | |
| | | |
| | | /** |
| | | * å½ä»¤çæå¨ |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public abstract class CommandBuilder { |
| | | |
| | | /* |
| | | * å½ä»¤å建 |
| | | * |
| | | * @param order |
| | | */ |
| | | public Message buildMessage(BaseRequest request) { |
| | | Message message = new Message(); |
| | | |
| | | message.setBegin(ServerUtils.MSG_START); |
| | | |
| | | // è°æ´Message头é¨ä¿¡æ¯ |
| | | buildHeader(message, request); |
| | | |
| | | //å
å¤´æ ¡éª |
| | | buildCrc8(message); |
| | | |
| | | // åå»ºæ¶æ¯ä½ |
| | | buildBody(message, request); |
| | | |
| | | // æ·»å æ ¡éª |
| | | buildCrc16(message); |
| | | |
| | | message.setEnd(ServerUtils.MSG_END); |
| | | |
| | | // çææ´ä½å½ä»¤ä¿¡æ¯åBYteä¿¡æ¯ |
| | | build(message); |
| | | |
| | | return message; |
| | | } |
| | | |
| | | |
| | | public void buildHeader(Message message, BaseRequest request) { |
| | | String hexCompanyId = BytesUtil.getTargetId(request.getCompanyId(),true); |
| | | hexCompanyId = BytesUtil.tran_LH(hexCompanyId); |
| | | message.setSourceId(hexCompanyId); |
| | | message.setSendId(hexCompanyId); |
| | | message.setCompanyId(hexCompanyId); |
| | | |
| | | message.setSourceId(BytesUtil.getTargetId(request.getSerId(), true)); |
| | | |
| | | message.setMessageType(ServerUtils.MSG_TYPE_1116); |
| | | } |
| | | |
| | | public void buildBody(Message message, BaseRequest request) { |
| | | MessageBody body = new MessageBody(); |
| | | body.setContent(""); |
| | | body.setLength(0); |
| | | message.setBody(body); |
| | | } |
| | | |
| | | public void buildCrc8(Message message) { |
| | | StringBuffer hexSbCrc8 = new StringBuffer(); |
| | | hexSbCrc8.append(message.getSourceId()); |
| | | hexSbCrc8.append(message.getTargetId()); |
| | | hexSbCrc8.append(message.getSendId()); |
| | | hexSbCrc8.append(message.getGateway1()); |
| | | hexSbCrc8.append(message.getGateway2()); |
| | | hexSbCrc8.append(message.getMessageType()); |
| | | hexSbCrc8.append(message.getResult()); |
| | | hexSbCrc8.append(message.getCompanyId()); |
| | | |
| | | byte[] bytes = BytesUtil.hexStrToBytes(hexSbCrc8.toString()); |
| | | byte crc8 = CRC8.calcCrc8(bytes, (short) 0, (short) (bytes.length), |
| | | (byte) 0); |
| | | |
| | | message.setHexCrc8(BytesUtil.byteToHex(crc8)); |
| | | } |
| | | |
| | | |
| | | public void buildCrc16(Message message) { |
| | | StringBuffer hexSbCrc16 = new StringBuffer(); |
| | | hexSbCrc16.append(message.getSourceId()); |
| | | hexSbCrc16.append(message.getTargetId()); |
| | | hexSbCrc16.append(message.getSendId()); |
| | | hexSbCrc16.append(message.getGateway1()); |
| | | hexSbCrc16.append(message.getGateway2()); |
| | | hexSbCrc16.append(message.getMessageType()); |
| | | hexSbCrc16.append(message.getResult()); |
| | | hexSbCrc16.append(message.getCompanyId()); |
| | | |
| | | hexSbCrc16.append(message.getHexCrc8()); |
| | | |
| | | hexSbCrc16.append(BytesUtil.tran_LH(BytesUtil |
| | | .getHex2LenStr(message.getBody().getLength()))); |
| | | |
| | | hexSbCrc16.append(message.getBody().getContent()); |
| | | |
| | | byte[] byteCrc16 = BytesUtil.hexStrToBytes(hexSbCrc16.toString()); |
| | | short crc16Hex2 = CRC8.calculateCrc16(byteCrc16, (short) 0, (short) (byteCrc16.length)); |
| | | byte[] crc16Hex2Bytes = BytesUtil.shortToByte(crc16Hex2); |
| | | int crc16 = BytesUtil.bytesToInt(crc16Hex2Bytes); |
| | | |
| | | |
| | | message.setHexCrc16(BytesUtil.intToHexStr(crc16)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®çæçå½ä»¤ï¼è¿è¡è°æ´ |
| | | * |
| | | * @param message |
| | | */ |
| | | public void build(Message message) { |
| | | StringBuffer hexSb = new StringBuffer(); |
| | | |
| | | hexSb.append(message.getBegin()); |
| | | hexSb.append(message.getSourceId()); |
| | | hexSb.append(message.getTargetId()); |
| | | hexSb.append(message.getSendId()); |
| | | hexSb.append(message.getGateway1()); |
| | | hexSb.append(message.getGateway2()); |
| | | hexSb.append(message.getMessageType()); |
| | | hexSb.append(message.getResult()); |
| | | hexSb.append(message.getCompanyId()); |
| | | hexSb.append(message.getHexCrc8()); |
| | | |
| | | hexSb.append(BytesUtil.tran_LH(BytesUtil |
| | | .getHex2LenStr(message.getBody().getLength()))); |
| | | |
| | | hexSb.append(message.getBody().getContent()); |
| | | hexSb.append(message.getHexCrc16()); |
| | | hexSb.append(message.getEnd()); |
| | | |
| | | message.setStrMsg(hexSb.toString()); |
| | | message.setByteMsg(BytesUtil.hexStrToBytes(message.getStrMsg())); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.BaseRequest; |
| | | import com.ld.igds.io.request.CheckGrainRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.command.message.MessageBody; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | |
| | | |
| | | /** |
| | | * ç²®æ
ä¿¡æ¯å½ä»¤ |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class CommandBuilder1115 extends CommandBuilder { |
| | | |
| | | |
| | | private final static CommandBuilder1115 instance = new CommandBuilder1115(); |
| | | |
| | | private CommandBuilder1115() { |
| | | |
| | | } |
| | | |
| | | public static CommandBuilder1115 getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | public Message buildMessage(CheckGrainRequest request) { |
| | | |
| | | //request.setCompanyId("1"); |
| | | |
| | | Message message = new Message(); |
| | | |
| | | message.setBegin(ServerUtils.MSG_START); |
| | | |
| | | // è°æ´Message头é¨ä¿¡æ¯ |
| | | buildHeader(message, request); |
| | | |
| | | //å
å¤´æ ¡éª |
| | | buildCrc8(message); |
| | | |
| | | // åå»ºæ¶æ¯ä½ |
| | | buildBody(message, request); |
| | | |
| | | // æ·»å æ ¡éª |
| | | buildCrc16(message); |
| | | |
| | | message.setEnd(ServerUtils.MSG_END); |
| | | |
| | | // çææ´ä½å½ä»¤ä¿¡æ¯åBYteä¿¡æ¯ |
| | | build(message); |
| | | |
| | | return message; |
| | | } |
| | | |
| | | public void buildHeader(Message message, BaseRequest order) { |
| | | String hexCompanyId = BytesUtil.getTargetId(order.getCompanyId(),true); |
| | | hexCompanyId = BytesUtil.tran_LH(hexCompanyId); |
| | | |
| | | message.setSourceId(hexCompanyId); |
| | | message.setSendId(hexCompanyId); |
| | | message.setCompanyId(hexCompanyId); |
| | | |
| | | message.setTargetId(BytesUtil.tran_LH(BytesUtil.getTargetId(order.getSerId(), true))); |
| | | message.setMessageType(BytesUtil.tran_LH(ServerUtils.MSG_TYPE_1115)); |
| | | } |
| | | |
| | | |
| | | public void buildBody(Message message, CheckGrainRequest order) { |
| | | MessageBody body = new MessageBody(); |
| | | body.setLength(2); |
| | | int start = order.getCableStart(); |
| | | int end = order.getCableEnd(); |
| | | body.setContent(BytesUtil.toHexString(start) + BytesUtil.toHexString(end)); |
| | | message.setBody(body); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.GrainSerConfRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.command.message.MessageBody; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class CommandBuilder1116_0 extends CommandBuilder { |
| | | |
| | | |
| | | private final static CommandBuilder1116_0 instance = new CommandBuilder1116_0(); |
| | | |
| | | private CommandBuilder1116_0() { |
| | | |
| | | } |
| | | |
| | | public static CommandBuilder1116_0 getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | public Message buildMessage(GrainSerConfRequest request) { |
| | | |
| | | Message message = new Message(); |
| | | |
| | | message.setBegin(ServerUtils.MSG_START); |
| | | |
| | | // è°æ´Message头é¨ä¿¡æ¯ |
| | | buildHeader(message, request); |
| | | |
| | | //å
å¤´æ ¡éª |
| | | buildCrc8(message); |
| | | |
| | | // åå»ºæ¶æ¯ä½ |
| | | buildBody(message, request); |
| | | |
| | | // æ·»å æ ¡éª |
| | | buildCrc16(message); |
| | | |
| | | message.setEnd(ServerUtils.MSG_END); |
| | | |
| | | // çææ´ä½å½ä»¤ä¿¡æ¯åBYteä¿¡æ¯ |
| | | build(message); |
| | | |
| | | return message; |
| | | } |
| | | |
| | | public void buildHeader(Message message, GrainSerConfRequest request) { |
| | | |
| | | // String hexCompanyId = BytesUtil.getTargetId(request.getCompanyId(),true); |
| | | // |
| | | // hexCompanyId = BytesUtil.tran_LH(hexCompanyId); |
| | | // message.setSourceId(hexCompanyId); |
| | | // message.setSendId(hexCompanyId); |
| | | // |
| | | // //åéçå¿
é¡»æ¯åæ¥çç»ç»ç¼ç |
| | | // String orgId = BytesUtil.tran_LH(BytesUtil.getTargetId(request.getOrgId(),true)); |
| | | // message.setCompanyId(orgId); |
| | | // |
| | | // message.setTargetId(BytesUtil.tran_LH(BytesUtil.getTargetId(request.getSerId(), true))); |
| | | |
| | | message.setSourceId("0000"); |
| | | message.setSendId("0000"); |
| | | message.setCompanyId("0000"); |
| | | message.setTargetId("FFFF"); |
| | | |
| | | message.setMessageType(BytesUtil.tran_LH(ServerUtils.MSG_TYPE_1116)); |
| | | } |
| | | |
| | | |
| | | public void buildBody(Message message, GrainSerConfRequest request) { |
| | | MessageBody body = new MessageBody(); |
| | | body.setContent("0000000000000000000000000000"); |
| | | body.setLength(14); |
| | | message.setBody(body); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.GrainSerConfRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.command.message.MessageBody; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class CommandBuilder1116_1 extends CommandBuilder { |
| | | |
| | | |
| | | private final static CommandBuilder1116_1 instance = new CommandBuilder1116_1(); |
| | | |
| | | private CommandBuilder1116_1() { |
| | | |
| | | } |
| | | |
| | | public static CommandBuilder1116_1 getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | public Message buildMessage(GrainSerConfRequest request) { |
| | | |
| | | Message message = new Message(); |
| | | |
| | | message.setBegin(ServerUtils.MSG_START); |
| | | |
| | | // è°æ´Message头é¨ä¿¡æ¯ |
| | | buildHeader(message, request); |
| | | |
| | | //å
å¤´æ ¡éª |
| | | buildCrc8(message); |
| | | |
| | | // åå»ºæ¶æ¯ä½ |
| | | buildBody(message, request); |
| | | |
| | | // æ·»å æ ¡éª |
| | | buildCrc16(message); |
| | | |
| | | message.setEnd(ServerUtils.MSG_END); |
| | | |
| | | // çææ´ä½å½ä»¤ä¿¡æ¯åBYteä¿¡æ¯ |
| | | build(message); |
| | | |
| | | return message; |
| | | } |
| | | |
| | | public void buildHeader(Message message, GrainSerConfRequest request) { |
| | | |
| | | String hexCompanyId = BytesUtil.getTargetId(request.getCompanyId(),true); |
| | | hexCompanyId = BytesUtil.tran_LH(hexCompanyId); |
| | | |
| | | message.setSourceId(hexCompanyId); |
| | | message.setSendId(hexCompanyId); |
| | | |
| | | //åéçå¿
é¡»æ¯åæ¥çç»ç»ç¼ç |
| | | String orgId = BytesUtil.tran_LH(BytesUtil.getTargetId(request.getOrgId(),true)); |
| | | message.setCompanyId(orgId); |
| | | |
| | | message.setTargetId(BytesUtil.tran_LH(BytesUtil.getTargetId(request.getSerId(), true))); |
| | | message.setMessageType(BytesUtil.tran_LH(ServerUtils.MSG_TYPE_1116)); |
| | | } |
| | | |
| | | |
| | | public void buildBody(Message message, GrainSerConfRequest request) { |
| | | MessageBody body = new MessageBody(); |
| | | StringBuffer content = new StringBuffer(); |
| | | content.append("01");//åæ è®° |
| | | content.append(message.getTargetId()); |
| | | content.append(BytesUtil.getTargetId("01",false));//ç½ç»ID |
| | | content.append("0A");//é»è®¤10 ä¿¡é |
| | | content.append(BytesUtil.getTargetId("03",false));//éç |
| | | content.append(BytesUtil.toHexString(request.getCableZ())); |
| | | content.append(BytesUtil.toHexString(request.getCableY())); |
| | | content.append(BytesUtil.toHexString(request.getCableX())); |
| | | content.append(BytesUtil.getTargetId(request.getCableFormat(),false)); |
| | | content.append(BytesUtil.getTargetId(request.getCableType(),false)); |
| | | |
| | | if(StringUtils.isEmpty(request.getPowerModel())){ |
| | | request.setPowerModel("02"); |
| | | } |
| | | content.append(BytesUtil.getTargetId(request.getPowerModel(),false)); |
| | | |
| | | content.append(message.getSourceId()); |
| | | |
| | | body.setContent(content.toString()); |
| | | body.setLength(14); |
| | | message.setBody(body); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.BaseRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.command.message.MessageBody; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | |
| | | /** |
| | | * åå§åçµç¼çµç¼ |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class CommandBuilder1122 extends CommandBuilder { |
| | | |
| | | private final static CommandBuilder1122 instance = new CommandBuilder1122(); |
| | | |
| | | private CommandBuilder1122() { |
| | | |
| | | } |
| | | |
| | | public static CommandBuilder1122 getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | public void buildHeader(Message message, BaseRequest request) { |
| | | |
| | | String hexCompanyId = BytesUtil.getTargetId(request.getCompanyId(),true); |
| | | hexCompanyId = BytesUtil.tran_LH(hexCompanyId); |
| | | |
| | | message.setSourceId(hexCompanyId); |
| | | message.setSendId(hexCompanyId); |
| | | message.setCompanyId(hexCompanyId); |
| | | |
| | | message.setTargetId(BytesUtil.tran_LH(BytesUtil.getTargetId(request.getSerId(), true))); |
| | | message.setMessageType(BytesUtil.tran_LH(ServerUtils.MSG_TYPE_1122)); |
| | | } |
| | | |
| | | public void buildBody(Message message, BaseRequest request) { |
| | | MessageBody body = new MessageBody(); |
| | | body.setContent("01"); |
| | | body.setLength(1); |
| | | message.setBody(body); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.GrainSerConfRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | |
| | | /** |
| | | * ç²®æ
åæº-çµç¼æ±æ» |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class CommandBuilder1123 extends CommandBuilder { |
| | | |
| | | private final static CommandBuilder1123 instance = new CommandBuilder1123(); |
| | | |
| | | private CommandBuilder1123() { |
| | | |
| | | } |
| | | |
| | | public static CommandBuilder1123 getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | public Message buildMessage(GrainSerConfRequest request) { |
| | | |
| | | Message message = new Message(); |
| | | |
| | | message.setBegin(ServerUtils.MSG_START); |
| | | |
| | | // è°æ´Message头é¨ä¿¡æ¯ |
| | | buildHeader(message, request); |
| | | |
| | | // å
å¤´æ ¡éª |
| | | buildCrc8(message); |
| | | |
| | | // åå»ºæ¶æ¯ä½ |
| | | buildBody(message, request); |
| | | |
| | | // æ·»å æ ¡éª |
| | | buildCrc16(message); |
| | | |
| | | message.setEnd(ServerUtils.MSG_END); |
| | | |
| | | // çææ´ä½å½ä»¤ä¿¡æ¯åBYteä¿¡æ¯ |
| | | build(message); |
| | | |
| | | return message; |
| | | } |
| | | |
| | | public void buildHeader(Message message, GrainSerConfRequest request) { |
| | | String hexCompanyId = BytesUtil.getTargetId(request.getCompanyId(), |
| | | true); |
| | | hexCompanyId = BytesUtil.tran_LH(hexCompanyId); |
| | | |
| | | message.setSourceId(hexCompanyId); |
| | | message.setSendId(hexCompanyId); |
| | | message.setCompanyId(hexCompanyId); |
| | | |
| | | message.setTargetId(BytesUtil.tran_LH(BytesUtil.getTargetId( |
| | | request.getSerId(), true))); |
| | | |
| | | message.setMessageType(BytesUtil.tran_LH(ServerUtils.MSG_TYPE_1123)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.GrainSerConfRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.command.message.MessageBody; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | |
| | | /** |
| | | * ç²®æ
åæº-çµç¼æ£æµ |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class CommandBuilder1125 extends CommandBuilder { |
| | | |
| | | private final static CommandBuilder1125 instance = new CommandBuilder1125(); |
| | | |
| | | private CommandBuilder1125() { |
| | | |
| | | } |
| | | |
| | | public static CommandBuilder1125 getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | public Message buildMessage(GrainSerConfRequest request) { |
| | | |
| | | Message message = new Message(); |
| | | |
| | | message.setBegin(ServerUtils.MSG_START); |
| | | |
| | | // è°æ´Message头é¨ä¿¡æ¯ |
| | | buildHeader(message, request); |
| | | |
| | | // å
å¤´æ ¡éª |
| | | buildCrc8(message); |
| | | |
| | | // åå»ºæ¶æ¯ä½ |
| | | buildBody(message, request); |
| | | |
| | | // æ·»å æ ¡éª |
| | | buildCrc16(message); |
| | | |
| | | message.setEnd(ServerUtils.MSG_END); |
| | | |
| | | // çææ´ä½å½ä»¤ä¿¡æ¯åBYteä¿¡æ¯ |
| | | build(message); |
| | | |
| | | return message; |
| | | } |
| | | |
| | | public void buildHeader(Message message, GrainSerConfRequest request) { |
| | | String hexCompanyId = BytesUtil.getTargetId(request.getCompanyId(), |
| | | true); |
| | | hexCompanyId = BytesUtil.tran_LH(hexCompanyId); |
| | | |
| | | message.setSourceId(hexCompanyId); |
| | | message.setSendId(hexCompanyId); |
| | | message.setCompanyId(hexCompanyId); |
| | | |
| | | message.setTargetId(BytesUtil.tran_LH(BytesUtil.getTargetId( |
| | | request.getSerId(), true))); |
| | | message.setMessageType(BytesUtil.tran_LH(ServerUtils.MSG_TYPE_1125)); |
| | | } |
| | | |
| | | public void buildBody(Message message, GrainSerConfRequest request) { |
| | | MessageBody body = new MessageBody(); |
| | | body.setLength(1); |
| | | body.setContent(BytesUtil.toHexString(request.getPassCode())); |
| | | message.setBody(body); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.GrainSerConfRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.command.message.MessageBody; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | |
| | | /** |
| | | * ç²®æ
åæº-ä¿®æ¹ééçµç¼ |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class CommandBuilder1126 extends CommandBuilder { |
| | | |
| | | private final static CommandBuilder1126 instance = new CommandBuilder1126(); |
| | | |
| | | private CommandBuilder1126() { |
| | | |
| | | } |
| | | |
| | | public static CommandBuilder1126 getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | public Message buildMessage(GrainSerConfRequest request) { |
| | | |
| | | Message message = new Message(); |
| | | |
| | | message.setBegin(ServerUtils.MSG_START); |
| | | |
| | | // è°æ´Message头é¨ä¿¡æ¯ |
| | | buildHeader(message, request); |
| | | |
| | | // å
å¤´æ ¡éª |
| | | buildCrc8(message); |
| | | |
| | | // åå»ºæ¶æ¯ä½ |
| | | buildBody(message, request); |
| | | |
| | | // æ·»å æ ¡éª |
| | | buildCrc16(message); |
| | | |
| | | message.setEnd(ServerUtils.MSG_END); |
| | | |
| | | // çææ´ä½å½ä»¤ä¿¡æ¯åBYteä¿¡æ¯ |
| | | build(message); |
| | | |
| | | return message; |
| | | } |
| | | |
| | | public void buildHeader(Message message, GrainSerConfRequest request) { |
| | | String hexCompanyId = BytesUtil.getTargetId(request.getCompanyId(), |
| | | true); |
| | | hexCompanyId = BytesUtil.tran_LH(hexCompanyId); |
| | | |
| | | message.setSourceId(hexCompanyId); |
| | | message.setSendId(hexCompanyId); |
| | | message.setCompanyId(hexCompanyId); |
| | | |
| | | message.setTargetId(BytesUtil.tran_LH(BytesUtil.getTargetId( |
| | | request.getSerId(), true))); |
| | | message.setMessageType(BytesUtil.tran_LH(ServerUtils.MSG_TYPE_1126)); |
| | | } |
| | | |
| | | public void buildBody(Message message, GrainSerConfRequest request) { |
| | | MessageBody body = new MessageBody(); |
| | | body.setLength(5); |
| | | StringBuilder bodyStr = new StringBuilder(); |
| | | // ä¿®æ¹æ è¯ |
| | | bodyStr.append(BytesUtil.toHexString(request.getEditTag())); |
| | | // ééå· |
| | | bodyStr.append(BytesUtil.toHexString(request.getPassCode())); |
| | | // åå· |
| | | bodyStr.append(BytesUtil.toHexString(request.getEditCol())); |
| | | |
| | | // ç¹åºå·/åæ ¹å·/èµ·å§æ ¹å·/æ ¹åºå· |
| | | // æ°ç¹å·/æ°æ ¹å·/çµç¼å±æ°/æ°æ ¹å· |
| | | if (6 == request.getEditTag()) { |
| | | bodyStr.append(BytesUtil.toHexString(request.getValue1())); |
| | | bodyStr.append(BytesUtil.toHexString(request.getValue2())); |
| | | } else if (5 == request.getEditTag()) { |
| | | bodyStr.append(BytesUtil.toHexString(request.getValue1())); |
| | | bodyStr.append(BytesUtil.toHexString(request.getValue2())); |
| | | } else if (4 == request.getEditTag()) { |
| | | bodyStr.append(BytesUtil.toHexString(request.getValue1())); |
| | | bodyStr.append(BytesUtil.toHexString(request.getValue2())); |
| | | } else if (2 == request.getEditTag()) { |
| | | bodyStr.append(BytesUtil.toHexString(request.getValue1())); |
| | | bodyStr.append(BytesUtil.toHexString(request.getValue2())); |
| | | } else { |
| | | bodyStr.append("00"); |
| | | bodyStr.append("00"); |
| | | } |
| | | |
| | | body.setContent(bodyStr.toString()); |
| | | message.setBody(body); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.CheckThRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.command.message.MessageBody; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | |
| | | |
| | | /** |
| | | * 仿¸©ä»æ¹¿å½ä»¤ |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class CommandBuilder1128 extends CommandBuilder { |
| | | |
| | | |
| | | private final static CommandBuilder1128 instance = new CommandBuilder1128(); |
| | | |
| | | private CommandBuilder1128() { |
| | | |
| | | } |
| | | |
| | | public static CommandBuilder1128 getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | public Message buildMessage(CheckThRequest request) { |
| | | |
| | | Message message = new Message(); |
| | | |
| | | message.setBegin(ServerUtils.MSG_START); |
| | | |
| | | // è°æ´Message头é¨ä¿¡æ¯ |
| | | buildHeader(message, request); |
| | | |
| | | //å
å¤´æ ¡éª |
| | | buildCrc8(message); |
| | | |
| | | // åå»ºæ¶æ¯ä½ |
| | | buildBody(message, request); |
| | | |
| | | // æ·»å æ ¡éª |
| | | buildCrc16(message); |
| | | |
| | | message.setEnd(ServerUtils.MSG_END); |
| | | |
| | | // çææ´ä½å½ä»¤ä¿¡æ¯åBYteä¿¡æ¯ |
| | | build(message); |
| | | |
| | | return message; |
| | | } |
| | | |
| | | public void buildHeader(Message message, CheckThRequest request) { |
| | | String hexCompanyId = BytesUtil.getTargetId(request.getCompanyId(), true); |
| | | hexCompanyId = BytesUtil.tran_LH(hexCompanyId); |
| | | |
| | | message.setSourceId(hexCompanyId); |
| | | message.setSendId(hexCompanyId); |
| | | message.setCompanyId(hexCompanyId); |
| | | |
| | | message.setTargetId(BytesUtil.tran_LH(BytesUtil.getTargetId(request.getSerId(), true))); |
| | | message.setMessageType(BytesUtil.tran_LH(ServerUtils.MSG_TYPE_1128)); |
| | | } |
| | | |
| | | |
| | | public void buildBody(Message message, CheckThRequest request) { |
| | | MessageBody body = new MessageBody(); |
| | | body.setLength(2); |
| | | body.setContent(BytesUtil.tran_LH(BytesUtil.getTargetId(request.getThConf(), true))); |
| | | message.setBody(body); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.BaseRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | |
| | | |
| | | /** |
| | | * ç²®æ
ä¿¡æ¯å½ä»¤ |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class CommandBuilder8815 extends CommandBuilder { |
| | | |
| | | |
| | | private final static CommandBuilder8815 instance = new CommandBuilder8815(); |
| | | |
| | | private CommandBuilder8815() { |
| | | |
| | | } |
| | | |
| | | public static CommandBuilder8815 getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | |
| | | public void buildHeader(Message message, BaseRequest request) { |
| | | String hexCompanyId = BytesUtil.getTargetId(request.getCompanyId(),true); |
| | | hexCompanyId = BytesUtil.tran_LH(hexCompanyId); |
| | | |
| | | message.setSourceId(hexCompanyId); |
| | | message.setSendId(hexCompanyId); |
| | | message.setCompanyId(hexCompanyId); |
| | | |
| | | message.setTargetId(BytesUtil.tran_LH(BytesUtil.getTargetId(request.getSerId(), true))); |
| | | |
| | | message.setMessageType(BytesUtil.tran_LH(ServerUtils.MSG_TYPE_8815)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.BaseRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.command.message.MessageBody; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | |
| | | |
| | | /** |
| | | * ç²®æ
ä¿¡æ¯å½ä»¤ |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class CommandBuilder8817 extends CommandBuilder { |
| | | |
| | | |
| | | private final static CommandBuilder8817 instance = new CommandBuilder8817(); |
| | | |
| | | private CommandBuilder8817() { |
| | | |
| | | } |
| | | |
| | | public static CommandBuilder8817 getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | |
| | | public void buildHeader(Message message, BaseRequest request) { |
| | | |
| | | //request.setCompanyId("1"); |
| | | |
| | | String hexCompanyId = BytesUtil.getTargetId(request.getCompanyId(),true); |
| | | hexCompanyId = BytesUtil.tran_LH(hexCompanyId); |
| | | |
| | | message.setSourceId(hexCompanyId); |
| | | message.setSendId(hexCompanyId); |
| | | message.setCompanyId(hexCompanyId); |
| | | |
| | | message.setTargetId(BytesUtil.tran_LH(BytesUtil.getTargetId(request.getSerId(), true))); |
| | | |
| | | message.setMessageType(BytesUtil.tran_LH(ServerUtils.MSG_TYPE_8817)); |
| | | } |
| | | |
| | | |
| | | public void buildBody(Message message, BaseRequest request) { |
| | | MessageBody body = new MessageBody(); |
| | | body.setContent(request.getBizType()); |
| | | body.setLength(1); |
| | | message.setBody(body); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.GrainSerConfRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.command.message.MessageBody; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | |
| | | /** |
| | | * ç²®æ
åæº-çµç¼æ±æ» |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class CommandBuilder8829 extends CommandBuilder { |
| | | |
| | | private final static CommandBuilder8829 instance = new CommandBuilder8829(); |
| | | |
| | | private CommandBuilder8829() { |
| | | |
| | | } |
| | | |
| | | public static CommandBuilder8829 getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | public Message buildMessage(GrainSerConfRequest request) { |
| | | |
| | | Message message = new Message(); |
| | | |
| | | message.setBegin(ServerUtils.MSG_START); |
| | | |
| | | // è°æ´Message头é¨ä¿¡æ¯ |
| | | buildHeader(message, request); |
| | | |
| | | // å
å¤´æ ¡éª |
| | | buildCrc8(message); |
| | | |
| | | // åå»ºæ¶æ¯ä½ |
| | | buildBody(message, request); |
| | | |
| | | // æ·»å æ ¡éª |
| | | buildCrc16(message); |
| | | |
| | | message.setEnd(ServerUtils.MSG_END); |
| | | |
| | | // çææ´ä½å½ä»¤ä¿¡æ¯åBYteä¿¡æ¯ |
| | | build(message); |
| | | |
| | | return message; |
| | | } |
| | | |
| | | public void buildHeader(Message message, GrainSerConfRequest request) { |
| | | String hexCompanyId = BytesUtil.getTargetId(request.getCompanyId(), |
| | | true); |
| | | hexCompanyId = BytesUtil.tran_LH(hexCompanyId); |
| | | |
| | | message.setSourceId(hexCompanyId); |
| | | message.setSendId(hexCompanyId); |
| | | message.setCompanyId(hexCompanyId); |
| | | |
| | | message.setTargetId(BytesUtil.tran_LH(BytesUtil.getTargetId( |
| | | request.getSerId(), true))); |
| | | |
| | | message.setMessageType(BytesUtil.tran_LH(ServerUtils.MSG_TYPE_8829)); |
| | | } |
| | | |
| | | public void buildBody(Message message, GrainSerConfRequest request) { |
| | | MessageBody body = new MessageBody(); |
| | | body.setLength(1); |
| | | body.setContent(BytesUtil.toHexString(request.getValue1())); |
| | | message.setBody(body); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.builder; |
| | | |
| | | import com.ld.igds.io.request.BaseRequest; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.command.message.MessageBody; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | |
| | | /** |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class OnLineCommandBuilder extends CommandBuilder { |
| | | |
| | | private final static OnLineCommandBuilder instance = new OnLineCommandBuilder(); |
| | | |
| | | private OnLineCommandBuilder() { |
| | | |
| | | } |
| | | |
| | | public static OnLineCommandBuilder getInstance() { |
| | | return instance; |
| | | } |
| | | |
| | | public void buildHeader(Message message, BaseRequest request) { |
| | | message.setSourceId("0000"); |
| | | message.setSendId("0000"); |
| | | message.setCompanyId("0000"); |
| | | message.setTargetId("FFFF"); |
| | | message.setMessageType(BytesUtil.tran_LH(ServerUtils.MSG_TYPE_1116)); |
| | | } |
| | | |
| | | public void buildBody(Message message, BaseRequest request) { |
| | | MessageBody body = new MessageBody(); |
| | | body.setContent("0000000000000000000000000000"); |
| | | body.setLength(14); |
| | | message.setBody(body); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.message; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å符串å¼åéç¨åå
è¿å¶ï¼æ¹ä¾¿æ ¡éªåå¼å |
| | | */ |
| | | @Data |
| | | public class Message { |
| | | |
| | | private String begin; |
| | | |
| | | private String sourceId;// æº ID |
| | | |
| | | private String targetId="FFFF";// ç®æ ID |
| | | |
| | | private String sendId;//åéè
ID |
| | | |
| | | private String gateway1 = "0100";//è·¯ç±1 |
| | | |
| | | private String gateway2 = "0000";//è·¯ç±2 |
| | | |
| | | private String messageType;// æ¶æ¯ç±»å |
| | | |
| | | private String result ="00";// å¤çç»æ |
| | | |
| | | private String companyId;// ç»ç»ç¼ç |
| | | |
| | | private String hexCrc8;//crc8å
å¤´æ ¡éª |
| | | |
| | | private MessageBody body; |
| | | |
| | | private String hexCrc16;//crc16æ ¡éª |
| | | |
| | | private String end; |
| | | |
| | | private byte[] byteMsg;// å½åå½ä»¤çåèä¿¡æ¯ |
| | | |
| | | private String strMsg;// å½åå½ä»¤è½¬æ¢ä¸ºå符串çä¿¡æ¯ |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Message [sourceId=" + sourceId |
| | | + ", targetId=" + targetId |
| | | + ", messageType=" + messageType |
| | | + ", result=" + result + ", companyId=" + companyId |
| | | + ", hexCrc8=" + hexCrc8 + ", body=" + body + ", hexCrc16=" |
| | | + hexCrc16 + ", strMsg=" + strMsg + "]"; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.command.message; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class MessageBody { |
| | | |
| | | //é»è®¤10è¿å¶é¿åº¦ |
| | | private int length = 0; |
| | | |
| | | //æ¶æ¯ä½å
容 |
| | | private String content = ""; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.mq; |
| | | |
| | | import com.ld.igds.io.constant.ProtocolEnum; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * æ§å¶ç»ç«¯ä½ä¸ºåå¸è
åå¸ä¿¡æ¯ï¼æå¡ç«¯ä½ä¸ºè®¢é
è
订é
ï¼ééå®ä¹ä¸ºå½ååè®®ç¼ç |
| | | */ |
| | | @Slf4j |
| | | @Component(PublisherControl.BEAN_ID) |
| | | public class PublisherControl { |
| | | |
| | | public static final String BEAN_ID = "zldz.redisPublisher"; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | |
| | | /** |
| | | * æ£å¸¸è¿åä¿¡æ¯è·å |
| | | * |
| | | * @param reMessage |
| | | */ |
| | | public void publishMessage(String reMessage) { |
| | | redisTemplate.convertAndSend(ProtocolEnum.TCP_ZLDZ_GRAIN_V1.getCode(), reMessage); |
| | | log.debug("-----------æ¥æä¿¡æ¯åå
¥éå------{}", reMessage); |
| | | } |
| | | |
| | | /** |
| | | * ç»å½ä¿¡æ¯è·å |
| | | * |
| | | * @param sessionKey |
| | | */ |
| | | public void publishLoginMessage(String sessionKey) { |
| | | redisTemplate.convertAndSend(ProtocolEnum.TCP_ZLDZ_GRAIN_V1.getCode() + "_LOGIN", sessionKey); |
| | | log.debug("-----------ç»å½ä¿¡æ¯åå
¥éå------{}", sessionKey); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.mq; |
| | | |
| | | import com.ld.igds.io.request.BaseRequest; |
| | | import com.ld.igds.protocol.zldz.analysis.AnalysisService; |
| | | import com.ld.igds.protocol.zldz.command.builder.OnLineCommandBuilder; |
| | | import com.ld.igds.protocol.zldz.command.message.Message; |
| | | import com.ld.igds.protocol.zldz.server.ZldzServerEngine; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.io.api.InvokeResult; |
| | | import com.ld.io.api.IoSession; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.RandomUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.concurrent.CountDownLatch; |
| | | |
| | | /** |
| | | * æ¥ææ¥åå°åå¤ç |
| | | */ |
| | | @Slf4j |
| | | public class ReceiverServer { |
| | | |
| | | private CountDownLatch latch; |
| | | |
| | | @Autowired |
| | | public ReceiverServer(CountDownLatch latch) { |
| | | this.latch = latch; |
| | | } |
| | | |
| | | @Autowired |
| | | private AnalysisService analysisService; |
| | | |
| | | |
| | | |
| | | |
| | | public void onMessage(String message) { |
| | | message = message.replaceAll("\"", ""); |
| | | log.info("-------è·åéåä¿¡æ¯---" + message); |
| | | try { |
| | | String[] attr = message.split("_"); |
| | | String sessionKey = attr[0]; |
| | | String msg = attr[1]; |
| | | analysisService.analysis2(sessionKey, msg); |
| | | } catch (Exception e) { |
| | | latch.countDown(); |
| | | log.error("[æ£æ¥çµå--æ¶æ¯éåæ°æ®å¤±è´¥ï¼å¤±è´¥ä¿¡æ¯:{}]", e.getMessage(),e); |
| | | } |
| | | latch.countDown(); |
| | | } |
| | | |
| | | |
| | | public void onLoginMessage(String sessionKey) { |
| | | log.info("-------è·åç»å½éåä¿¡æ¯---{}", sessionKey); |
| | | try { |
| | | sessionKey = sessionKey.replaceAll("\"", ""); |
| | | String[] attr = sessionKey.split(":"); |
| | | IoSession session = ZldzServerEngine.getSession(attr[0],Integer.valueOf(attr[1])); |
| | | |
| | | if (null == session) { |
| | | log.warn("---------------没æè·åå°ä¼è¯ä¿¡æ¯-------------{}", sessionKey); |
| | | latch.countDown(); |
| | | return; |
| | | } |
| | | |
| | | long l = RandomUtils.nextInt(1000, 9999); |
| | | Thread.sleep(l); |
| | | |
| | | BaseRequest request = new BaseRequest(); |
| | | request.setIp(session.getAddress()); |
| | | request.setPort(session.getPort()); |
| | | request.setCompanyId(ServerUtils.DEFAULT_COMPANY); |
| | | |
| | | // Step1 çæå¨çº¿æµè¯å½ä»¤ |
| | | Message message = OnLineCommandBuilder.getInstance().buildMessage(request); |
| | | // åéå½ä»¤ |
| | | InvokeResult result = session.invoke(message.getByteMsg()); |
| | | |
| | | //妿å½ä»¤åé失败ï¼ç´æ¥è¸¢æè¿æ¥ |
| | | if (!InvokeResult.SUCCESS.getCode().equals(result.getCode())) { |
| | | session.destroy(); |
| | | } |
| | | } catch (Exception e) { |
| | | latch.countDown(); |
| | | log.error("[æ£æ¥çµå--ç»å½æ¶æ¯éåæ°æ®å¤±è´¥ï¼å¤±è´¥ä¿¡æ¯:{}]", e.getMessage()); |
| | | } |
| | | latch.countDown(); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.mq; |
| | | |
| | | import com.ld.igds.io.constant.ProtocolEnum; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.data.redis.connection.RedisConnectionFactory; |
| | | import org.springframework.data.redis.listener.PatternTopic; |
| | | import org.springframework.data.redis.listener.RedisMessageListenerContainer; |
| | | import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; |
| | | |
| | | import java.util.concurrent.CountDownLatch; |
| | | |
| | | /** |
| | | * æ¶æ¯è®¢é
é
ç½® |
| | | */ |
| | | @Configuration |
| | | public class RedisSubConfig { |
| | | |
| | | /** |
| | | * åå»ºè¿æ¥å·¥å |
| | | * |
| | | * @param connectionFactory |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public RedisMessageListenerContainer container(RedisConnectionFactory connectionFactory, |
| | | MessageListenerAdapter adapter1, |
| | | MessageListenerAdapter adapter2) { |
| | | RedisMessageListenerContainer container = new RedisMessageListenerContainer(); |
| | | container.setConnectionFactory(connectionFactory); |
| | | |
| | | //çå¬å¯¹åºçchannel |
| | | container.addMessageListener(adapter1, new PatternTopic(ProtocolEnum.TCP_ZLDZ_GRAIN_V1.getCode())); |
| | | |
| | | //çå¬å¯¹åºçchannel |
| | | container.addMessageListener(adapter2, new PatternTopic(ProtocolEnum.TCP_ZLDZ_GRAIN_V1.getCode() + "_LOGIN")); |
| | | |
| | | return container; |
| | | } |
| | | |
| | | /** |
| | | * ç»å®æ¶æ¯çå¬è
忥æ¶çå¬çæ¹æ³ |
| | | * |
| | | * @param receiver |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public MessageListenerAdapter adapter1(ReceiverServer receiver) { |
| | | return new MessageListenerAdapter(receiver, "onMessage"); |
| | | } |
| | | |
| | | /** |
| | | * ç»å®æ¶æ¯çå¬è
忥æ¶çå¬çæ¹æ³ |
| | | * |
| | | * @param receiver |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public MessageListenerAdapter adapter2(ReceiverServer receiver) { |
| | | return new MessageListenerAdapter(receiver, "onLoginMessage"); |
| | | } |
| | | |
| | | |
| | | @Bean |
| | | ReceiverServer receiver(CountDownLatch latch) { |
| | | return new ReceiverServer(latch); |
| | | } |
| | | |
| | | |
| | | @Bean |
| | | public CountDownLatch latch() { |
| | | return new CountDownLatch(1);//æå®äºè®¡æ°çæ¬¡æ° 1 |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | /** |
| | | * æ£æ¥çµå-ç²®æ
åè®®V1 |
| | | * |
| | | */ |
| | | package com.ld.igds.protocol.zldz; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.server; |
| | | |
| | | import com.ld.igds.common.CoreSerService; |
| | | import com.ld.igds.models.DeviceSer; |
| | | import com.ld.igds.util.SpringUtil; |
| | | import com.ld.io.api.HeartbeatProvider; |
| | | import com.ld.io.api.IoSession; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | |
| | | /** |
| | | * å¿è·³ç»´æï¼éªè¯å½åè¿æ¥ä¸çIP卿å¡å¨ä¸é
ç½®çææ²¡æï¼å¦ææå表示æ£å¸¸è¿æ¥ï¼å¦ææ²¡æå踢é¤è¿æ¥ã |
| | | * <p> |
| | | * å¦æææ£å¸¸å¿è·³ï¼åå鿣叏å¿è·³å½ä»¤ï¼å¦ææ²¡æååé设å¤ç¶ææ¥è¯¢ï¼ |
| | | */ |
| | | @Slf4j |
| | | public class HeartbeatProviderImpl implements HeartbeatProvider { |
| | | |
| | | private CoreSerService serService; |
| | | |
| | | @Override |
| | | public byte[] provide(IoSession session) { |
| | | |
| | | log.debug("========ç³»ç»å¼å§æ§è¡å¿è·³=========={}---{}", session.getCompanyId(), session.getBusinessKey()); |
| | | |
| | | if (null == serService) { |
| | | serService = SpringUtil.getBean(CoreSerService.class); |
| | | } |
| | | |
| | | DeviceSer ser = null; |
| | | String companyId = session.getCompanyId(); |
| | | if (StringUtils.isNotEmpty(companyId)) { |
| | | ser = serService.getCacheSerByIp(companyId, session.getAddress(), session.getPort()); |
| | | } |
| | | |
| | | if (null == ser) { |
| | | log.error("========å¿è·³æ§è¡æ²¡æè·åå°åæºä¿¡æ¯======IP={}-{}ï¼åæ¶è¸¢åºï¼åªåæ¥å¿æéã", session.getAddress(), session.getPort()); |
| | | session.destroy(); |
| | | return null; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.server; |
| | | |
| | | import com.ld.igds.protocol.zldz.mq.PublisherControl; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | import com.ld.igds.util.SpringUtil; |
| | | import com.ld.io.api.IoMsgConsumer; |
| | | import com.ld.io.api.IoSession; |
| | | |
| | | /** |
| | | * æ¥æ¶ç»ç«¯è¿å忥çä¿¡æ¯ã |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class MsgConsumer implements IoMsgConsumer { |
| | | |
| | | // private AnalysisService analysisService; |
| | | |
| | | private PublisherControl publisherControl; |
| | | |
| | | @Override |
| | | public void consume(IoSession session, byte[] bytes) { |
| | | |
| | | // è°ç¨è§£ææ¥å£å¼å§è§£æ |
| | | // if(null == analysisService){ |
| | | // analysisService = (AnalysisService) |
| | | // SpringUtil.getBean(AnalysisService.BEAN_ID); |
| | | // } |
| | | // analysisService.analysis(session.getAddress(),session.getPort(),bytes); |
| | | |
| | | // 2021å¹´6æ9æ¥ è°æ´ä¸ºæ¶æ¯éåå¤ç |
| | | if (null == publisherControl) { |
| | | publisherControl = SpringUtil.getBean(PublisherControl.class); |
| | | } |
| | | |
| | | String strMsg = BytesUtil.bytesToString(bytes) + ServerUtils.MSG_END; |
| | | |
| | | // äºæ¬¡è°æ´æ¥æ |
| | | if (!strMsg.startsWith(ServerUtils.MSG_START)) { |
| | | strMsg = strMsg.substring(strMsg.indexOf(ServerUtils.MSG_START)); |
| | | } |
| | | |
| | | publisherControl.publishMessage(session.getBusinessKey() + "_" + strMsg); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.server; |
| | | |
| | | import com.ld.igds.io.notify.ServerNotifyInvoker; |
| | | import com.ld.igds.protocol.zldz.command.BaseRemoteImpl; |
| | | import com.ld.igds.protocol.zldz.mq.PublisherControl; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.SpringUtil; |
| | | import com.ld.io.api.IoSession; |
| | | import com.ld.io.api.IoSessionListener; |
| | | |
| | | public class SessionListener extends BaseRemoteImpl implements IoSessionListener { |
| | | |
| | | public static final String BEAN_ID = "zldz.sessionListener"; |
| | | |
| | | private ServerNotifyInvoker serverNotifyInvoker; |
| | | |
| | | private PublisherControl publisherControl; |
| | | |
| | | @Override |
| | | public void onCreate(IoSession session) { |
| | | |
| | | // æ·»å èªå®ä¹ä¸å¡ID |
| | | session.setBusinessKey(ServerUtils.getServerKey(session.getAddress(), session.getPort())); |
| | | |
| | | //2021å¹´6æ9æ¥ è°æ´ä½¿ç¨ä¸ºéå |
| | | if (null == publisherControl) { |
| | | publisherControl = SpringUtil.getBean(PublisherControl.class); |
| | | } |
| | | publisherControl.publishLoginMessage(session.getBusinessKey()); |
| | | } |
| | | |
| | | @Override |
| | | public void onDestroy(IoSession session) { |
| | | if (null == serverNotifyInvoker) { |
| | | serverNotifyInvoker = SpringUtil.getBean(ServerNotifyInvoker.class); |
| | | } |
| | | serverNotifyInvoker.connectDestory(session.getBusinessKey(), |
| | | session.getAddress(), session.getPort()); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.server; |
| | | |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.BytesUtil; |
| | | import com.ld.io.api.*; |
| | | import com.ld.io.netty.NettyServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é
置主æå¡ä¿¡æ¯ |
| | | * |
| | | * @author Andy 2019å¹´10æ4æ¥ æ°å¢ |
| | | */ |
| | | @Slf4j |
| | | public class ZldzServerEngine { |
| | | |
| | | public static final int PORT = 8000; |
| | | |
| | | public static NettyServer ioServer = null; |
| | | // é
ç½®æ¶æ¯æ¥æ¶ç±» |
| | | private static MsgConsumer messageConsume = new MsgConsumer(); |
| | | // çå¬ä¼è¯çå建ä¸éæ¯ |
| | | private static SessionListener ioSessionListener = new SessionListener(); |
| | | |
| | | // å¿è·³æä¾ ï¼è¯¥æå¡ä¸éè¦å¿è·³ç»´æ |
| | | private static HeartbeatProvider heartbeatProvider = new HeartbeatProviderImpl(); |
| | | |
| | | |
| | | public static void start() { |
| | | start(PORT); |
| | | } |
| | | |
| | | public static void start(int port) { |
| | | // é
ç½®Serverçé
ç½® |
| | | IoServerOption ioServerOption = new IoServerOption(port); |
| | | |
| | | ioServerOption.setSplitDecoderType(SplitByteDecoderType.DELIMITER_SYMBOL); |
| | | ioServerOption.setDelimiter(BytesUtil.hexStrToBytes(ServerUtils.MSG_END)); |
| | | |
| | | // é
ç½®å¿è·³æ§è¡æ¶é´ |
| | | ioServerOption.setReaderIdleTime(60 * 60); |
| | | |
| | | ioServer = new NettyServer(ioServerOption, messageConsume, ioSessionListener, heartbeatProvider); |
| | | |
| | | ioServer.startup(); |
| | | |
| | | log.info("* ========================"); |
| | | log.info("* "); |
| | | log.info("* 纯粮æ
åè®®ï¼ç«¯å£å·={}", port); |
| | | log.info("* "); |
| | | log.info("* ========================"); |
| | | |
| | | |
| | | System.out.println("* ========================"); |
| | | System.out.println("* "); |
| | | System.out.println("* 纯粮æ
åè®®ï¼ç«¯å£å·=" + port); |
| | | System.out.println("* "); |
| | | System.out.println("* ========================"); |
| | | } |
| | | |
| | | /** |
| | | * åéä¿¡æ¯ |
| | | * |
| | | * @param ip |
| | | * @param port |
| | | * @param msg |
| | | * @return |
| | | */ |
| | | public static InvokeResult push(String ip, int port, byte[] msg) { |
| | | IoSession session = getSession(ip, port); |
| | | if (null == session) { |
| | | return InvokeResult.CHANNEL_CLOSED; |
| | | } |
| | | return session.invoke(msg); |
| | | } |
| | | |
| | | /** |
| | | * 主å¨éæ¯å½åè¿æ¥ |
| | | * |
| | | * @param ip |
| | | * @param port |
| | | * @return |
| | | */ |
| | | public static InvokeResult destory(String ip, int port) { |
| | | IoSession session = getSession(ip, port); |
| | | |
| | | if (null == session) { |
| | | return InvokeResult.SUCCESS; |
| | | } |
| | | // æ§è¡è¿æ¥éæ¯ |
| | | session.destroy(); |
| | | return InvokeResult.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®SessionKeyè·åSessionä¿¡æ¯ |
| | | * |
| | | * @param ip |
| | | * @return |
| | | */ |
| | | public static IoSession getSession(String ip, int port) { |
| | | IoSessionQuery sessionFactory = ioServer.getSessionQuery(); |
| | | List<IoSession> sessions = sessionFactory.getAllSession(); |
| | | for (IoSession ioSession : sessions) { |
| | | if (ip.equals(ioSession.getAddress()) && port == ioSession.getPort()) { |
| | | return ioSession; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.task; |
| | | |
| | | import com.ld.igds.io.request.CheckGrainRequest; |
| | | import com.ld.igds.io.request.CheckThRequest; |
| | | import com.ld.igds.protocol.zldz.command.BaseRemoteImpl; |
| | | import com.ld.igds.protocol.zldz.util.ServerUtils; |
| | | import com.ld.igds.util.RedisUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.FutureTask; |
| | | |
| | | /** |
| | | * å½ä»¤éå |
| | | */ |
| | | @Slf4j |
| | | @Component(CommandReSendService.BEAN_ID) |
| | | public class CommandReSendService extends BaseRemoteImpl { |
| | | |
| | | public static final String BEAN_ID = "zldz.commandReSendService"; |
| | | |
| | | public static final String REDIS_KEY_RESEND_COMMAND = "REDIS_KEY_RESEND_COMMAND"; |
| | | |
| | | public static final String REDIS_KEY_TH_QUEEN = "REDIS_KEY_TH_QUEEN"; |
| | | |
| | | public static final int REDIS_KEY_TIME = 4 * 60; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | public String buildKey(CommandTask data) { |
| | | return buildKey(data.getCompanyId(), data.getIp(), data.getPort(), |
| | | data.getResultType()); |
| | | } |
| | | |
| | | public String buildKey(String companyId, String ip, int port, |
| | | String resultType) { |
| | | String key = ip + "." + port + ":" + resultType; |
| | | return companyId + ":" + REDIS_KEY_RESEND_COMMAND + ":" + key; |
| | | } |
| | | |
| | | public void reSendTask(CommandTask data) { |
| | | // ç¼å |
| | | redisUtil.set(buildKey(data), data, REDIS_KEY_TIME); |
| | | |
| | | // å建åä»»å¡ |
| | | FutureTask<String> futureTask = new FutureTask<>(new ReSendCommonTask(data, redisUtil, buildKey(data))); |
| | | ExecutorService executorService = Executors.newCachedThreadPool(); |
| | | executorService.submit(futureTask); |
| | | executorService.shutdown(); |
| | | } |
| | | |
| | | // 温湿度å½ä»¤ä¸ä½¿ç¨åä»»å¡ |
| | | public void reSendThTask(CommandTask data) { |
| | | // ç¼å |
| | | redisUtil.set(buildKey(data), data, REDIS_KEY_TIME); |
| | | } |
| | | |
| | | public void reSendGrainTask(CommandTask data) { |
| | | // ç¼å |
| | | redisUtil.set(buildKey(data), data, REDIS_KEY_TIME); |
| | | |
| | | // å建åä»»å¡ |
| | | FutureTask<String> futureTask = new FutureTask<>(new ReSendGrainTask( |
| | | data, redisUtil, buildKey(data))); |
| | | ExecutorService executorService = Executors.newCachedThreadPool(); |
| | | executorService.submit(futureTask); |
| | | executorService.shutdown(); |
| | | } |
| | | |
| | | public void cleanKey(String companyId, String ip, int port, |
| | | String resultType) { |
| | | |
| | | String key = buildKey(companyId, ip, port, resultType); |
| | | redisUtil.del(key); |
| | | } |
| | | |
| | | public void destoryAndDelCache(String companyId, String ip, Integer port, |
| | | String messageType) { |
| | | try { |
| | | // ç²®æ
ç´æ¥ä½¿ç¨ææ»çç¶æè¿å |
| | | if (messageType.equals(ServerUtils.MSG_TYPE_1115)) { |
| | | messageType = ServerUtils.MSG_TYPE_8817; |
| | | } |
| | | this.cleanKey(companyId, ip, port, messageType); |
| | | |
| | | //é´é5S踢åºï¼é¿å
å¿«éç´æ¥è¿æ¥ |
| | | Thread.sleep(5 * 1000); |
| | | |
| | | super.destory(ip, port); |
| | | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public void reSend(String companyId, String ip, int port, String resultType) { |
| | | String key = buildKey(companyId, ip, port, resultType); |
| | | CommandTask commandData = (CommandTask) redisUtil.get(key); |
| | | if (null != commandData) { |
| | | super.send(ip, port, commandData.getByteCommand()); |
| | | } else { |
| | | log.error("å½ä»¤éå失败ï¼{}-{}-{}没æè·åå°å½ä»¤ã", ip, port, resultType); |
| | | } |
| | | } |
| | | |
| | | public CommandTask getRedisCommand(String companyId, String ip, |
| | | Integer port, String resultType) { |
| | | String key = this.buildKey(companyId, ip, port, resultType); |
| | | return (CommandTask) redisUtil.get(key); |
| | | } |
| | | |
| | | /** |
| | | * å½ååæºç¸åç²®æ
åæºççå¾
éå |
| | | * |
| | | * @param thRequest |
| | | * @param request |
| | | */ |
| | | public void addToThQueen(CheckThRequest thRequest, CheckGrainRequest request) { |
| | | String key = thRequest.getCompanyId() + ":" + REDIS_KEY_TH_QUEEN + ":" |
| | | + thRequest.getSerId(); |
| | | |
| | | List<CheckGrainRequest> list = this.getThQueen( |
| | | thRequest.getCompanyId(), thRequest.getSerId()); |
| | | if (null == list) { |
| | | list = new ArrayList<>(); |
| | | } |
| | | |
| | | list.add(request); |
| | | |
| | | redisUtil.set(key, list, 60); |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | public List<CheckGrainRequest> getThQueen(String companyId, String serId) { |
| | | String key = companyId + ":" + REDIS_KEY_TH_QUEEN + ":" + serId; |
| | | return (List<CheckGrainRequest>) redisUtil.get(key); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.task; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ç¨äºåæ¾åéçå½ä»¤ä¿¡æ¯ï¼åæ¾å°ç¼åä¸ |
| | | */ |
| | | @Data |
| | | public class CommandTask { |
| | | |
| | | private String companyId; |
| | | |
| | | private String depotId;//æ§è¡ä»åº |
| | | |
| | | private String serName; |
| | | |
| | | private String ip = ""; |
| | | |
| | | private int port = 0; |
| | | |
| | | private String command; //åéçå½ä»¤ |
| | | |
| | | private byte[] byteCommand; //åéçå½ä»¤ |
| | | |
| | | private String resultType;//çå¾
è¿åçå½ä»¤ç±»å |
| | | |
| | | private int sendNum = 1;//å鿬¡æ° |
| | | |
| | | private String cableRule; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.task; |
| | | |
| | | import com.ld.igds.protocol.zldz.command.BaseRemoteImpl; |
| | | import com.ld.igds.util.RedisUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.concurrent.Callable; |
| | | |
| | | /** |
| | | * åä»»å¡ï¼ç¨äºå¤æéååå¼å¸¸å¤çï¼å½ä»¤åéåå°å½ä»¤ä¿¡æ¯åæ¾ç¼åï¼å½å |
| | | * |
| | | * @author andy.jia |
| | | */ |
| | | @Slf4j |
| | | public class ReSendCommonTask extends BaseRemoteImpl implements Callable<String> { |
| | | |
| | | private CommandTask commandData; |
| | | |
| | | private RedisUtil redisUtil; |
| | | |
| | | private String redisKey; |
| | | |
| | | public RedisUtil getRedisUtil() { |
| | | return redisUtil; |
| | | } |
| | | |
| | | public void setRedisUtil(RedisUtil redisUtil) { |
| | | this.redisUtil = redisUtil; |
| | | } |
| | | |
| | | public String getRedisKey() { |
| | | return redisKey; |
| | | } |
| | | |
| | | public void setRedisKey(String redisKey) { |
| | | this.redisKey = redisKey; |
| | | } |
| | | |
| | | public void setCommandData(CommandTask commandData) { |
| | | this.commandData = commandData; |
| | | } |
| | | |
| | | public CommandTask getCommandData() { |
| | | return commandData; |
| | | } |
| | | |
| | | public ReSendCommonTask() { |
| | | super(); |
| | | } |
| | | |
| | | public ReSendCommonTask(CommandTask commandData, RedisUtil redisUtil, String redisKey) { |
| | | super(); |
| | | this.commandData = commandData; |
| | | this.redisUtil = redisUtil; |
| | | this.redisKey = redisKey; |
| | | } |
| | | |
| | | @Override |
| | | public String call() throws Exception { |
| | | |
| | | //1,è·åç¼åä¸ä¿¡æ¯ |
| | | Thread.sleep(15 * 1000); |
| | | |
| | | CommandTask redisData = (CommandTask) redisUtil.get(redisKey); |
| | | if (null == redisData) { |
| | | return "å½ä»¤ç¬¬1次çå¾
ï¼ç»ç«¯å·²ç»æ£å¸¸è¿å"; |
| | | } else { |
| | | log.info("{}-第1次å½ä»¤è¡¥åå½ä»¤={}", commandData.getIp(), commandData.getCommand()); |
| | | super.send(commandData.getIp(), commandData.getPort(), commandData.getByteCommand()); |
| | | } |
| | | |
| | | //2ï¼çå¾
20S |
| | | Thread.sleep(15 * 1000); |
| | | redisData = (CommandTask) redisUtil.get(redisKey); |
| | | if (null == redisData) { |
| | | return "å½ä»¤ç¬¬2次ççï¼ç»ç«¯å·²ç»æ£å¸¸è¿å"; |
| | | } else { |
| | | log.info("{}-第2次å½ä»¤è¡¥å½ä»¤={}", commandData.getIp(), commandData.getCommand()); |
| | | super.send(commandData.getIp(), commandData.getPort(), commandData.getByteCommand()); |
| | | } |
| | | |
| | | //2ï¼çå¾
20S |
| | | Thread.sleep(15 * 1000); |
| | | redisData = (CommandTask) redisUtil.get(redisKey); |
| | | if (null == redisData) { |
| | | return "å½ä»¤ç¬¬3次ççï¼ç»ç«¯å·²ç»æ£å¸¸è¿å"; |
| | | } else { |
| | | log.info("{}-第3次å½ä»¤è¡¥ååï¼ä»ç¶æ²¡æè¿åï¼åæ¶çå¾
ã", commandData.getIp()); |
| | | //super.destory(commandData.getIp(), commandData.getPort()); |
| | | } |
| | | |
| | | return "å任塿§è¡å®æ"; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.task; |
| | | |
| | | import com.ld.igds.protocol.zldz.command.BaseRemoteImpl; |
| | | import com.ld.igds.util.RedisUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.concurrent.Callable; |
| | | |
| | | /** |
| | | * ç²®æ
åä»»å¡ï¼ç²®æ
åä»»å¡ï¼å¿½ç¥8815çåå¤å8817çåå¤ï¼ç´æ¥çç»æå
çå°è¾¾ï¼å¦æç»æå
没æå°è¾¾ï¼å°±éå¤åéç²®æ
è¯·æ± |
| | | * |
| | | * @author andy.jia |
| | | */ |
| | | @Slf4j |
| | | public class ReSendGrainTask extends BaseRemoteImpl implements Callable<String> { |
| | | |
| | | private CommandTask commandData; |
| | | |
| | | private RedisUtil redisUtil; |
| | | |
| | | private String redisKey; |
| | | |
| | | public RedisUtil getRedisUtil() { |
| | | return redisUtil; |
| | | } |
| | | |
| | | public void setRedisUtil(RedisUtil redisUtil) { |
| | | this.redisUtil = redisUtil; |
| | | } |
| | | |
| | | public String getRedisKey() { |
| | | return redisKey; |
| | | } |
| | | |
| | | public void setRedisKey(String redisKey) { |
| | | this.redisKey = redisKey; |
| | | } |
| | | |
| | | public void setCommandData(CommandTask commandData) { |
| | | this.commandData = commandData; |
| | | } |
| | | |
| | | public CommandTask getCommandData() { |
| | | return commandData; |
| | | } |
| | | |
| | | public ReSendGrainTask() { |
| | | super(); |
| | | } |
| | | |
| | | public ReSendGrainTask(CommandTask commandData, RedisUtil redisUtil, String redisKey) { |
| | | super(); |
| | | this.commandData = commandData; |
| | | this.redisUtil = redisUtil; |
| | | this.redisKey = redisKey; |
| | | } |
| | | |
| | | @Override |
| | | public String call() throws Exception { |
| | | |
| | | String[] attCable = commandData.getCableRule().split("-"); |
| | | int cableZ = Integer.valueOf(attCable[0]); |
| | | int cableY = Integer.valueOf(attCable[1]); |
| | | int cableX = Integer.valueOf(attCable[2]); |
| | | |
| | | int point = cableX * cableY * cableZ; |
| | | long time = point * 100 + (point / 100) * 500; |
| | | |
| | | //1,ç²®æ
第1次çå¾
æ¶é´ä¸ºééç¹ä¸ªæ°* 0.1 ç§ + 20ç§ï¼å¦ææ²¡ææ£å¸¸è¿åååéç¬¬äºæ¬¡å½ä»¤ã |
| | | Thread.sleep(time); |
| | | CommandTask redisData = (CommandTask) redisUtil.get(redisKey); |
| | | if (null == redisData) { |
| | | return "å½ä»¤ç¬¬1次çå¾
ï¼ç»ç«¯å·²ç»æ£å¸¸è¿å"; |
| | | } else { |
| | | String msg = commandData.getSerName() + " 第1次补åå½ä»¤=" + commandData.getCommand(); |
| | | log.info(msg); |
| | | |
| | | super.send(commandData.getIp(), commandData.getPort(), commandData.getByteCommand()); |
| | | } |
| | | |
| | | //2 |
| | | Thread.sleep(time); |
| | | redisData = (CommandTask) redisUtil.get(redisKey); |
| | | if (null == redisData) { |
| | | return "å½ä»¤ç¬¬2次ççï¼ç»ç«¯å·²ç»æ£å¸¸è¿å"; |
| | | } else { |
| | | String msg = commandData.getSerName() + " 第2次补åç²®æ
å½ä»¤ï¼æ²¡æè¿åï¼ç³»ç»æå¼å½åè¿æ¥ã"; |
| | | log.info(msg); |
| | | |
| | | // ExeOrderService orderService = SpringUtil.getBean(ExeOrderService.class); |
| | | // orderService.progressError(commandData.getCompanyId(), BizType.GRAIN, commandData.getDepotId(), msg); |
| | | |
| | | //2021å¹´6æ5æ¥ 07:30:22 åæ¶è¶
æ¶è¸¢åºè¿æ¥ |
| | | // super.destory(commandData.getIp(), commandData.getPort()); |
| | | } |
| | | return "å任塿§è¡å®æ"; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.util; |
| | | |
| | | /*** |
| | | * |
| | | * @author Andy |
| | | * |
| | | */ |
| | | public class CRC16 { |
| | | |
| | | static byte[] crc16_tab_h = { (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, (byte) 0x81, (byte) 0x40, (byte) 0x01, (byte) 0xC0, |
| | | (byte) 0x80, (byte) 0x41, (byte) 0x01, (byte) 0xC0, (byte) 0x80, (byte) 0x41, (byte) 0x00, (byte) 0xC1, |
| | | (byte) 0x81, (byte) 0x40 }; |
| | | |
| | | static byte[] crc16_tab_l = { (byte) 0x00, (byte) 0xC0, (byte) 0xC1, (byte) 0x01, (byte) 0xC3, (byte) 0x03, |
| | | (byte) 0x02, (byte) 0xC2, (byte) 0xC6, (byte) 0x06, (byte) 0x07, (byte) 0xC7, (byte) 0x05, (byte) 0xC5, |
| | | (byte) 0xC4, (byte) 0x04, (byte) 0xCC, (byte) 0x0C, (byte) 0x0D, (byte) 0xCD, (byte) 0x0F, (byte) 0xCF, |
| | | (byte) 0xCE, (byte) 0x0E, (byte) 0x0A, (byte) 0xCA, (byte) 0xCB, (byte) 0x0B, (byte) 0xC9, (byte) 0x09, |
| | | (byte) 0x08, (byte) 0xC8, (byte) 0xD8, (byte) 0x18, (byte) 0x19, (byte) 0xD9, (byte) 0x1B, (byte) 0xDB, |
| | | (byte) 0xDA, (byte) 0x1A, (byte) 0x1E, (byte) 0xDE, (byte) 0xDF, (byte) 0x1F, (byte) 0xDD, (byte) 0x1D, |
| | | (byte) 0x1C, (byte) 0xDC, (byte) 0x14, (byte) 0xD4, (byte) 0xD5, (byte) 0x15, (byte) 0xD7, (byte) 0x17, |
| | | (byte) 0x16, (byte) 0xD6, (byte) 0xD2, (byte) 0x12, (byte) 0x13, (byte) 0xD3, (byte) 0x11, (byte) 0xD1, |
| | | (byte) 0xD0, (byte) 0x10, (byte) 0xF0, (byte) 0x30, (byte) 0x31, (byte) 0xF1, (byte) 0x33, (byte) 0xF3, |
| | | (byte) 0xF2, (byte) 0x32, (byte) 0x36, (byte) 0xF6, (byte) 0xF7, (byte) 0x37, (byte) 0xF5, (byte) 0x35, |
| | | (byte) 0x34, (byte) 0xF4, (byte) 0x3C, (byte) 0xFC, (byte) 0xFD, (byte) 0x3D, (byte) 0xFF, (byte) 0x3F, |
| | | (byte) 0x3E, (byte) 0xFE, (byte) 0xFA, (byte) 0x3A, (byte) 0x3B, (byte) 0xFB, (byte) 0x39, (byte) 0xF9, |
| | | (byte) 0xF8, (byte) 0x38, (byte) 0x28, (byte) 0xE8, (byte) 0xE9, (byte) 0x29, (byte) 0xEB, (byte) 0x2B, |
| | | (byte) 0x2A, (byte) 0xEA, (byte) 0xEE, (byte) 0x2E, (byte) 0x2F, (byte) 0xEF, (byte) 0x2D, (byte) 0xED, |
| | | (byte) 0xEC, (byte) 0x2C, (byte) 0xE4, (byte) 0x24, (byte) 0x25, (byte) 0xE5, (byte) 0x27, (byte) 0xE7, |
| | | (byte) 0xE6, (byte) 0x26, (byte) 0x22, (byte) 0xE2, (byte) 0xE3, (byte) 0x23, (byte) 0xE1, (byte) 0x21, |
| | | (byte) 0x20, (byte) 0xE0, (byte) 0xA0, (byte) 0x60, (byte) 0x61, (byte) 0xA1, (byte) 0x63, (byte) 0xA3, |
| | | (byte) 0xA2, (byte) 0x62, (byte) 0x66, (byte) 0xA6, (byte) 0xA7, (byte) 0x67, (byte) 0xA5, (byte) 0x65, |
| | | (byte) 0x64, (byte) 0xA4, (byte) 0x6C, (byte) 0xAC, (byte) 0xAD, (byte) 0x6D, (byte) 0xAF, (byte) 0x6F, |
| | | (byte) 0x6E, (byte) 0xAE, (byte) 0xAA, (byte) 0x6A, (byte) 0x6B, (byte) 0xAB, (byte) 0x69, (byte) 0xA9, |
| | | (byte) 0xA8, (byte) 0x68, (byte) 0x78, (byte) 0xB8, (byte) 0xB9, (byte) 0x79, (byte) 0xBB, (byte) 0x7B, |
| | | (byte) 0x7A, (byte) 0xBA, (byte) 0xBE, (byte) 0x7E, (byte) 0x7F, (byte) 0xBF, (byte) 0x7D, (byte) 0xBD, |
| | | (byte) 0xBC, (byte) 0x7C, (byte) 0xB4, (byte) 0x74, (byte) 0x75, (byte) 0xB5, (byte) 0x77, (byte) 0xB7, |
| | | (byte) 0xB6, (byte) 0x76, (byte) 0x72, (byte) 0xB2, (byte) 0xB3, (byte) 0x73, (byte) 0xB1, (byte) 0x71, |
| | | (byte) 0x70, (byte) 0xB0, (byte) 0x50, (byte) 0x90, (byte) 0x91, (byte) 0x51, (byte) 0x93, (byte) 0x53, |
| | | (byte) 0x52, (byte) 0x92, (byte) 0x96, (byte) 0x56, (byte) 0x57, (byte) 0x97, (byte) 0x55, (byte) 0x95, |
| | | (byte) 0x94, (byte) 0x54, (byte) 0x9C, (byte) 0x5C, (byte) 0x5D, (byte) 0x9D, (byte) 0x5F, (byte) 0x9F, |
| | | (byte) 0x9E, (byte) 0x5E, (byte) 0x5A, (byte) 0x9A, (byte) 0x9B, (byte) 0x5B, (byte) 0x99, (byte) 0x59, |
| | | (byte) 0x58, (byte) 0x98, (byte) 0x88, (byte) 0x48, (byte) 0x49, (byte) 0x89, (byte) 0x4B, (byte) 0x8B, |
| | | (byte) 0x8A, (byte) 0x4A, (byte) 0x4E, (byte) 0x8E, (byte) 0x8F, (byte) 0x4F, (byte) 0x8D, (byte) 0x4D, |
| | | (byte) 0x4C, (byte) 0x8C, (byte) 0x44, (byte) 0x84, (byte) 0x85, (byte) 0x45, (byte) 0x87, (byte) 0x47, |
| | | (byte) 0x46, (byte) 0x86, (byte) 0x82, (byte) 0x42, (byte) 0x43, (byte) 0x83, (byte) 0x41, (byte) 0x81, |
| | | (byte) 0x80, (byte) 0x40 }; |
| | | |
| | | /** |
| | | * 计ç®CRC16æ ¡éª |
| | | * |
| | | * @param data |
| | | * éè¦è®¡ç®çæ°ç» |
| | | * @return CRC16æ ¡éªå¼ |
| | | */ |
| | | public static int calcCrc16(byte[] data) { |
| | | return calcCrc16(data, 0, data.length); |
| | | } |
| | | |
| | | /** |
| | | * 计ç®CRC16æ ¡éª |
| | | * |
| | | * @param data |
| | | * éè¦è®¡ç®çæ°ç» |
| | | * @param offset |
| | | * èµ·å§ä½ç½® |
| | | * @param len |
| | | * é¿åº¦ |
| | | * @return CRC16æ ¡éªå¼ |
| | | */ |
| | | public static int calcCrc16(byte[] data, int offset, int len) { |
| | | return calcCrc16(data, offset, len, 0xffff); |
| | | } |
| | | |
| | | /** |
| | | * 计ç®CRC16æ ¡éª |
| | | * |
| | | * @param data |
| | | * éè¦è®¡ç®çæ°ç» |
| | | * @param offset |
| | | * èµ·å§ä½ç½® |
| | | * @param len |
| | | * é¿åº¦ |
| | | * @param preval |
| | | * ä¹åçæ ¡éªå¼ |
| | | * @return CRC16æ ¡éªå¼ |
| | | */ |
| | | public static int calcCrc16(byte[] data, int offset, int len, int preval) { |
| | | int ucCRCHi = (preval & 0xff00) >> 8; |
| | | int ucCRCLo = preval & 0x00ff; |
| | | int iIndex; |
| | | for (int i = 0; i < len; ++i) { |
| | | iIndex = (ucCRCLo ^ data[offset + i]) & 0x00ff; |
| | | ucCRCLo = ucCRCHi ^ crc16_tab_h[iIndex]; |
| | | ucCRCHi = crc16_tab_l[iIndex]; |
| | | } |
| | | return ((ucCRCHi & 0x00ff) << 8) | (ucCRCLo & 0x00ff) & 0xffff; |
| | | } |
| | | |
| | | // æµè¯ |
| | | public static void main(String[] args) { |
| | | // 0x02 05 00 03 FF 00 , crc16=7C 09 |
| | | int crc = CRC16.calcCrc16(new byte[] { 0x02, 0x05, 0x00, 0x03, (byte) 0xff, 0x00 }); |
| | | System.out.println(String.format("0x%04x", crc)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.util; |
| | | |
| | | /** |
| | | *计ç®CRC8æ ¡éªå¼ |
| | | */ |
| | | public class CRC8 { |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | } |
| | | |
| | | static short[] gCrc16Table = { (short) 0x0000, (short) 0x1021, (short) 0x2042, (short) 0x3063, (short) 0x4084, |
| | | (short) 0x50a5, (short) 0x60c6, (short) 0x70e7, (short) 0xd94c, (short) 0xc96d, (short) 0xf90e, |
| | | (short) 0xe92f, (short) 0x99c8, (short) 0x89e9, (short) 0xb98a, (short) 0xa9ab, (short) 0x5844, |
| | | (short) 0x4865, (short) 0x7806, (short) 0x6827, (short) 0x18c0, (short) 0x08e1, (short) 0x3882, |
| | | (short) 0x28a3, (short) 0xcb7d, (short) 0xdb5c, (short) 0xeb3f, (short) 0xfb1e, (short) 0x8bf9, |
| | | (short) 0x9bd8, (short) 0xabbb, (short) 0xbb9a, (short) 0x4a75, (short) 0x5a54, (short) 0x6a37, |
| | | (short) 0x7a16, (short) 0x0af1, (short) 0x1ad0, (short) 0x2ab3, (short) 0x3a92, (short) 0xfd2e, |
| | | (short) 0xed0f, (short) 0xdd6c, (short) 0xcd4d, (short) 0xbdaa, (short) 0xad8b, (short) 0x9de8, |
| | | (short) 0x8dc9, (short) 0xc9cc, (short) 0xd9ed, (short) 0xe98e, (short) 0xf9af, (short) 0x8948, |
| | | (short) 0x9969, (short) 0xa90a, (short) 0xb92b, (short) 0x5af5, (short) 0x4ad4, (short) 0x7ab7, |
| | | (short) 0x6a96, (short) 0x1a71, (short) 0x0a50, (short) 0x3a33, (short) 0x2a12, (short) 0xdbfd, |
| | | (short) 0xcbdc, (short) 0xfbbf, (short) 0xeb9e, (short) 0x9b79, (short) 0x8b58, (short) 0xbb3b, |
| | | (short) 0xab1a, (short) 0x6ca6, (short) 0x7c87, (short) 0x4ce4, (short) 0x5cc5, (short) 0x2c22, |
| | | (short) 0x3c03, (short) 0x0c60, (short) 0x1c41, (short) 0x8108, (short) 0x9129, (short) 0xa14a, |
| | | (short) 0xb16b, (short) 0xc18c, (short) 0xd1ad, (short) 0xe1ce, (short) 0xf1ef, (short) 0x1231, |
| | | (short) 0x0210, (short) 0x3273, (short) 0x2252, (short) 0x52b5, (short) 0x4294, (short) 0x72f7, |
| | | (short) 0x62d6, (short) 0x9339, (short) 0x8318, (short) 0xb37b, (short) 0xa35a, (short) 0xd3bd, |
| | | (short) 0xc39c, (short) 0xf3ff, (short) 0xe3de, (short) 0x2462, (short) 0x3443, (short) 0x0420, |
| | | (short) 0x1401, (short) 0x64e6, (short) 0x74c7, (short) 0x44a4, (short) 0x5485, (short) 0xa56a, |
| | | (short) 0xb54b, (short) 0x8528, (short) 0x9509, (short) 0xe5ee, (short) 0xf5cf, (short) 0xc5ac, |
| | | (short) 0xd58d, (short) 0x3653, (short) 0x2672, (short) 0x1611, (short) 0x0630, (short) 0x76d7, |
| | | (short) 0x66f6, (short) 0x5695, (short) 0x46b4, (short) 0xb75b, (short) 0xa77a, (short) 0x9719, |
| | | (short) 0x8738, (short) 0xf7df, (short) 0xe7fe, (short) 0xd79d, (short) 0xc7bc, (short) 0x48c4, |
| | | (short) 0x58e5, (short) 0x6886, (short) 0x78a7, (short) 0x0840, (short) 0x1861, (short) 0x2802, |
| | | (short) 0x3823, (short) 0x83b9, (short) 0x9398, (short) 0xa3fb, (short) 0xb3da, (short) 0xc33d, |
| | | (short) 0xd31c, (short) 0xe37f, (short) 0xf35e, (short) 0x02b1, (short) 0x1290, (short) 0x22f3, |
| | | (short) 0x32d2, (short) 0x4235, (short) 0x5214, (short) 0x6277, (short) 0x7256, (short) 0xb5ea, |
| | | (short) 0xa5cb, (short) 0x95a8, (short) 0x8589, (short) 0xf56e, (short) 0xe54f, (short) 0xd52c, |
| | | (short) 0xc50d, (short) 0x34e2, (short) 0x24c3, (short) 0x14a0, (short) 0x0481, (short) 0x7466, |
| | | (short) 0x6447, (short) 0x5424, (short) 0x4405, (short) 0xa7db, (short) 0xb7fa, (short) 0x8799, |
| | | (short) 0x97b8, (short) 0xe75f, (short) 0xf77e, (short) 0xc71d, (short) 0xd73c, (short) 0x26d3, |
| | | (short) 0x36f2, (short) 0x0691, (short) 0x16b0, (short) 0x6657, (short) 0x7676, (short) 0x4615, |
| | | (short) 0x5634, (short) 0xedae, (short) 0xfd8f, (short) 0xcdec, (short) 0xddcd, (short) 0xad2a, |
| | | (short) 0xbd0b, (short) 0x8d68, (short) 0x9d49, (short) 0x7e97, (short) 0x6eb6, (short) 0x5ed5, |
| | | (short) 0x4ef4, (short) 0x3e13, (short) 0x2e32, (short) 0x1e51, (short) 0x0e70, (short) 0xff9f, |
| | | (short) 0xefbe, (short) 0xdfdd, (short) 0xcffc, (short) 0xbf1b, (short) 0xaf3a, (short) 0x9f59, |
| | | (short) 0x8f78, (short) 0x9188, (short) 0x81a9, (short) 0xb1ca, (short) 0xa1eb, (short) 0xd10c, |
| | | (short) 0xc12d, (short) 0xf14e, (short) 0xe16f, (short) 0x1080, (short) 0x00a1, (short) 0x30c2, |
| | | (short) 0x20e3, (short) 0x5004, (short) 0x4025, (short) 0x7046, (short) 0x6067, (short) 0x7c26, |
| | | (short) 0x6c07, (short) 0x5c64, (short) 0x4c45, (short) 0x3ca2, (short) 0x2c83, (short) 0x1ce0, |
| | | (short) 0x0cc1, (short) 0xef1f, (short) 0xff3e, (short) 0xcf5d, (short) 0xdf7c, (short) 0xaf9b, |
| | | (short) 0xbfba, (short) 0x8fd9, (short) 0x9ff8, (short) 0x6e17, (short) 0x7e36, (short) 0x4e55, |
| | | (short) 0x5e74, (short) 0x2e93, (short) 0x3eb2, (short) 0x0ed1, (short) 0x1ef0 }; |
| | | |
| | | static short[] crc8_tab = { (short) 0x00, (short) 0x07, (short) 0x0E, (short) 0x09, (short) 0x1C, (short) 0x1B, |
| | | (short) 0x12, (short) 0x15, (short) 0x38, (short) 0x3F, (short) 0x36, (short) 0x31, (short) 0x24, |
| | | (short) 0x23, (short) 0x2A, (short) 0x2D, (short) 0x70, (short) 0x77, (short) 0x7E, (short) 0x79, |
| | | (short) 0x6C, (short) 0x6B, (short) 0x62, (short) 0x65, (short) 0x48, (short) 0x4F, (short) 0x46, |
| | | (short) 0x41, (short) 0x54, (short) 0x53, (short) 0x5A, (short) 0x5D, (short) 0xE0, (short) 0xE7, |
| | | (short) 0xEE, (short) 0xE9, (short) 0xFC, (short) 0xFB, (short) 0xF2, (short) 0xF5, (short) 0xD8, |
| | | (short) 0xDF, (short) 0xD6, (short) 0xD1, (short) 0xC4, (short) 0xC3, (short) 0xCA, (short) 0xCD, |
| | | (short) 0x90, (short) 0x97, (short) 0x9E, (short) 0x99, (short) 0x8C, (short) 0x8B, (short) 0x82, |
| | | (short) 0x85, (short) 0xA8, (short) 0xAF, (short) 0xA6, (short) 0xA1, (short) 0xB4, (short) 0xB3, |
| | | (short) 0xBA, (short) 0xBD, (short) 0xC7, (short) 0xC0, (short) 0xC9, (short) 0xCE, (short) 0xDB, |
| | | (short) 0xDC, (short) 0xD5, (short) 0xD2, (short) 0xFF, (short) 0xF8, (short) 0xF1, (short) 0xF6, |
| | | (short) 0xE3, (short) 0xE4, (short) 0xED, (short) 0xEA, (short) 0xB7, (short) 0xB0, (short) 0xB9, |
| | | (short) 0xBE, (short) 0xAB, (short) 0xAC, (short) 0xA5, (short) 0xA2, (short) 0x8F, (short) 0x88, |
| | | (short) 0x81, (short) 0x86, (short) 0x93, (short) 0x94, (short) 0x9D, (short) 0x9A, (short) 0x27, |
| | | (short) 0x20, (short) 0x29, (short) 0x2E, (short) 0x3B, (short) 0x3C, (short) 0x35, (short) 0x32, |
| | | (short) 0x1F, (short) 0x18, (short) 0x11, (short) 0x16, (short) 0x03, (short) 0x04, (short) 0x0D, |
| | | (short) 0x0A, (short) 0x57, (short) 0x50, (short) 0x59, (short) 0x5E, (short) 0x4B, (short) 0x4C, |
| | | (short) 0x45, (short) 0x42, (short) 0x6F, (short) 0x68, (short) 0x61, (short) 0x66, (short) 0x73, |
| | | (short) 0x74, (short) 0x7D, (short) 0x7A, (short) 0x89, (short) 0x8E, (short) 0x87, (short) 0x80, |
| | | (short) 0x95, (short) 0x92, (short) 0x9B, (short) 0x9C, (short) 0xB1, (short) 0xB6, (short) 0xBF, |
| | | (short) 0xB8, (short) 0xAD, (short) 0xAA, (short) 0xA3, (short) 0xA4, (short) 0xF9, (short) 0xFE, |
| | | (short) 0xF7, (short) 0xF0, (short) 0xE5, (short) 0xE2, (short) 0xEB, (short) 0xEC, (short) 0xC1, |
| | | (short) 0xC6, (short) 0xCF, (short) 0xC8, (short) 0xDD, (short) 0xDA, (short) 0xD3, (short) 0xD4, |
| | | (short) 0x69, (short) 0x6E, (short) 0x67, (short) 0x60, (short) 0x75, (short) 0x72, (short) 0x7B, |
| | | (short) 0x7C, (short) 0x51, (short) 0x56, (short) 0x5F, (short) 0x58, (short) 0x4D, (short) 0x4A, |
| | | (short) 0x43, (short) 0x44, (short) 0x19, (short) 0x1E, (short) 0x17, (short) 0x10, (short) 0x05, |
| | | (short) 0x02, (short) 0x0B, (short) 0x0C, (short) 0x21, (short) 0x26, (short) 0x2F, (short) 0x28, |
| | | (short) 0x3D, (short) 0x3A, (short) 0x33, (short) 0x34, (short) 0x4E, (short) 0x49, (short) 0x40, |
| | | (short) 0x47, (short) 0x52, (short) 0x55, (short) 0x5C, (short) 0x5B, (short) 0x76, (short) 0x71, |
| | | (short) 0x78, (short) 0x7F, (short) 0x6A, (short) 0x6D, (short) 0x64, (short) 0x63, (short) 0x3E, |
| | | (short) 0x39, (short) 0x30, (short) 0x37, (short) 0x22, (short) 0x25, (short) 0x2C, (short) 0x2B, |
| | | (short) 0x06, (short) 0x01, (short) 0x08, (short) 0x0F, (short) 0x1A, (short) 0x1D, (short) 0x14, |
| | | (short) 0x13, (short) 0xAE, (short) 0xA9, (short) 0xA0, (short) 0xA7, (short) 0xB2, (short) 0xB5, |
| | | (short) 0xBC, (short) 0xBB, (short) 0x96, (short) 0x91, (short) 0x98, (short) 0x9F, (short) 0x8A, |
| | | (short) 0x8D, (short) 0x84, (short) 0x83, (short) 0xDE, (short) 0xD9, (short) 0xD0, (short) 0xD7, |
| | | (short) 0xC2, (short) 0xC5, (short) 0xCC, (short) 0xCB, (short) 0xE6, (short) 0xE1, (short) 0xE8, |
| | | (short) 0xEF, (short) 0xFA, (short) 0xFD, (short) 0xF4, (short) 0xF3 }; |
| | | |
| | | static byte[] crc8_tab2 = { (byte) 0x00, (byte) 0x07, (byte) 0x0E, (byte) 0x09, (byte) 0x1C, (byte) 0x1B, |
| | | (byte) 0x12, (byte) 0x15, (byte) 0x38, (byte) 0x3F, (byte) 0x36, (byte) 0x31, (byte) 0x24, (byte) 0x23, |
| | | (byte) 0x2A, (byte) 0x2D, (byte) 0x70, (byte) 0x77, (byte) 0x7E, (byte) 0x79, (byte) 0x6C, (byte) 0x6B, |
| | | (byte) 0x62, (byte) 0x65, (byte) 0x48, (byte) 0x4F, (byte) 0x46, (byte) 0x41, (byte) 0x54, (byte) 0x53, |
| | | (byte) 0x5A, (byte) 0x5D, (byte) 0xE0, (byte) 0xE7, (byte) 0xEE, (byte) 0xE9, (byte) 0xFC, (byte) 0xFB, |
| | | (byte) 0xF2, (byte) 0xF5, (byte) 0xD8, (byte) 0xDF, (byte) 0xD6, (byte) 0xD1, (byte) 0xC4, (byte) 0xC3, |
| | | (byte) 0xCA, (byte) 0xCD, (byte) 0x90, (byte) 0x97, (byte) 0x9E, (byte) 0x99, (byte) 0x8C, (byte) 0x8B, |
| | | (byte) 0x82, (byte) 0x85, (byte) 0xA8, (byte) 0xAF, (byte) 0xA6, (byte) 0xA1, (byte) 0xB4, (byte) 0xB3, |
| | | (byte) 0xBA, (byte) 0xBD, (byte) 0xC7, (byte) 0xC0, (byte) 0xC9, (byte) 0xCE, (byte) 0xDB, (byte) 0xDC, |
| | | (byte) 0xD5, (byte) 0xD2, (byte) 0xFF, (byte) 0xF8, (byte) 0xF1, (byte) 0xF6, (byte) 0xE3, (byte) 0xE4, |
| | | (byte) 0xED, (byte) 0xEA, (byte) 0xB7, (byte) 0xB0, (byte) 0xB9, (byte) 0xBE, (byte) 0xAB, (byte) 0xAC, |
| | | (byte) 0xA5, (byte) 0xA2, (byte) 0x8F, (byte) 0x88, (byte) 0x81, (byte) 0x86, (byte) 0x93, (byte) 0x94, |
| | | (byte) 0x9D, (byte) 0x9A, (byte) 0x27, (byte) 0x20, (byte) 0x29, (byte) 0x2E, (byte) 0x3B, (byte) 0x3C, |
| | | (byte) 0x35, (byte) 0x32, (byte) 0x1F, (byte) 0x18, (byte) 0x11, (byte) 0x16, (byte) 0x03, (byte) 0x04, |
| | | (byte) 0x0D, (byte) 0x0A, (byte) 0x57, (byte) 0x50, (byte) 0x59, (byte) 0x5E, (byte) 0x4B, (byte) 0x4C, |
| | | (byte) 0x45, (byte) 0x42, (byte) 0x6F, (byte) 0x68, (byte) 0x61, (byte) 0x66, (byte) 0x73, (byte) 0x74, |
| | | (byte) 0x7D, (byte) 0x7A, (byte) 0x89, (byte) 0x8E, (byte) 0x87, (byte) 0x80, (byte) 0x95, (byte) 0x92, |
| | | (byte) 0x9B, (byte) 0x9C, (byte) 0xB1, (byte) 0xB6, (byte) 0xBF, (byte) 0xB8, (byte) 0xAD, (byte) 0xAA, |
| | | (byte) 0xA3, (byte) 0xA4, (byte) 0xF9, (byte) 0xFE, (byte) 0xF7, (byte) 0xF0, (byte) 0xE5, (byte) 0xE2, |
| | | (byte) 0xEB, (byte) 0xEC, (byte) 0xC1, (byte) 0xC6, (byte) 0xCF, (byte) 0xC8, (byte) 0xDD, (byte) 0xDA, |
| | | (byte) 0xD3, (byte) 0xD4, (byte) 0x69, (byte) 0x6E, (byte) 0x67, (byte) 0x60, (byte) 0x75, (byte) 0x72, |
| | | (byte) 0x7B, (byte) 0x7C, (byte) 0x51, (byte) 0x56, (byte) 0x5F, (byte) 0x58, (byte) 0x4D, (byte) 0x4A, |
| | | (byte) 0x43, (byte) 0x44, (byte) 0x19, (byte) 0x1E, (byte) 0x17, (byte) 0x10, (byte) 0x05, (byte) 0x02, |
| | | (byte) 0x0B, (byte) 0x0C, (byte) 0x21, (byte) 0x26, (byte) 0x2F, (byte) 0x28, (byte) 0x3D, (byte) 0x3A, |
| | | (byte) 0x33, (byte) 0x34, (byte) 0x4E, (byte) 0x49, (byte) 0x40, (byte) 0x47, (byte) 0x52, (byte) 0x55, |
| | | (byte) 0x5C, (byte) 0x5B, (byte) 0x76, (byte) 0x71, (byte) 0x78, (byte) 0x7F, (byte) 0x6A, (byte) 0x6D, |
| | | (byte) 0x64, (byte) 0x63, (byte) 0x3E, (byte) 0x39, (byte) 0x30, (byte) 0x37, (byte) 0x22, (byte) 0x25, |
| | | (byte) 0x2C, (byte) 0x2B, (byte) 0x06, (byte) 0x01, (byte) 0x08, (byte) 0x0F, (byte) 0x1A, (byte) 0x1D, |
| | | (byte) 0x14, (byte) 0x13, (byte) 0xAE, (byte) 0xA9, (byte) 0xA0, (byte) 0xA7, (byte) 0xB2, (byte) 0xB5, |
| | | (byte) 0xBC, (byte) 0xBB, (byte) 0x96, (byte) 0x91, (byte) 0x98, (byte) 0x9F, (byte) 0x8A, (byte) 0x8D, |
| | | (byte) 0x84, (byte) 0x83, (byte) 0xDE, (byte) 0xD9, (byte) 0xD0, (byte) 0xD7, (byte) 0xC2, (byte) 0xC5, |
| | | (byte) 0xCC, (byte) 0xCB, (byte) 0xE6, (byte) 0xE1, (byte) 0xE8, (byte) 0xEF, (byte) 0xFA, (byte) 0xFD, |
| | | (byte) 0xF4, (byte) 0xF3 }; |
| | | |
| | | /** |
| | | * è®¡ç®æ°ç»çCRC8æ ¡éªå¼ |
| | | * |
| | | * @param data |
| | | * éè¦è®¡ç®çæ°ç» |
| | | * @return CRC8æ ¡éªå¼ |
| | | */ |
| | | public static byte calcCrc8(byte[] data) { |
| | | return calcCrc8(data, (short) 2, (short) (data.length - 2), (byte) 0); |
| | | } |
| | | |
| | | /** |
| | | * 计ç®CRC8æ ¡éªå¼ |
| | | * |
| | | * @param data |
| | | * æ°æ® |
| | | * @param offset |
| | | * èµ·å§ä½ç½® |
| | | * @param len |
| | | * é¿åº¦ |
| | | * @return æ ¡éªå¼ |
| | | */ |
| | | public static byte calcCrc8(byte[] data, short offset, short len) { |
| | | return calcCrc8(data, offset, len, (byte) 0); |
| | | } |
| | | |
| | | public static byte calcCrc8(byte[] ucPtr, short offset, short ucLen, byte preval) { |
| | | short ucIndex; // CRC8æ ¡éªè¡¨æ ¼ç´¢å¼ |
| | | short ucCRC8 = 0; // CRC8åèåå§å |
| | | short i = 0; |
| | | // è¿è¡CRC8使 ¡éª |
| | | while ((ucLen--) > 0) { |
| | | short indexI = (short) (i + offset); |
| | | short data = ucPtr[indexI]; |
| | | if (data < 0) { |
| | | int sd = Byte.toUnsignedInt(ucPtr[indexI]); |
| | | data = (short) sd; |
| | | } |
| | | ucIndex = (short) (ucCRC8 ^ data); |
| | | ucCRC8 = crc8_tab[(short) ucIndex]; |
| | | i++; |
| | | } |
| | | // è¿åCRC8æ ¡éªæ°æ® |
| | | return (byte) (~ucCRC8); |
| | | } |
| | | |
| | | public static short crc16Byte(short crc, byte data) { |
| | | return (short) ((crc << 8) ^ gCrc16Table[((crc >> 8) ^ data) & 0xff]); |
| | | } |
| | | |
| | | public static short calculateCrc16(byte[] buf, short offset, short length) { |
| | | short crc = 0; |
| | | short i = 0; |
| | | while ((length--) > 0) { |
| | | crc = crc16Byte(crc, buf[offset + (i++)]); |
| | | } |
| | | return crc; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ld.igds.protocol.zldz.util; |
| | | |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å·¥å
·ç±» |
| | | * |
| | | * @author Andy |
| | | */ |
| | | public class ServerUtils { |
| | | |
| | | public static final Map<String, String> contextMap = new HashMap<>(); |
| | | |
| | | public static final String MSG_START = "AAAA"; |
| | | public static final String MSG_END = "EEEE"; |
| | | |
| | | //é»è®¤ç»ç»ç¼å· |
| | | public static final String DEFAULT_COMPANY = "0000"; |
| | | |
| | | |
| | | public static final String MSG_TYPE_1115 = "1115";// åå°è·åç²®æ
æ°æ®è¯·æ± |
| | | |
| | | public static final String MSG_TYPE_8815 = "8815";// ç»ç«¯åºçç²®æ
æ°æ®è¯·æ± |
| | | |
| | | public static final String MSG_TYPE_1116 = "1116";// é
置读ååæºåæ° |
| | | |
| | | public static final String MSG_TYPE_8816 = "8816";// é
置读ååæºåæ°åºç |
| | | |
| | | public static final String MSG_TYPE_1117 = "1117";// ç»ç«¯åéç²®æ
æ°æ®ç»åå° |
| | | |
| | | public static final String MSG_TYPE_8817 = "8817";// åå°æ¶å°ç²®æ
æ°æ®åºç |
| | | |
| | | public static final String MSG_TYPE_1122 = "1122";// åå§åçµç¼çµç¼ |
| | | |
| | | public static final String MSG_TYPE_1123 = "1123";// çµç¼æ±æ» |
| | | |
| | | public static final String MSG_TYPE_1125 = "1125";// 读åééçµç¼ |
| | | |
| | | public static final String MSG_TYPE_8825 = "8825";//读åééçµç¼åºç |
| | | |
| | | public static final String MSG_TYPE_1126 = "1126";// ä¿®æ¹ééçµç¼ |
| | | |
| | | public static final String MSG_TYPE_8826 = "8826";// ä¿®æ¹ééçµç¼åºç |
| | | |
| | | |
| | | public static final String MSG_TYPE_1128 = "1128";// 读åæçº¿æ¸©æ¹¿åº¦ |
| | | |
| | | public static final String MSG_TYPE_8822 = "8822";// åºçåå§åçµç¼çµç¼ |
| | | |
| | | public static final String MSG_TYPE_8823 = "8823";// åºççµç¼æ±æ»ç»æ |
| | | |
| | | public static final String MSG_TYPE_8828 = "8828";// 读åæçº¿æ¸©æ¹¿åº¦åºç |
| | | |
| | | public static final String MSG_TYPE_1129 = "1129";// ç»ç«¯åéééçµç¼æ°æ®ç»åå° |
| | | |
| | | public static final String MSG_TYPE_8829 = "8829";// åå°æ¶å°çµç¼æ°æ®åºç |
| | | |
| | | public static final String MSG_TYPE_112B = "112B";// éå¯åæº |
| | | |
| | | public static final String MSG_TYPE_882B = "882B";// éå¯åæºåºç |
| | | |
| | | |
| | | public static String getServerKey(String ip, int port) { |
| | | return ip + ":" + port; |
| | | } |
| | | } |
| | |
| | | return tempControl3(param); |
| | | } |
| | | |
| | | // 妿å¤ä¸ªè®¾å¤ï¼éè¦å¯¹è®¾å¤æåæºè¿è¡åç» |
| | | // 妿å¤ä¸ªè®¾å¤ï¼éè¦å¯¹è®¾å¤æåæºè¿è¡åç» |
| | | Map<String, List<ExeDevice>> deviceMap = deviceList.stream().collect(Collectors.groupingBy(ExeDevice::getSerId)); |
| | | |
| | | String temp = ""; |
| | |
| | | // è·ååæºä¿¡æ¯ |
| | | DeviceSer deviceSer = coreSerService.getCacheSer(param.getCompanyId(), exeDevice.getSerId()); |
| | | |
| | | if (!Constant.YN_Y.equals(deviceSer.getStatus())) { |
| | | return new DeviceControlResponse( |
| | | OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "å½åè®¾å¤æå¨æ§å¶æã" + deviceSer.getName() + "ãä¸å¨çº¿ï¼æ æ³æ§è¡"); |
| | | } |
| | | // if (!Constant.YN_Y.equals(deviceSer.getStatus())) { |
| | | // return new DeviceControlResponse( |
| | | // OrderRespEnum.ORDER_ERROR.getCode(), |
| | | // "å½åè®¾å¤æå¨æ§å¶æã" + deviceSer.getName() + "ãä¸å¨çº¿ï¼æ æ³æ§è¡"); |
| | | // } |
| | | |
| | | TempControlRequest request = new TempControlRequest(); |
| | | request.setDepotId(param.getDepotId()); |
| | |
| | | |
| | | @PropertyDef(label = "ç²®å åé度") |
| | | @Column(name = "ldkxd", precision = 10, scale = 3) |
| | | private double ldkxd; |
| | | private Double ldkxd; |
| | | |
| | | /** |
| | | * 1ï¼èªç¶ç©ºæ°éé£ |
| | |
| | | |
| | | @PropertyDef(label = "主é£éæªé¢ç§¯") |
| | | @Column(name = "zfdjmj", precision = 10, scale = 3) |
| | | private double zfdjmj; |
| | | private Double zfdjmj; |
| | | |
| | | @PropertyDef(label = "æ¯é£éæªé¢ç§¯") |
| | | @Column(name = "zhfdjmj", precision = 10, scale = 3) |
| | | private double zhfdjmj; |
| | | private Double zhfdjmj; |
| | | |
| | | @PropertyDef(label = "æ¯é£éæ»é¿åº¦") |
| | | @Column(name = "zfdzcd", precision = 20, scale = 3) |
| | | private double zfdzcd; |
| | | private Double zfdzcd; |
| | | |
| | | @PropertyDef(label = "é£ç½å¼åç") |
| | | @Column(name = "fwkkl", precision = 10, scale = 3) |
| | | private double fwkkl; |
| | | private Double fwkkl; |
| | | |
| | | @PropertyDef(label = "空æ°é徿¯") |
| | | @Column(name = "kqtjb", precision = 10, scale = 3) |
| | | private double kqtjb; |
| | | private Double kqtjb; |
| | | |
| | | @PropertyDef(label = "éé£å£è®¾ç½®ä¸ªæ°") |
| | | @Column(name = "tfkszgs") |
| | |
| | | |
| | | @PropertyDef(label = "åå°é£æºé¢å®å
¨å") |
| | | @Column(name = "dtfjedqy", precision = 10, scale = 3) |
| | | private double dtfjedqy; |
| | | private Double dtfjedqy; |
| | | |
| | | @PropertyDef(label = "åå°é£æºé¢å®é£é") |
| | | @Column(name = "dtfjedfl", precision = 10, scale = 3) |
| | | private double dtfjedfl; |
| | | private Double dtfjedfl; |
| | | |
| | | @PropertyDef(label = "åå°é£æºé¢å®åç") |
| | | @Column(name = "dtfjedgl", precision = 10, scale = 3) |
| | | private double dtfjedgl; |
| | | private Double dtfjedgl; |
| | | |
| | | /** |
| | | * 1ï¼åå
¥å¼éé£ |
| | |
| | | |
| | | @PropertyDef(label = "åå°é£æºå®æµé£é") |
| | | @Column(name = "dtfjscfl", precision = 10, scale = 3) |
| | | private double dtfjscfl; |
| | | private Double dtfjscfl; |
| | | |
| | | @PropertyDef(label = "åå°é£æºè½´åç") |
| | | @Column(name = "dtfjzgl", precision = 10, scale = 3) |
| | | private double dtfjzgl; |
| | | private Double dtfjzgl; |
| | | |
| | | @PropertyDef(label = "æ»é£é") |
| | | @Column(name = "zfl", precision = 10, scale = 3) |
| | | private double zfl; |
| | | private Double zfl; |
| | | |
| | | @PropertyDef(label = "åä½éé£é") |
| | | @Column(name = "dwtfl", precision = 10, scale = 3) |
| | | private double dwtfl; |
| | | private Double dwtfl; |
| | | |
| | | @PropertyDef(label = "宿µç³»ç»é»å") |
| | | @Column(name = "scxtzl", precision = 10, scale = 3) |
| | | private double scxtzl; |
| | | private Double scxtzl; |
| | | |
| | | /** |
| | | * æ»èçµé åç¦ |
| | |
| | | |
| | | @PropertyDef(label = "éæ°´å¹
度") |
| | | @Column(name = "jsfd", precision = 10, scale = 3) |
| | | private double jsfd; |
| | | private Double jsfd; |
| | | |
| | | @PropertyDef(label = "å¨ç²®éæ°´è½è") |
| | | @Column(name = "dljsnh", precision = 10, scale = 3) |
| | | private double dljsnh; |
| | | private Double dljsnh; |
| | | |
| | | @PropertyDef(label = "éé£éæ°´ååæ§åæ_æ´ä»") |
| | | @Column(name = "tfjsjyxfxzc", length = 128) |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | |
| | | return new DeviceControlResponse(OrderRespEnum.ORDER_ERROR.getCode(), "没æéè¦æ´æ°ç设å¤ä¿¡æ¯ï¼ï¼"); |
| | | } |
| | | |
| | | // 2023-08-31ææ¶ç¦ç¨ï¼ä½¿ç¨ä»åºç¼ç è·åä»åºææè®¾å¤çåæºä¿¡æ¯ |
| | | //æ ¹æ®è®¾å¤æå±åæºè¿è¡åç» |
| | | Map<String, List<ExeDevice>> groupBy = param.getDeviceList().stream().collect(Collectors.groupingBy(ExeDevice::getSerId)); |
| | | // Map<String, List<ExeDevice>> groupBy = param.getDeviceList().stream().collect(Collectors.groupingBy(ExeDevice::getSerId)); |
| | | // DeviceControlResponse response = new DeviceControlResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), "å½ä»¤åéæåï¼"); |
| | | // DeviceSer deviceSer; |
| | | // DeviceControlRequest request; |
| | | // try { |
| | | // for (String serId : groupBy.keySet()) { |
| | | |
| | | Set<String> list = coreDeviceService.getCacheDeviceSerByDepotId(param.getCompanyId(), param.getDepotId()); |
| | | DeviceControlResponse response = new DeviceControlResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), "å½ä»¤åéæåï¼"); |
| | | |
| | | DeviceSer deviceSer; |
| | | DeviceControlRequest request; |
| | | |
| | | try { |
| | | for (String serId : groupBy.keySet()) { |
| | | for (String serId : list) { |
| | | deviceSer = coreSerService.getCacheSer(param.getCompanyId(), serId); |
| | | if (null == deviceSer) { |
| | | log.info("æ ¹æ®ä»åº{}è·å设å¤ç¶æï¼åæºç¼ç {}çåæºä¸åå¨ï¼åæ¶æ§è¡ã", param.getDepotId(), serId); |
| | |
| | | <artifactId>igds-api-phone</artifactId> |
| | | <version>${igds.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- å
¶ä»éç¨åçåè®® --> |
| | | <dependency> |
| | | <groupId>com.ld.igds</groupId> |
| | |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <!-- MODBUS-TCP --> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.ld.igds</groupId>--> |
| | | <!-- <artifactId>igds-protocol-modbus</artifactId>--> |
| | | <!-- <version>${igds.version}</version>--> |
| | | <!-- <exclusions>--> |
| | | <!-- <exclusion>--> |
| | | <!-- <artifactId>slf4j-log4j12</artifactId>--> |
| | | <!-- <groupId>org.slf4j</groupId>--> |
| | | <!-- </exclusion>--> |
| | | <!-- <exclusion>--> |
| | | <!-- <artifactId>log4j</artifactId>--> |
| | | <!-- <groupId>log4j</groupId>--> |
| | | <!-- </exclusion>--> |
| | | <!-- </exclusions>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- ç§æåè®®-飿£è´è¿IOTãå¶æ°®æº--> |
| | | |
| | | <!-- ç§æåè®®-飿£è´è¿IOTãå¶æ°®æº |
| | | <dependency> |
| | | <groupId>com.ld.igds</groupId> |
| | | <artifactId>igds-protocol-iot</artifactId> |
| | |
| | | <groupId>log4j</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | </dependency>--> |
| | | |
| | | <!-- ç§æåè®®-è´åç²®æ
|
| | | <dependency> |
| | |
| | | </exclusions> |
| | | </dependency>--> |
| | | |
| | | <!-- 海康车çè¯å«-SDK |
| | | <!-- ç§æåè®®-æ£æ¥çµå --> |
| | | <dependency> |
| | | <groupId>com.ld.igds</groupId> |
| | | <artifactId>igds-protocol-zldz</artifactId> |
| | | <version>${igds.version}</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>slf4j-log4j12</artifactId> |
| | | <groupId>org.slf4j</groupId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <artifactId>log4j</artifactId> |
| | | <groupId>log4j</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <!-- 海康车çè¯å«-SDK --> |
| | | <dependency> |
| | | <groupId>com.ld.igds</groupId> |
| | | <artifactId>igds-protocol-sdk</artifactId> |
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | --> |
| | | |
| | | </dependencies> |
| | | |
| | | |
| | | <dependencyManagement> |
| | | <dependencies> |
| | |
| | | </plugin> |
| | | |
| | | <!-- YUI Compressor Mavenå缩æä»¶ å¼åå
ä¸å®ç¨--> |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>net.alchim31.maven</groupId>--> |
| | | <!-- <artifactId>yuicompressor-maven-plugin</artifactId>--> |
| | | <!-- <version>1.5.1</version>--> |
| | | <!-- <executions>--> |
| | | <!-- <execution>--> |
| | | <!-- <goals>--> |
| | | <!-- <goal>compress</goal>--> |
| | | <!-- </goals>--> |
| | | <!-- </execution>--> |
| | | <!-- </executions>--> |
| | | <!-- <configuration>--> |
| | | <!-- <encoding>UTF-8</encoding>--> |
| | | <!-- <!–䏿¾ç¤ºjså¯è½çé误 –>--> |
| | | <!-- <jswarn>false</jswarn>--> |
| | | <!-- <!–æ¯å¦æ··æ· –>--> |
| | | <!-- <nomunge>true</nomunge>--> |
| | | <!-- <!–è¥åå¨å·²å缩çæä»¶ï¼ä¼å
å¯¹æ¯æºæä»¶æ¯å¦ææ¹å¨ ææ¹å¨ä¾¿åç¼©ï¼æ æ¹å¨å°±ä¸å缩 –>--> |
| | | <!-- <force>false</force>--> |
| | | <!-- <!–卿å®çåå·åæå
¥æ°è¡ –>--> |
| | | <!-- <linebreakpos>-1</linebreakpos>--> |
| | | <!-- <!–å缩ä¹åå
æ§è¡èåæä»¶æä½ –>--> |
| | | <!-- <preProcessAggregates>true</preProcessAggregates>--> |
| | | <!-- <!–å缩åä¿åæä»¶åç¼ æ åç¼ –>--> |
| | | <!-- <nosuffix>true</nosuffix>--> |
| | | <!-- <!–æºç®å½ï¼å³éåç¼©çæ ¹ç®å½ –>--> |
| | | <!-- <sourceDirectory>src/main/resources</sourceDirectory>--> |
| | | <!-- <!–è¾åºç®å½ï¼å³å缩åçç®å½ –>--> |
| | | <!-- <outputDirectory>target/classes</outputDirectory>--> |
| | | <!-- <force>true</force>--> |
| | | <!-- <!–å缩jsåcssæä»¶ –>--> |
| | | <!-- <includes>--> |
| | | <!-- <include>**/*.js</include>--> |
| | | <!-- <include>**/*.css</include>--> |
| | | <!-- </includes>--> |
| | | <!-- <!– 以ä¸ç®å½åæä»¶ä¸ä¼è¢«å缩 –>--> |
| | | <!-- <excludes>--> |
| | | <!-- <exclude>**/*.min.js</exclude>--> |
| | | <!-- <exclude>**/*.min.css</exclude>--> |
| | | <!-- <exclude>**/d7/**</exclude>--> |
| | | <!-- <exclude>**/dorado-home/**</exclude>--> |
| | | <!-- <exclude>**/bdf2/**</exclude>--> |
| | | <!-- <exclude>**/css/**</exclude>--> |
| | | <!-- <exclude>**/js/**</exclude>--> |
| | | <!-- <exclude>**/plugins/**</exclude>--> |
| | | <!-- </excludes>--> |
| | | <!-- </configuration>--> |
| | | <!-- </plugin>--> |
| | | <plugin> |
| | | <groupId>net.alchim31.maven</groupId> |
| | | <artifactId>yuicompressor-maven-plugin</artifactId> |
| | | <version>1.5.1</version> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>compress</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | <configuration> |
| | | <encoding>UTF-8</encoding> |
| | | <!--䏿¾ç¤ºjså¯è½çé误 --> |
| | | <jswarn>false</jswarn> |
| | | <!--æ¯å¦æ··æ· --> |
| | | <nomunge>true</nomunge> |
| | | <!--è¥åå¨å·²å缩çæä»¶ï¼ä¼å
å¯¹æ¯æºæä»¶æ¯å¦ææ¹å¨ ææ¹å¨ä¾¿åç¼©ï¼æ æ¹å¨å°±ä¸å缩 --> |
| | | <force>false</force> |
| | | <!--卿å®çåå·åæå
¥æ°è¡ --> |
| | | <linebreakpos>-1</linebreakpos> |
| | | <!--å缩ä¹åå
æ§è¡èåæä»¶æä½ --> |
| | | <preProcessAggregates>true</preProcessAggregates> |
| | | <!--å缩åä¿åæä»¶åç¼ æ åç¼ --> |
| | | <nosuffix>true</nosuffix> |
| | | <!--æºç®å½ï¼å³éåç¼©çæ ¹ç®å½ --> |
| | | <sourceDirectory>src/main/resources</sourceDirectory> |
| | | <!--è¾åºç®å½ï¼å³å缩åçç®å½ --> |
| | | <outputDirectory>target/classes</outputDirectory> |
| | | <force>true</force> |
| | | <!--å缩jsåcssæä»¶ --> |
| | | <includes> |
| | | <include>**/*.js</include> |
| | | <include>**/*.css</include> |
| | | </includes> |
| | | <!-- 以ä¸ç®å½åæä»¶ä¸ä¼è¢«å缩 --> |
| | | <excludes> |
| | | <exclude>**/*.min.js</exclude> |
| | | <exclude>**/*.min.css</exclude> |
| | | <exclude>**/d7/**</exclude> |
| | | <exclude>**/dorado-home/**</exclude> |
| | | <exclude>**/bdf2/**</exclude> |
| | | <exclude>**/css/**</exclude> |
| | | <exclude>**/js/**</exclude> |
| | | <exclude>**/plugins/**</exclude> |
| | | </excludes> |
| | | </configuration> |
| | | </plugin> |
| | | |
| | | </plugins> |
| | | |
| | |
| | | db-base: |
| | | name: db-base |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | url: jdbc:mysql://127.0.0.1:3306/igds_v40?useUnicode=true&characterEncoding=utf-8 |
| | | url: jdbc:mysql://127.0.0.1:3306/igds_5325?useUnicode=true&characterEncoding=utf-8 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | username: root |
| | | password: ukJp12Qf+elyBvGHkJ5MQMa95pfVm0oFBHefdEgDFKoFSjbgYa9PYfv5vlem5nvoXjQsP9tIIo53DvSbsl160Q== |
¶Ô±ÈÐÂÎļþ |
| | |
| | | ########################## 飿£è´è¿-ç²®æ
æå¡å¨ ########################## |
| | | server: |
| | | port: 8201 |
| | | context-path: / |
| | | connection-timeout: 5000 |
| | | tomcat: |
| | | uri-encoding: UTF-8 |
| | | |
| | | ########################## datasourcec ########################## |
| | | spring: |
| | | datasource: |
| | | db-base: |
| | | name: db-base |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | url: jdbc:mysql://127.0.0.1:3306/igds_master_v35?useUnicode=true&characterEncoding=utf-8 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | username: root |
| | | password: ukJp12Qf+elyBvGHkJ5MQMa95pfVm0oFBHefdEgDFKoFSjbgYa9PYfv5vlem5nvoXjQsP9tIIo53DvSbsl160Q== |
| | | public-key: |
| | | config-decrypt: true |
| | | initial-size: 5 |
| | | min-idle: 5 |
| | | max-active: 50 |
| | | max-wait: 60000 |
| | | time-between-eviction-runs-millis: 60000 |
| | | min-evictable-idle-time-millis: 300000 |
| | | validation-query: select 1 from dual |
| | | test-whileIdle: true |
| | | test-on-borrow: false |
| | | test-on-return: false |
| | | pool-prepared-statements: true |
| | | max-pool-prepared-statement-per-connection-size: 20 |
| | | filters: stat |
| | | connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
| | | use-global-data-source-stat: true |
| | | remove-abandoned: true |
| | | remove-abandoned-timeout: 1800 |
| | | log-abandoned: true |
| | | db-sqlite: |
| | | name: db-sqlite |
| | | url: jdbc:sqlite:D:/app/igds/db/iot_cfg.db |
| | | driver-class-name: org.sqlite.JDBC |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | username: |
| | | password: |
| | | |
| | | # Redisç¸å
³é
ç½® |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: Abc123.. |
| | | # è¿æ¥æ± æå¤§è¿æ¥æ°ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | pool: |
| | | max-active: 200 |
| | | max-wait: -1 |
| | | max-idle: 10 |
| | | min-idle: 0 |
| | | timeout: 6000 |
| | | |
| | | license: |
| | | subject: ld_license |
| | | publicAlias: publicCert |
| | | storePass: PUBLICFZZYXXJSGFYXGS888888 |
| | | licensePath: C:/license/license.lic |
| | | publicKeysStorePath: C:/license/publicCerts.keystore |
| | | |
| | | ########################## IGDS ########################## |
| | | ## ç³»ç»æ¥å£è·¯ç±é
ç½® æ³¨ææ°å妿以0å¼å¤´çè¯ï¼åå°ä¼åºç°è½¬ä¹ï¼è¯·æ·»å "" |
| | | igds: |
| | | default: |
| | | companyId: 1000 |
| | | sys-name: æºæ
§ç²®åºç®¡çç³»ç» |
| | | logo: logo-default.png |
| | | logo-title: logo-title-default.png |
| | | support: æºæ
§ç²®æ
ç²®æ
äºç®¡çå¹³å° |
| | | grian-add-point: N |
| | | media-ip: 124.71.162.207 |
| | | media-port: 18000 |
| | | file-path: C:/IGDS/FILE/ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | ########################## 䏿µ·åå® ########################## |
| | | server: |
| | | port: 8088 |
| | | context-path: / |
| | | connection-timeout: 5000 |
| | | tomcat: |
| | | uri-encoding: UTF-8 |
| | | |
| | | ########################## datasourcec ########################## |
| | | spring: |
| | | datasource: |
| | | db-base: |
| | | name: db-base |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | url: jdbc:mysql://127.0.0.1:3306/igds_master?useUnicode=true&characterEncoding=utf-8 |
| | | # url: jdbc:mysql://192.168.200.3:3306/igds_master?useUnicode=true&characterEncoding=utf-8 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | username: igds |
| | | password: ukJp12Qf+elyBvGHkJ5MQMa95pfVm0oFBHefdEgDFKoFSjbgYa9PYfv5vlem5nvoXjQsP9tIIo53DvSbsl160Q== |
| | | public-key: |
| | | config-decrypt: true |
| | | initial-size: 5 |
| | | min-idle: 5 |
| | | max-active: 50 |
| | | max-wait: 60000 |
| | | time-between-eviction-runs-millis: 60000 |
| | | min-evictable-idle-time-millis: 300000 |
| | | validation-query: select 1 from dual |
| | | test-whileIdle: true |
| | | test-on-borrow: false |
| | | test-on-return: false |
| | | pool-prepared-statements: true |
| | | max-pool-prepared-statement-per-connection-size: 20 |
| | | filters: stat |
| | | connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
| | | use-global-data-source-stat: true |
| | | removeAbandoned: true |
| | | removeAbandonedTimeout: 90 |
| | | logAbandoned: true |
| | | poolPreparedStatements: true |
| | | maxPoolPreparedStatementPerConnectionSize: 20 |
| | | db-sqlite: |
| | | name: db-sqlite |
| | | url: jdbc:sqlite:D:/app/igds/db/iot_cfg.db |
| | | driver-class-name: org.sqlite.JDBC |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | username: |
| | | password: |
| | | |
| | | # Redisç¸å
³é
ç½® |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: Abc123.. |
| | | # è¿æ¥æ± æå¤§è¿æ¥æ°ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | pool: |
| | | max-active: 200 |
| | | max-wait: -1 |
| | | max-idle: 10 |
| | | min-idle: 0 |
| | | timeout: 6000 |
| | | |
| | | license: |
| | | subject: ld_license |
| | | publicAlias: publicCert |
| | | storePass: PUBLICFZZYXXJSGFYXGS888888 |
| | | licensePath: D:/IGDS/license/license.lic |
| | | publicKeysStorePath: D:/IGDS/license/publicCerts.keystore |
| | | |
| | | ########################## IGDS ########################## |
| | | ## ç³»ç»æ¥å£è·¯ç±é
ç½® æ³¨ææ°å妿以0å¼å¤´çè¯ï¼åå°ä¼åºç°è½¬ä¹ï¼è¯·æ·»å "" |
| | | igds: |
| | | default: |
| | | companyId: 5303 |
| | | sys-name: æºæ
§ç²®åºç®¡çç³»ç» |
| | | logo: logo-default.png |
| | | logo-title: logo-title-default.png |
| | | support: æºæ
§ç²®æ
ç²®æ
äºç®¡çå¹³å° |
| | | grian-add-point: N |
| | | file-path: D:/IGDS/FILE/ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | ########################## 广ä¸å¾é»é¡¹ç® ########################## |
| | | server: |
| | | port: 8888 |
| | | context-path: / |
| | | connection-timeout: 5000 |
| | | tomcat: |
| | | uri-encoding: UTF-8 |
| | | |
| | | ########################## datasourcec ########################## |
| | | spring: |
| | | datasource: |
| | | db-base: |
| | | name: db-base |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | url: jdbc:mysql://127.0.0.1:3306/igds_master?useUnicode=true&characterEncoding=utf-8 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | username: root |
| | | password: ukJp12Qf+elyBvGHkJ5MQMa95pfVm0oFBHefdEgDFKoFSjbgYa9PYfv5vlem5nvoXjQsP9tIIo53DvSbsl160Q== |
| | | public-key: |
| | | config-decrypt: true |
| | | initial-size: 5 |
| | | min-idle: 5 |
| | | max-active: 50 |
| | | max-wait: 60000 |
| | | time-between-eviction-runs-millis: 60000 |
| | | min-evictable-idle-time-millis: 300000 |
| | | validation-query: select 1 from dual |
| | | test-whileIdle: true |
| | | test-on-borrow: false |
| | | test-on-return: false |
| | | pool-prepared-statements: true |
| | | max-pool-prepared-statement-per-connection-size: 20 |
| | | filters: stat |
| | | connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
| | | use-global-data-source-stat: true |
| | | removeAbandoned: true |
| | | removeAbandonedTimeout: 90 |
| | | logAbandoned: true |
| | | poolPreparedStatements: true |
| | | maxPoolPreparedStatementPerConnectionSize: 20 |
| | | db-sqlite: |
| | | name: db-sqlite |
| | | url: jdbc:sqlite:D:/app/igds/db/iot_cfg.db |
| | | driver-class-name: org.sqlite.JDBC |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | username: |
| | | password: |
| | | |
| | | # Redisç¸å
³é
ç½® |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: Abc123.. |
| | | # è¿æ¥æ± æå¤§è¿æ¥æ°ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | pool: |
| | | max-active: 200 |
| | | max-wait: -1 |
| | | max-idle: 10 |
| | | min-idle: 0 |
| | | timeout: 6000 |
| | | |
| | | license: |
| | | subject: ld_license |
| | | publicAlias: publicCert |
| | | storePass: PUBLICFZZYXXJSGFYXGS888888 |
| | | licensePath: D:/IGDS/license/license.lic |
| | | publicKeysStorePath: D:/IGDS/license/publicCerts.keystore |
| | | |
| | | ########################## IGDS ########################## |
| | | ## ç³»ç»æ¥å£è·¯ç±é
ç½® æ³¨ææ°å妿以0å¼å¤´çè¯ï¼åå°ä¼åºç°è½¬ä¹ï¼è¯·æ·»å "" |
| | | igds: |
| | | default: |
| | | companyId: 5322 |
| | | sys-name: æºæ
§ç²®åºç®¡çç³»ç» |
| | | logo: logo-default.png |
| | | logo-title: logo-title-default.png |
| | | support: æºæ
§ç²®åºç»¼å管çå¹³å° |
| | | grian-add-point: N |
| | | file-path: D:/IGDS/FILE/ |
| | |
| | | ########################## æ±è¥¿èµ£å·é¡¹ç® ########################## |
| | | ########################## æ±è¥¿èµ£å·-大å
¬é¡¹ç® ########################## |
| | | server: |
| | | port: 8888 |
| | | context-path: / |
| | |
| | | url: jdbc:mysql://127.0.0.1:3306/igds_master?useUnicode=true&characterEncoding=utf-8 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | username: root |
| | | password: ukJp12Qf+elyBvGHkJ5MQMa95pfVm0oFBHefdEgDFKoFSjbgYa9PYfv5vlem5nvoXjQsP9tIIo53DvSbsl160Q== |
| | | password: cCB/meZWF3TckLO5t3oIETehaLqFAgDisogg8yqrdEIClsZxu8lwFAkgtilJRYnLgQPHlJV4eamhE9IGPN+kKw== |
| | | public-key: |
| | | config-decrypt: true |
| | | initial-size: 5 |
| | |
| | | subject: ld_license |
| | | publicAlias: publicCert |
| | | storePass: PUBLICFZZYXXJSGFYXGS888888 |
| | | licensePath: D:/IGDS/license/license.lic |
| | | publicKeysStorePath: D:/IGDS/license/publicCerts.keystore |
| | | licensePath: F:/IGDS/license/license.lic |
| | | publicKeysStorePath: F:/IGDS/license/publicCerts.keystore |
| | | |
| | | ########################## IGDS ########################## |
| | | ## ç³»ç»æ¥å£è·¯ç±é
ç½® æ³¨ææ°å妿以0å¼å¤´çè¯ï¼åå°ä¼åºç°è½¬ä¹ï¼è¯·æ·»å "" |
| | | igds: |
| | | default: |
| | | companyId: 5328 |
| | | companyId: 5325 |
| | | sys-name: æºæ
§ç²®åºç®¡çç³»ç» |
| | | logo: logo-default.png |
| | | logo-title: logo-title-default.png |
| | | support: 飿£è´è¿ä¿¡æ¯ææ¯è¡ä»½æéå
¬å¸ |
| | | grian-add-point: N |
| | | file-path: D:/IGDS/FILE/ |
| | | file-path: F:/IGDS/FILE/ |
| | |
| | | ########################## æ¦æ±é»éåç²® ########################## |
| | | ########################## æ¦æ±é»éåç²®-Linux ########################## |
| | | server: |
| | | port: 8888 |
| | | context-path: / |
| | |
| | | phone: 400-627-1116 |
| | | website: http://www.fzzygf.com |
| | | address: éå·å¸é«æ°åºé¿æ¤¿è·¯11å·æ²³åçå½å®¶å¤§å¦ç§æååµå1å·æ¥¼ |
| | | file-path: D:/IGDS/ |
| | | file-path: D:/IGDS/FILE/ |
| | | ## æ¨é微信平å°çå°å |
| | | warn-path: http://124.71.162.207:8299/igds-wx/gateway |
| | | api-path-jg: http://124.71.187.17:8207/supervise/v1/gateway |
| | |
| | | gas.mapImg.5000_001.img=5000_001.png |
| | | |
| | | ## 5016-\u5927\u6E7E\u533A\u6C14\u4F53\uFF0C\u53EA\u670910\u4E2A\u5E73\u65B9\u4ED3\u6709\u6C14\u4F53 |
| | | gas.mapImg.3P01.img=5016_001.png |
| | | gas.mapImg.3P02.img=5016_001.png |
| | | gas.mapImg.3P03.img=5016_001.png |
| | | gas.mapImg.3P04.img=5016_001.png |
| | | gas.mapImg.3P05.img=5016_001.png |
| | | gas.mapImg.3P06.img=5016_001.png |
| | | gas.mapImg.3P07.img=5016_001.png |
| | | gas.mapImg.3P08.img=5016_001.png |
| | | gas.mapImg.3P09.img=5016_001.png |
| | | gas.mapImg.3P10.img=5016_001.png |
| | | gas.mapImg.5016_3P01.img=5016_001.png |
| | | gas.mapImg.5016_3P02.img=5016_001.png |
| | | gas.mapImg.5016_3P03.img=5016_001.png |
| | | gas.mapImg.5016_3P04.img=5016_001.png |
| | | gas.mapImg.5016_3P05.img=5016_001.png |
| | | gas.mapImg.5016_3P06.img=5016_001.png |
| | | gas.mapImg.5016_3P07.img=5016_001.png |
| | | gas.mapImg.5016_3P08.img=5016_001.png |
| | | gas.mapImg.5016_3P09.img=5016_001.png |
| | | gas.mapImg.5016_3P10.img=5016_001.png |
| | | |
| | | ## 5303-\u4E0A\u6D77\u5609\u5B9A\uFF0C\u53EA\u67092\u4E2A\u4ED3\u6709\u6C14\u4F53 |
| | | gas.mapImg.91310114703439394M0010009001.img=009001.png |
| | | gas.mapImg.91310114703439394M0010009002.img=009002.png |
| | | ## 5303-䏿µ·åå®ä¸»åºåº |
| | | gas.mapImg.5303_91310114703439394M0010001001.img=001.png |
| | | gas.mapImg.5303_91310114703439394M0010001002.img=003.png |
| | | gas.mapImg.5303_91310114703439394M0010002001.img=001.png |
| | | gas.mapImg.5303_91310114703439394M0010002002.img=003.png |
| | | gas.mapImg.5303_91310114703439394M0010003001.img=001.png |
| | | gas.mapImg.5303_91310114703439394M0010003002.img=003.png |
| | | gas.mapImg.5303_91310114703439394M0010004001.img=001.png |
| | | gas.mapImg.5303_91310114703439394M0010004002.img=003.png |
| | | gas.mapImg.5303_91310114703439394M0010005001.img=001.png |
| | | gas.mapImg.5303_91310114703439394M0010005002.img=003.png |
| | | gas.mapImg.5303_91310114703439394M0010006001.img=001.png |
| | | gas.mapImg.5303_91310114703439394M0010006002.img=003.png |
| | | gas.mapImg.5303_91310114703439394M0010007001.img=001.png |
| | | gas.mapImg.5303_91310114703439394M0010007002.img=003.png |
| | | gas.mapImg.5303_91310114703439394M0010008001.img=001.png |
| | | gas.mapImg.5303_91310114703439394M0010008002.img=003.png |
| | | gas.mapImg.5303_91310114703439394M0010009001.img=001.png |
| | | gas.mapImg.5303_91310114703439394M0010009002.img=002.png |
| | | |
| | | ## 5317-\u6F6E\u9633 |
| | | gas.mapImg.5317_001.img=5317_001.png |
| | |
| | | gas.mapImg.5013_001.img=5013_001.png |
| | | |
| | | ## 5318-\u6F6E\u9633 |
| | | gas.mapImg.5318_001.img=5318_001.png |
| | | gas.mapImg.5318_001.img=5318_001. |
| | | |
| | | ## 5325 æ±è¥¿èµ£å·-大å
¬ |
| | | gas.mapImg.5325_1.img=5325_001.png |
| | | gas.mapImg.5325_2.img=5325_001.png |
| | | gas.mapImg.5325_3.img=5325_001.png |
| | | gas.mapImg.5325_4.img=5325_001.png |
| | | gas.mapImg.5325_5.img=5325_001.png |
| | | gas.mapImg.5325_6.img=5325_001.png |
| | | gas.mapImg.5325_7.img=5325_001.png |
| | | gas.mapImg.5325_8.img=5325_001.png |
| | | gas.mapImg.5325_9.img=5325_001.png |
| | | gas.mapImg.5325_10.img=5325_001.png |
| | | gas.mapImg.5325_11.img=5325_001.png |
| | | gas.mapImg.5325_12.img=5325_001.png |
| | | gas.mapImg.5325_13.img=5325_001.png |
| | | gas.mapImg.5325_14.img=5325_001.png |
| | | gas.mapImg.5325_15.img=5325_001.png |
| | | gas.mapImg.5325_16.img=5325_001.png |
| | | |
| | | ## 5328 广西æ¥å®¾ |
| | | gas.mapImg.5328_0P18.img=5328_001_7.png |
| | | gas.mapImg.5328_0P19.img=5328_001_7.png |
| | | gas.mapImg.5328_0P20.img=5328_001_7.png |
| | | gas.mapImg.5328_0P21.img=5328_001_5.png |
| | | gas.mapImg.5328_0P22.img=5328_001_4.png |
| | | gas.mapImg.5328_0P23.img=5328_001_10.png |
| | | gas.mapImg.5328_0P24.img=5328_001_10.png |
| | | gas.mapImg.5328_0P25.img=5328_001_7.png |
| | | gas.mapImg.5328_0P26.img=5328_001_7.png |
| | | gas.mapImg.5328_0P27.img=5328_001_7.png |
| | | gas.mapImg.5328_0P28.img=5328_001_5.png |
| | | gas.mapImg.5328_0P29.img=5328_001_5.png |
| | | gas.mapImg.5328_0P30.img=5328_001_10.png |
| | | gas.mapImg.5328_0P31.img=5328_001_10.png |
| | |
| | | n2.mapImg.5000_0138.a=default_qyc_a.png |
| | | n2.mapImg.5000_0138.b=default_qyc_b.png |
| | | |
| | | ## 5325_001 |
| | | n2.mapImg.5325_001.a=pfc2_a.png |
| | | n2.mapImg.5325_001.b=pfc2_b.png |
| | | |
| | | ## 5329_001 |
| | | n2.mapImg.5329_001.a=default_qyc_a.png |
| | | n2.mapImg.5329_001.b=default_qyc_b.png |
| | |
| | | layer.open({ |
| | | type: 1, |
| | | title: 'è®¾å¤æä½-' + domSelectDevice.attr("name"), |
| | | area: ['450px', '200px'], |
| | | area: ['450px', '150px'], |
| | | shade: 0, |
| | | content: $('#control-HL2'), |
| | | btn: 0, |
| | |
| | | <div class="layui-btn-container m10"> |
| | | <button class="rkbk-quick-btn btn-fj layui-btn btn-blue" |
| | | onClick="toExecute('F_OPEN')"> |
| | | <i><img th:src="@{../../static/images/icon-sm-fj.png}" /></i>å¼ºé£ |
| | | <i><img th:src="@{../../static/images/icon-sm-fj.png}" /></i>å¼é£æº |
| | | </button> |
| | | <button class="rkbk-quick-btn btn-fj layui-btn btn-red" |
| | | onClick="toExecute('F_CLOSE')"> |
| | | <i><img th:src="@{../../static/images/icon-sm-fj.png}" /></i>å
³é£æº |
| | | </button> |
| | | <button class="rkbk-quick-btn btn-fj layui-btn btn-blue" |
| | | onClick="toExecute('F_OPEN_F')"> |
| | | <i><img th:src="@{../../static/images/icon-sm-fj.png}" /></i>å¼±é£ |
| | | </button> |
| | | <!-- <button class="rkbk-quick-btn btn-fj layui-btn btn-blue"--> |
| | | <!-- onClick="toExecute('F_OPEN_F')">--> |
| | | <!-- <i><img th:src="@{../../static/images/icon-sm-fj.png}" /></i>å¼±é£--> |
| | | <!-- </button>--> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="layui-btn-container m10"> |
| | | <button class="rkbk-quick-btn btn-fj layui-btn btn-blue" |
| | | onClick="toExecute('F_OPEN')"> |
| | | <i><img th:src="@{../../static/images/icon-sm-fj.png}" /></i>å¼ºé£ |
| | | <i><img th:src="@{../../static/images/icon-sm-fj.png}" /></i>å¼é£æº |
| | | </button> |
| | | <button class="rkbk-quick-btn btn-fj layui-btn btn-red" |
| | | onClick="toExecute('F_CLOSE')"> |
| | | <i><img th:src="@{../../static/images/icon-sm-fj.png}" /></i>å
³é£æº |
| | | </button> |
| | | <button class="rkbk-quick-btn btn-fj layui-btn btn-blue" |
| | | onClick="toExecute('F_OPEN_F')"> |
| | | <i><img th:src="@{../../static/images/icon-sm-fj.png}" /></i>å¼±é£ |
| | | </button> |
| | | <!-- <button class="rkbk-quick-btn btn-fj layui-btn btn-blue"--> |
| | | <!-- onClick="toExecute('F_OPEN_F')">--> |
| | | <!-- <i><img th:src="@{../../static/images/icon-sm-fj.png}" /></i>å¼±é£--> |
| | | <!-- </button>--> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | ##----\u901A\u98CE\u53C2\u6570\u914D\u7F6E----verb.mapImg.deptId.a--## |
| | | ## 5000_001 |
| | | verb.mapImg.5000_001.a=default_pfc2_a.png |
| | | verb.mapImg.5000_001.b=default_pfc2_b.png |
| | | verb.mapImg.5000_001.a=default_pfc_a.png |
| | | verb.mapImg.5000_001.b=default_pfc_b.png |
| | | |
| | | verb.mapImg.5000_0137.a=default_qyc_a.png |
| | | verb.mapImg.5000_0137.b=default_qyc_b.png |
| | |
| | | verb.mapImg.5324_11.b=pfc_b.png |
| | | |
| | | |
| | | ## 5325_001 |
| | | verb.mapImg.5325_001.a=default_pfc_a.png |
| | | verb.mapImg.5325_001.b=default_pfc_b.png |
| | | ## 5325_001 æ±è¥¿èµ£å·-大å
¬ |
| | | verb.mapImg.5325_001.a=default_pfc2_a.png |
| | | verb.mapImg.5325_001.b=default_pfc2_b.png |
| | | verb.mapImg.5325_Q010101.a=default_qyc_a.png |
| | | verb.mapImg.5325_Q010101.b=default_qyc_b.png |
| | | verb.mapImg.5325_Q010201.a=default_qyc_a.png |
| | | verb.mapImg.5325_Q010201.b=default_qyc_b.png |
| | | verb.mapImg.5325_Q010301.a=default_qyc_a.png |
| | | verb.mapImg.5325_Q010301.b=default_qyc_b.png |
| | | verb.mapImg.5325_Q010401.a=default_qyc_a.png |
| | | verb.mapImg.5325_Q010401.b=default_qyc_b.png |
| | | verb.mapImg.5325_Q010501.a=default_qyc_a.png |
| | | verb.mapImg.5325_Q010501.b=default_qyc_b.png |
| | | verb.mapImg.5325_Q010601.a=default_qyc_a.png |
| | | verb.mapImg.5325_Q010601.b=default_qyc_b.png |
| | | |
| | | ## 5328_001 |
| | | verb.mapImg.5328_001.a=default_pfc_a.png |
| | |
| | | <module>igds-protocol-fzzy3</module> |
| | | <!--馿µ·æºè½--> |
| | | <module>igds-protocol-bhzn</module> |
| | | <!--馿µ·æºè½--> |
| | | <module>igds-protocol-zldz</module> |
| | | <!--è´åç²®æ
åè®®--> |
| | | <module>igds-protocol-beibo</module> |
| | | <!--ç©èç½æå±è®¾å¤å
--> |
| | |
| | | <module>igds-api-phone</module> |
| | | <!-- æ¥å£å
ï¼å
æ¬ä¸ç»´æ¥å£ --> |
| | | <module>igds-api-inte</module> |
| | | |
| | | <!-- <module>igds-api-three</module>--> |
| | | |
| | | <!-- å¯è§å--> |
| | | <module>igds-databoard</module> |