| | |
| | | import android.util.Log; |
| | | |
| | | import com.dayu.recharge.dao.BaseDaoSingleton; |
| | | import com.dayu.recharge.dbBean.DeviceNumber; |
| | | import com.dayu.recharge.dbBean.IpBean; |
| | | import com.easysocket.EasySocket; |
| | | import com.easysocket.config.EasySocketOptions; |
| | |
| | | //BCD码00成功01失败(注册号不是服务器返回信息) |
| | | if (state.equalsIgnoreCase("00")) { |
| | | //保存设备注册号 |
| | | BaseDaoSingleton.getInstance(MyApplication.myApplication).ipDao().findFirst(); |
| | | WSHelper.getInstance(MyApplication.this).put("initCode", initCode); |
| | | DeviceNumber deviceNumber = BaseDaoSingleton.getInstance(MyApplication.myApplication).deviceNumberDao().findFirst(); |
| | | if (deviceNumber != null) { |
| | | deviceNumber.setDeviceRegistrationNumber(initCode); |
| | | } else { |
| | | deviceNumber = new DeviceNumber(); |
| | | deviceNumber.setDeviceRegistrationNumber(initCode); |
| | | } |
| | | BaseDaoSingleton.getInstance(MyApplication.myApplication).deviceNumberDao().insert(deviceNumber); |
| | | |
| | | // WSHelper.getInstance(MyApplication.this).put("initCode", initCode); |
| | | ToastUtil.show(MyApplication.this, "充值管理注册报文获取成功"); |
| | | } else { |
| | | //校验CRC错误 |