Authored by caoyan

鉴定服务

... ... @@ -2807,10 +2807,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
@Override
public JSONObject getExpressWaybillCode(BuyerOrderReq req) {
//先从缓存取
String resultStr = yhValueOperations.get(getRedisKey(req.getOrderCode()));
if(StringUtils.isNotEmpty(resultStr)) {
return JSONObject.parseObject(resultStr);
}
// String resultStr = yhValueOperations.get(getRedisKey(req.getOrderCode()));
// if(StringUtils.isNotEmpty(resultStr)) {
// return JSONObject.parseObject(resultStr);
// }
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(req.getOrderCode());
JSONObject data = new JSONObject();
... ... @@ -2935,16 +2935,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
return null;
}
ExpressRecord existRecord = expressRecordList.get(0);
//从缓存取数据
String resultStr = yhValueOperations.get(getRedisKey(existRecord.getOrderCode()));
LOGGER.info("getSfWaybillCode orderCode is {}, cacheData is {}", order.getOrderCode(), resultStr);
if(StringUtils.isEmpty(resultStr)) {
return null;
}
JSONObject cacheData = JSONObject.parseObject(resultStr);
Integer payMethodCache = cacheData.getInteger("payMethod");
Integer payMethod = null;
if(order.getStatus().equals(Constant.BUYER_ORDER_STATUS_APPRAISE_UNSURE.getByteVal())) {
payMethod = PAY_METHOD_MONTHLY;//寄付月结
... ... @@ -2956,18 +2946,24 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
if(null == payMethod) {
throw new CommonException(500, "状态异常,当前状态是"+Constant.convertOrderStatusStr(order.getStatus()));
}
if(null != payMethodCache && !payMethod.equals(payMethodCache)) {
return null;
}
return cacheData;
}
public static void main(String[] args) {
JSONObject obj = new JSONObject();
obj.replace("payMethod", 1);
System.out.print(obj);
JSONObject cacheData = null;
Integer payMethodCache = null;
for(ExpressRecord record : expressRecordList) {
//从缓存取数据
String resultStr = yhValueOperations.get(getRedisKey(record.getOrderCode()));
LOGGER.info("getSfWaybillCode orderCode is {}, cacheData is {}", order.getOrderCode(), resultStr);
if(StringUtils.isNotEmpty(resultStr)) {
cacheData = JSONObject.parseObject(resultStr);
payMethodCache = cacheData.getInteger("payMethod");
if(null != payMethodCache && payMethod.equals(payMethodCache)) {
return cacheData;
}
}
}
return null;
}
private JSONObject getSfWaybillCode(BuyerOrder buyerOrder, SellerOrderGoods sellerGoods, AppraiseAddress appraiseAddress, Integer skup, BuyerOrderReq req) {
... ...