refactor naming
This commit is contained in:
parent
7252fbd887
commit
530ecd5b98
@ -1,6 +1,6 @@
|
||||
package com.xhpc.common.data.up;
|
||||
|
||||
public class ChargerInterruptData extends BaseData {
|
||||
public class BmsChargerInterruptData extends BaseData {
|
||||
|
||||
private String orderNo; //交易流水号
|
||||
private String pileNo; //桩号
|
||||
@ -1,7 +1,7 @@
|
||||
package com.xhpc.pp.logic;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xhpc.common.data.up.ChargerInterruptData;
|
||||
import com.xhpc.common.data.up.BmsChargerInterruptData;
|
||||
import com.xhpc.pp.tx.ServiceParameter;
|
||||
import com.xhpc.pp.tx.ServiceResult;
|
||||
import com.xhpc.pp.tx.logic.ServiceLogic;
|
||||
@ -25,11 +25,11 @@ public class BmsChargerInterruptDataLogic implements ServiceLogic {
|
||||
|
||||
Map<String, Object> req = sp.getParameters();
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
ChargerInterruptData chargerInterruptData = objectMapper.convertValue(req, ChargerInterruptData.class);
|
||||
String orderNo = chargerInterruptData.getOrderNo();
|
||||
BmsChargerInterruptData bmsChargerInterruptData = objectMapper.convertValue(req, BmsChargerInterruptData.class);
|
||||
String orderNo = bmsChargerInterruptData.getOrderNo();
|
||||
String orderkey = "order:".concat(orderNo);
|
||||
Map<String, Object> cacheOrder = REDIS.getCacheMap(orderkey);
|
||||
cacheOrder.put("chargerInterrupt", chargerInterruptData);
|
||||
cacheOrder.put("bmsChargerInterrupt", bmsChargerInterruptData);
|
||||
REDIS.setCacheMap(orderkey, cacheOrder);
|
||||
return new ServiceResult(false);
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -26,15 +27,19 @@ public class BmsReqChargerOutputDataLogic implements ServiceLogic {
|
||||
public ServiceResult service(ServiceParameter sp) throws Exception {
|
||||
|
||||
Map<String, Object> req = sp.getParameters();
|
||||
log.debug("{}", req);
|
||||
long start = Calendar.getInstance().getTimeInMillis();
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
BmsReqChargerOutputData bmsReqChargerOutputData = objectMapper.convertValue(req, BmsReqChargerOutputData.class);
|
||||
String orderNo = bmsReqChargerOutputData.getOrderNo();
|
||||
String orderkey = "order:".concat(orderNo);
|
||||
Map<String, Object> cacheOrder = REDIS.getCacheMap(orderkey);
|
||||
List<BmsReqChargerOutputData> bmsReqChargerOutputDataList = (List<BmsReqChargerOutputData>) cacheOrder.getOrDefault("bmsErrors", new ArrayList<>());
|
||||
List<BmsReqChargerOutputData> bmsReqChargerOutputDataList = (List<BmsReqChargerOutputData>) cacheOrder.getOrDefault(
|
||||
"bmsErrors", new ArrayList<>());
|
||||
bmsReqChargerOutputDataList.add(bmsReqChargerOutputData);
|
||||
cacheOrder.put("bmsReqChargerOutputs", bmsReqChargerOutputDataList);
|
||||
REDIS.setCacheMap(orderkey, cacheOrder);
|
||||
log.debug("{} ms elapsed", Calendar.getInstance().getTimeInMillis() - start);
|
||||
return new ServiceResult(false);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user