记得上下班打卡 | git大法好,push需谨慎

Commit 19ddc3e2 authored by Administrator's avatar Administrator 🎨

Merge branch 'pre' into 'master'

Pre

See merge request !270
parents cd9d2d24 53317614
...@@ -115,6 +115,7 @@ public class GoblinRedisConst { ...@@ -115,6 +115,7 @@ public class GoblinRedisConst {
public static final String REDIS_GOBLIN_ORDER_LIST = PREFIX.concat("order:id:list:");//用户订单id列表 key:$uid public static final String REDIS_GOBLIN_ORDER_LIST = PREFIX.concat("order:id:list:");//用户订单id列表 key:$uid
public static final String REDIS_GOBLIN_ORDER_ZHENGZAI_LIST = PREFIX.concat("order:zhengzai:list:");//用户订单id列表 key:$uid public static final String REDIS_GOBLIN_ORDER_ZHENGZAI_LIST = PREFIX.concat("order:zhengzai:list:");//用户订单id列表 key:$uid
public static final String REDIS_GOBLIN_ORDER_MASTER = PREFIX.concat("order:masterCode:");//用户订单id列表 key:$masterCode public static final String REDIS_GOBLIN_ORDER_MASTER = PREFIX.concat("order:masterCode:");//用户订单id列表 key:$masterCode
public static final String REDIS_GOBLIN_ORDER_MIX_MASTER = PREFIX.concat("order:mix:masterCode:");//用户订单id列表 key:$masterCode
public static final String REDIS_GOBLIN_ORDER_OFFCODE = PREFIX.concat("order:offCode:");//用户订单id列表 key:$wtrieOffCode public static final String REDIS_GOBLIN_ORDER_OFFCODE = PREFIX.concat("order:offCode:");//用户订单id列表 key:$wtrieOffCode
public static final String REDIS_GOBLIN_BACK_ORDER_ID = PREFIX.concat("order:backIds:");//用户订单下的退款订单id key:$orderId public static final String REDIS_GOBLIN_BACK_ORDER_ID = PREFIX.concat("order:backIds:");//用户订单下的退款订单id key:$orderId
public static final String REDIS_CAN_BUY = PREFIX.concat("canBuy:");//可以购买的用户 key:$skuId:$mobile public static final String REDIS_CAN_BUY = PREFIX.concat("canBuy:");//可以购买的用户 key:$skuId:$mobile
......
...@@ -47,6 +47,10 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable { ...@@ -47,6 +47,10 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable {
private Integer payType; private Integer payType;
@ApiModelProperty(position = 25, value = "店铺名称]") @ApiModelProperty(position = 25, value = "店铺名称]")
private String storeName; private String storeName;
@ApiModelProperty(position = 23, value = "销售价格")
private BigDecimal sellPrice;
@ApiModelProperty(position = 23, value = "原价")
private BigDecimal price;
private static final GoblinMixAppDetailsVo obj = new GoblinMixAppDetailsVo(); private static final GoblinMixAppDetailsVo obj = new GoblinMixAppDetailsVo();
...@@ -76,6 +80,8 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable { ...@@ -76,6 +80,8 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable {
this.setItem(source.getItem()); this.setItem(source.getItem());
this.setPayType(source.getPayType()); this.setPayType(source.getPayType());
this.setStoreName(storeName); this.setStoreName(storeName);
this.setPrice(source.getPrice());
this.setSellPrice(source.getSellPrice());
return this; return this;
} }
} }
...@@ -410,7 +410,7 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin ...@@ -410,7 +410,7 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
} }
public HashMap<String, String[]> getMixMasterCode(String masterCode) { public HashMap<String, String[]> getMixMasterCode(String masterCode) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_ORDER_MASTER.concat(masterCode); String redisKey = GoblinRedisConst.REDIS_GOBLIN_ORDER_MIX_MASTER.concat(masterCode);
Object obj = redisUtil.get(redisKey); Object obj = redisUtil.get(redisKey);
if (obj == null) { if (obj == null) {
return null; return null;
......
...@@ -179,7 +179,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService { ...@@ -179,7 +179,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
for (GoblinMixDetailsItemParam itemParam : itemParams) { for (GoblinMixDetailsItemParam itemParam : itemParams) {
GoblinMixDetailsItemVo itemVo = GoblinMixDetailsItemVo.getNew().copyByInsert(itemParam); GoblinMixDetailsItemVo itemVo = GoblinMixDetailsItemVo.getNew().copyByInsert(itemParam);
sellPrice = sellPrice.add(itemVo.getPrice()); sellPrice = sellPrice.add(itemVo.getPrice());
price = price.add(itemVo.getSkuPrice()); price = price.add(itemVo.getSkuPrice().multiply(BigDecimal.valueOf(itemParam.getCount())));
itemList.add(itemVo); itemList.add(itemVo);
goblinMixDetails.add(new Object[]{ goblinMixDetails.add(new Object[]{
mixId, itemVo.getPosition(), itemVo.getSpuId(), itemVo.getSkuId(), itemVo.getPrice(), itemVo.getPriceV(), mixId, itemVo.getPosition(), itemVo.getSpuId(), itemVo.getSkuId(), itemVo.getPrice(), itemVo.getPriceV(),
......
...@@ -430,6 +430,9 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -430,6 +430,9 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
if (orderVo == null || !orderVo.getStoreId().equals(storeInfoVo.getStoreId())) { if (orderVo == null || !orderVo.getStoreId().equals(storeInfoVo.getStoreId())) {
return ResponseDto.failure("无法查看"); return ResponseDto.failure("无法查看");
} }
if (!orderVo.getMixId().equals("")) {
return ResponseDto.failure("组合购商品暂不支持退款");
}
if (orderSkuId != null) { if (orderSkuId != null) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId);
if (orderSkuVo == null) { if (orderSkuVo == null) {
...@@ -538,7 +541,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -538,7 +541,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
} }
@Override @Override
public ResponseDto<Boolean> express(String orderId, String orderSkuIds, String mailNo,String uid) { public ResponseDto<Boolean> express(String orderId, String orderSkuIds, String mailNo, String uid) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
String nowStr = DateUtil.getNowTime(); String nowStr = DateUtil.getNowTime();
LinkedList<String> sqls = CollectionUtil.linkedListString(); LinkedList<String> sqls = CollectionUtil.linkedListString();
...@@ -592,8 +595,8 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -592,8 +595,8 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
for (String orderSkuId : skuIds) { for (String orderSkuId : skuIds) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId);
if(orderSkuVo==null){ if (orderSkuVo == null) {
log.error("调过子订单号:"+orderSkuId); log.error("调过子订单号:" + orderSkuId);
continue; continue;
} }
orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_3.getValue()); orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_3.getValue());
......
...@@ -1608,7 +1608,7 @@ public class GoblinRedisUtils { ...@@ -1608,7 +1608,7 @@ public class GoblinRedisUtils {
} }
public HashMap<String, String[]> getMixMasterCode(String masterCode) { public HashMap<String, String[]> getMixMasterCode(String masterCode) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_ORDER_MASTER.concat(masterCode); String redisKey = GoblinRedisConst.REDIS_GOBLIN_ORDER_MIX_MASTER.concat(masterCode);
Object obj = redisUtil.get(redisKey); Object obj = redisUtil.get(redisKey);
if (obj == null) { if (obj == null) {
return null; return null;
......
...@@ -187,7 +187,7 @@ public class MixOrderServiceImpl implements IMixOrderService { ...@@ -187,7 +187,7 @@ public class MixOrderServiceImpl implements IMixOrderService {
//生成goblin订单 //生成goblin订单
GoblinOrderPreParam preParam = null; GoblinOrderPreParam preParam = null;
if (skuInfoList.size() > 0) { if (skuInfoList.size() > 0) {
preParam = goblinOrder(skuInfoList, skuMix, param.getAddressesVo(), mobile, source, version, nickName, nt, uid, param.getPayType(), param.getDeviceFrom()); preParam = goblinOrder(skuInfoList, skuMix, param.getAddressesVo(), mobile, source, version, nickName, nt, uid, param.getPayType(), param.getDeviceFrom(),orderMasterCode);
} }
return ResponseDto.success(payOrder(nftOrderList, preParam, orderMasterCode, param.getShowUrl(), param.getReturnUrl(), param.getDeviceFrom(), param.getPayType(), mixId, mixVo.getName(), param.getOpenId(), nt, storeName)); return ResponseDto.success(payOrder(nftOrderList, preParam, orderMasterCode, param.getShowUrl(), param.getReturnUrl(), param.getDeviceFrom(), param.getPayType(), mixId, mixVo.getName(), param.getOpenId(), nt, storeName));
} catch (Exception e) { } catch (Exception e) {
...@@ -198,8 +198,8 @@ public class MixOrderServiceImpl implements IMixOrderService { ...@@ -198,8 +198,8 @@ public class MixOrderServiceImpl implements IMixOrderService {
} }
//商品订单 //商品订单
private GoblinOrderPreParam goblinOrder(List<GoblinGoodsSkuInfoVo> skuVoList, HashMap<String, Object> skuMix, AddressVo addressVo, String mobile, String source, String version, String nickName, LocalDateTime now, String uid, String payType, String deviceFrom) { private GoblinOrderPreParam goblinOrder(List<GoblinGoodsSkuInfoVo> skuVoList, HashMap<String, Object> skuMix, AddressVo addressVo, String mobile, String source, String version, String nickName, LocalDateTime now, String uid, String payType, String deviceFrom,String masterCode) {
String orderMasterCode = IDGenerator.storeMasterCode();//商品总订单号 String orderMasterCode = masterCode;
String orderId = IDGenerator.nextSnowId(); String orderId = IDGenerator.nextSnowId();
String orderCode = IDGenerator.storeCode(orderId); String orderCode = IDGenerator.storeCode(orderId);
String storeId = ""; String storeId = "";
...@@ -504,7 +504,7 @@ public class MixOrderServiceImpl implements IMixOrderService { ...@@ -504,7 +504,7 @@ public class MixOrderServiceImpl implements IMixOrderService {
} }
orderMixStr = orderMixStr.concat("&&").concat(orderStr); orderMixStr = orderMixStr.concat("&&").concat(orderStr);
redisUtils.setMasterCode(masterCode, orderMixStr); redisUtils.setMixMasterCode(masterCode, orderMixStr);
// 执行sql // 执行sql
String sqlData = SqlMapping.gets(sqls, sqlDataOrder, sqlDataSku, sqlDataGoblin, sqlDataAttr); String sqlData = SqlMapping.gets(sqls, sqlDataOrder, sqlDataSku, sqlDataGoblin, sqlDataAttr);
...@@ -646,9 +646,9 @@ public class MixOrderServiceImpl implements IMixOrderService { ...@@ -646,9 +646,9 @@ public class MixOrderServiceImpl implements IMixOrderService {
logVo.setOperationName(orderVo.getUserName()); logVo.setOperationName(orderVo.getUserName());
logVo.setOperationType(GoblinStatusConst.Type.OPERATION_TYPE_1.getValue()); logVo.setOperationType(GoblinStatusConst.Type.OPERATION_TYPE_1.getValue());
logVo.setCreatedAt(LocalDateTime.now()); logVo.setCreatedAt(LocalDateTime.now());
redisUtils.setLogVo(orderVo.getOrderId()+orderVo.getOrderCode(),logVo); // redisUtils.setLogVo(orderVo.getOrderId()+orderVo.getOrderCode(),logVo);
queueUtils.setMongoList(GoblinOrderLogVo.class.getSimpleName(), "orderId", orderVo.getOrderId()+orderVo.getOrderCode(), GoblinRedisConst.GOBLIN_ORDER_LOG, 1); // queueUtils.setMongoList(GoblinOrderLogVo.class.getSimpleName(), "orderId", orderSkuVo.getSpuId()+orderVo.getOrderCode(), GoblinRedisConst.GOBLIN_ORDER_LOG, 1);
// mongoUtils.insertGoblinOrderLogVo(logVo); mongoUtils.insertGoblinOrderLogVo(logVo);
//mysql //mysql
sqlDataSku.add(new Object[]{ sqlDataSku.add(new Object[]{
......
...@@ -466,8 +466,14 @@ public class GoblinRedisUtils { ...@@ -466,8 +466,14 @@ public class GoblinRedisUtils {
} }
} }
//主订单下包含的子订单
public void setMixMasterCode(String masterCode, String orderIds) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_ORDER_MIX_MASTER.concat(masterCode);
redisUtil.set(redisKey, orderIds);
}
public HashMap<String, String[]> getMixMasterCode(String masterCode) { public HashMap<String, String[]> getMixMasterCode(String masterCode) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_ORDER_MASTER.concat(masterCode); String redisKey = GoblinRedisConst.REDIS_GOBLIN_ORDER_MIX_MASTER.concat(masterCode);
Object obj = redisUtil.get(redisKey); Object obj = redisUtil.get(redisKey);
if (obj == null) { if (obj == null) {
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment