|  |  |  | 
|---|
|  |  |  | import com.dy.common.mw.protocol.p206V202404.*; | 
|---|
|  |  |  | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd83Vo; | 
|---|
|  |  |  | import com.dy.common.util.ByteUtil; | 
|---|
|  |  |  | import com.dy.common.util.DateTime; | 
|---|
|  |  |  | import org.apache.logging.log4j.LogManager; | 
|---|
|  |  |  | import org.apache.logging.log4j.Logger; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception { | 
|---|
|  |  |  | DataV202404 dV1 = (DataV202404)data.getSubData() ; | 
|---|
|  |  |  | DataCd83Vo cdData = new DataCd83Vo() ; | 
|---|
|  |  |  | DataCd83Vo cdData = new DataCd83Vo(CodeV202404.getCodeName(dataCode)) ; | 
|---|
|  |  |  | dV1.subData = cdData ; | 
|---|
|  |  |  | int index = ProtocolConstantV206V202404.dataIndex ; | 
|---|
|  |  |  | cdData.controllerType = ByteUtil.bytes2Hex(bs, false, index, 1) ; | 
|---|
|  |  |  | 
|---|
|  |  |  | cdData.projectNo = (int)bs[index]; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | index ++ ; | 
|---|
|  |  |  | cdData.waterTotalAmountYear = ByteUtil.BCD2Int_BE(bs, index, index + 4)/100.0D ; | 
|---|
|  |  |  | cdData.waterTotalAmountYear = ByteUtil.BCD2Long_LE(bs, index, index + 4)/100.0D ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | index += 5 ; | 
|---|
|  |  |  | cdData.waterTotalAmountMeter = ByteUtil.BCD2Int_BE(bs, index, index + 4)/100.0D ; | 
|---|
|  |  |  | cdData.waterTotalAmountMeter = ByteUtil.BCD2Long_LE(bs, index, index + 4)/100.0D ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | index += 5 ; | 
|---|
|  |  |  | cdData.eleTotalAmountYear = ByteUtil.BCD2Int_BE(bs, index, index + 4)/100.0D ; | 
|---|
|  |  |  | cdData.eleTotalAmountYear = ByteUtil.BCD2Long_LE(bs, index, index + 4)/100.0D ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | index += 5 ; | 
|---|
|  |  |  | cdData.eleTotalAmountMeter = ByteUtil.BCD2Int_BE(bs, index, index + 4)/100.0D ; | 
|---|
|  |  |  | cdData.eleTotalAmountMeter = ByteUtil.BCD2Long_LE(bs, index, index + 4)/100.0D ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | index += 5 ; | 
|---|
|  |  |  | cdData.waterTotalAmountDay = ByteUtil.BCD2Int_BE(bs, index, index + 3)/100.0D ; | 
|---|
|  |  |  | cdData.waterTotalAmountDay = ByteUtil.BCD2Long_LE(bs, index, index + 3)/100.0D ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | index += 4 ; | 
|---|
|  |  |  | cdData.waterUserTotalAmountDay = ByteUtil.BCD2Int_BE(bs, index, index + 3)/100.0D ; | 
|---|
|  |  |  | cdData.waterUserTotalAmountDay = ByteUtil.BCD2Long_LE(bs, index, index + 3)/100.0D ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | index += 4 ; | 
|---|
|  |  |  | cdData.lossTotalAmountDay = ByteUtil.BCD2Int_BE(bs, index, index + 3)/100.0D ; | 
|---|
|  |  |  | cdData.lossTotalAmountDay = ByteUtil.BCD2Long_LE(bs, index, index + 3)/100.0D ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | index += 4 ; | 
|---|
|  |  |  | cdData.batteryVolt = ByteUtil.BCD2Int_BE(bs, index, index + 1)/100.0D ; | 
|---|
|  |  |  | cdData.batteryVolt = ByteUtil.BCD2Int_LE(bs, index, index + 1)/100.0D ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | index += 2 ; | 
|---|
|  |  |  | String hh = ByteUtil.BCD2String_LE(bs, index, index) ; | 
|---|
|  |  |  | index ++ ; | 
|---|
|  |  |  | String dd = ByteUtil.BCD2String_LE(bs, index, index) ; | 
|---|
|  |  |  | index ++ ; | 
|---|
|  |  |  | String mm = ByteUtil.BCD2String_LE(bs, index, index) ; | 
|---|
|  |  |  | index ++ ; | 
|---|
|  |  |  | String yy = ByteUtil.BCD2String_LE(bs, index, index) ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String ymd = "20" + yy + "-" + mm + "-" + dd ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | cdData.rtuDt = ymd + " " + hh ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | cdData.dataDt = DateTime.lastXDay_yyyy_MM_dd(ymd, 1) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|