|
|
@@ -41,7 +41,9 @@ public class BillingModelFrame {
|
|
|
byte[] params = checkModel(deviceConnectionMsg);
|
|
|
|
|
|
if(deviceConnectionMsg.getIs18()){
|
|
|
- String key = redisCache.getCacheObject(RedisConstant.KEYS+deviceConnectionMsg.getDeviceId());
|
|
|
+// String key = redisCache.getCacheObject(RedisConstant.KEYS+deviceConnectionMsg.getDeviceId());
|
|
|
+ String key = redisCache.getCacheMapValue(RedisConstant.YKC_KEY_MAP,deviceConnectionMsg.getDeviceId());
|
|
|
+
|
|
|
byte[] encrypt = new byte[0];
|
|
|
try {
|
|
|
encrypt = Encrytion.aesEncrypt(params, key.getBytes());
|
|
|
@@ -91,7 +93,8 @@ public class BillingModelFrame {
|
|
|
public void getBillingModel(DeviceConnectionMsg deviceConnectionMsg){
|
|
|
byte[] params = getModelParams(deviceConnectionMsg);
|
|
|
if(deviceConnectionMsg.getIs18()){
|
|
|
- String key = redisCache.getCacheObject(RedisConstant.KEYS+deviceConnectionMsg.getDeviceId());
|
|
|
+// String key = redisCache.getCacheObject(RedisConstant.KEYS+deviceConnectionMsg.getDeviceId());
|
|
|
+ String key = redisCache.getCacheMapValue(RedisConstant.YKC_KEY_MAP,deviceConnectionMsg.getDeviceId());
|
|
|
try {
|
|
|
byte[] encrypt = Encrytion.aesEncrypt(params, key.getBytes());
|
|
|
byte[] spliceing = FrameDataSplicing.spliceing(deviceConnectionMsg.getMessageCount(), DeviceSendYkc.BILLING_MODEL_REQUEST.getFrameType(), DeviceSendYkc.BILLING_MODEL_REQUEST.getEncryptFlag(), encrypt, encrypt.length, deviceConnectionMsg.getIs18());
|
|
|
@@ -129,7 +132,8 @@ public class BillingModelFrame {
|
|
|
public void resp(DeviceConnectionMsg deviceConnectionMsg,byte res){
|
|
|
byte[] params = params(deviceConnectionMsg.getDeviceId(),res);
|
|
|
if(deviceConnectionMsg.getIs18()){
|
|
|
- String key = redisCache.getCacheObject(RedisConstant.KEYS+deviceConnectionMsg.getDeviceId());
|
|
|
+// String key = redisCache.getCacheObject(RedisConstant.KEYS+deviceConnectionMsg.getDeviceId());
|
|
|
+ String key = redisCache.getCacheMapValue(RedisConstant.YKC_KEY_MAP,deviceConnectionMsg.getDeviceId());
|
|
|
try {
|
|
|
byte[] encrypt = Encrytion.aesEncrypt(params, key.getBytes());
|
|
|
byte[] spliceing = FrameDataSplicing.spliceing(deviceConnectionMsg.getMessageCount(), DeviceSendYkc.BILLING_MODEL_SETTING_RESPONSE.getFrameType(), DeviceSendYkc.BILLING_MODEL_SETTING_RESPONSE.getEncryptFlag(), encrypt, encrypt.length, deviceConnectionMsg.getIs18());
|