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

Commit 0149f648 authored by 胡佳晨's avatar 胡佳晨

Merge branch 'master' into dev_performance_paytxt

parents 88265b65 676161a4
...@@ -91,6 +91,13 @@ public class GoblinBackOrderVo implements Serializable, Cloneable { ...@@ -91,6 +91,13 @@ public class GoblinBackOrderVo implements Serializable, Cloneable {
this.expireAt = LocalDateTime.parse(createdAt, DTF_YMD_HMS).plusDays(7).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); this.expireAt = LocalDateTime.parse(createdAt, DTF_YMD_HMS).plusDays(7).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
} }
public Integer getRefuseSize() {
if(refuseSize==null){
return 0;
}
return refuseSize;
}
public GoblinBackOrderVo copy(GoblinBackOrder source) { public GoblinBackOrderVo copy(GoblinBackOrder source) {
this.setBackOrderId(source.getBackOrderId()); this.setBackOrderId(source.getBackOrderId());
this.setBackCode(source.getBackCode()); this.setBackCode(source.getBackCode());
......
package com.liquidnet.service.consumer.kylin.config;
import com.liquidnet.common.cache.redis.config.RedisStreamConfig;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.consumer.kylin.receiver.ConsumerGoblinOrderCloseRdsReceiver;
import lombok.var;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.stream.Consumer;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.connection.stream.ReadOffset;
import org.springframework.data.redis.connection.stream.StreamOffset;
import org.springframework.data.redis.stream.StreamMessageListenerContainer;
import org.springframework.data.redis.stream.Subscription;
@Configuration
public class ConsumerGoblinOrderCRedisStreamConfig extends RedisStreamConfig {
@Autowired
ConsumerGoblinOrderCloseRdsReceiver consumerGoblinOrderCloseRdsReceiver;
/**
* 缺票登记
*
* @param listenerContainer
* @param t
* @return
*/
private Subscription receiveGoblinOrderCOrder(StreamMessageListenerContainer<String, MapRecord<String, String, String>> listenerContainer, int t) {
return listenerContainer.receiveAutoAck(Consumer.from(MQConst.GoblinQueue.GOBLIN_ORDER_CLOSE.getGroup(), getConsumerName(MQConst.GoblinQueue.GOBLIN_ORDER_CLOSE.name() + t)),
StreamOffset.create(MQConst.GoblinQueue.GOBLIN_ORDER_CLOSE.getKey(), ReadOffset.lastConsumed()), consumerGoblinOrderCloseRdsReceiver);
}
/* —————————————————————————— | —————————————————————————— | —————————————————————————— */
/* -------------------------------------------------------- | 缺票登记 */
@Bean
public Subscription subscriptionGoblinOrderC0(RedisConnectionFactory factory) {
var listenerContainer = this.buildStreamMessageListenerContainer(factory);
var subscription = receiveGoblinOrderCOrder(listenerContainer, 0);
listenerContainer.start();
return subscription;
}
@Bean
public Subscription subscriptionGoblinOrderC1(RedisConnectionFactory factory) {
var listenerContainer = this.buildStreamMessageListenerContainer(factory);
var subscription = receiveGoblinOrderCOrder(listenerContainer, 1);
listenerContainer.start();
return subscription;
}
@Bean
public Subscription subscriptionGoblinOrderC2(RedisConnectionFactory factory) {
var listenerContainer = this.buildStreamMessageListenerContainer(factory);
var subscription = receiveGoblinOrderCOrder(listenerContainer, 2);
listenerContainer.start();
return subscription;
}
/* -------------------------------------------------------- | */
}
...@@ -506,7 +506,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -506,7 +506,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
} }
// //
Query query = new Query(); Query query = new Query();
query.addCriteria(Criteria.where("storeId").is(storeId).and("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3")); query.addCriteria(Criteria.where("storeId").is(storeId).and("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3").and("marketId").is(null));
if(StringUtil.isNotBlank(categoryId)){ if(StringUtil.isNotBlank(categoryId)){
query.addCriteria(new Criteria().orOperator( query.addCriteria(new Criteria().orOperator(
Criteria.where("storeCateFid").is(categoryId), Criteria.where("storeCateFid").is(categoryId),
......
...@@ -112,6 +112,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -112,6 +112,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
return ResponseDto.failure(ErrorMapping.get("20003")); return ResponseDto.failure(ErrorMapping.get("20003"));
} }
GoblinAppOrderDetailsVo vo = GoblinAppOrderDetailsVo.getNew(); GoblinAppOrderDetailsVo vo = GoblinAppOrderDetailsVo.getNew();
vo.setStoreOrderVo(orderVo);
List<GoblinOrderSkuVo> skuVos = ObjectUtil.getGoblinOrderSkuVoArrayList(); List<GoblinOrderSkuVo> skuVos = ObjectUtil.getGoblinOrderSkuVoArrayList();
for (String orderSkuId : orderVo.getOrderSkuVoIds()) { for (String orderSkuId : orderVo.getOrderSkuVoIds()) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId);
...@@ -131,7 +132,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -131,7 +132,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
if (orderRefundIds.size() > 0) { if (orderRefundIds.size() > 0) {
GoblinBackOrderVo backOrderVo = redisUtils.getBackOrderVo(orderRefundIds.get(orderRefundIds.size() - 1)); GoblinBackOrderVo backOrderVo = redisUtils.getBackOrderVo(orderRefundIds.get(orderRefundIds.size() - 1));
vo.setRefundStatus(backOrderVo.getStatus()); vo.setRefundStatus(backOrderVo.getStatus());
if (vo.getCanRefund() == 1 && if (vo.getCanRefund() == 1 && backOrderVo.getRefuseSize() < 1 &&
(backOrderVo.getStatus() == 2 || backOrderVo.getStatus() == 3 || backOrderVo.getStatus() == 5) && (backOrderVo.getStatus() == 2 || backOrderVo.getStatus() == 3 || backOrderVo.getStatus() == 5) &&
(vo.getStoreOrderVo().getStatus() == GoblinStatusConst.Status.ORDER_STATUS_2.getValue() || vo.getStoreOrderVo().getStatus() == GoblinStatusConst.Status.ORDER_STATUS_4.getValue())) { (vo.getStoreOrderVo().getStatus() == GoblinStatusConst.Status.ORDER_STATUS_2.getValue() || vo.getStoreOrderVo().getStatus() == GoblinStatusConst.Status.ORDER_STATUS_4.getValue())) {
......
...@@ -82,6 +82,12 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -82,6 +82,12 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
vo.setStatus(item.getStatus()); vo.setStatus(item.getStatus());
vo.setMarketType(item.getMarketType()); vo.setMarketType(item.getMarketType());
vo.setPriceExpress(item.getPriceExpress()); vo.setPriceExpress(item.getPriceExpress());
if (item.getMarketId() == null || item.getMarketId().equals("")) {
vo.setMarketName("");
} else {
GoblinSelfMarketingVo marketingVo = redisUtils.getSelfMarket(item.getMarketId().split("ZZ")[1]);
vo.setMarketName(marketingVo.getName());
}
List<GoblinStoreOrderListSkuVo> orderListSkuVos = ObjectUtil.getGoblinStoreOrderListSkuVoArrayList(); List<GoblinStoreOrderListSkuVo> orderListSkuVos = ObjectUtil.getGoblinStoreOrderListSkuVoArrayList();
for (String skuId : item.getOrderSkuVoIds()) { for (String skuId : item.getOrderSkuVoIds()) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(skuId); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(skuId);
......
...@@ -985,7 +985,7 @@ public class GoblinMongoUtils { ...@@ -985,7 +985,7 @@ public class GoblinMongoUtils {
Query query = Query.query(criteria); Query query = Query.query(criteria);
query.with(Sort.by(Sort.Order.desc("createdAt"))); query.with(Sort.by(Sort.Order.desc("createdAt")));
query.skip(skipCount).limit(size); query.skip(skipCount).limit(size);
query.fields().include("orderCode").include("createdAt").include("payType").include("status").include("orderSkuVoIds").include("orderId").include("priceActual").include("priceExpress") query.fields().include("orderCode").include("createdAt").include("payType").include("status").include("orderSkuVoIds").include("orderId").include("priceActual").include("priceExpress").include("marketId")
.include("orderAttrVo.expressContacts").include("orderAttrVo.expressAddressDetail").include("orderAttrVo.expressAddress").include("orderAttrVo.expressPhone"); .include("orderAttrVo.expressContacts").include("orderAttrVo.expressAddressDetail").include("orderAttrVo.expressAddress").include("orderAttrVo.expressPhone");
List<GoblinStoreOrderVo> dataList = mongoTemplate.find(query, GoblinStoreOrderVo.class, GoblinStoreOrderVo.class.getSimpleName()); List<GoblinStoreOrderVo> dataList = mongoTemplate.find(query, GoblinStoreOrderVo.class, GoblinStoreOrderVo.class.getSimpleName());
//查询总数量 //查询总数量
......
...@@ -508,12 +508,21 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -508,12 +508,21 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
List<GoblinOrderSkuVo> skuVoList = ObjectUtil.getGoblinOrderSkuVoArrayList(); List<GoblinOrderSkuVo> skuVoList = ObjectUtil.getGoblinOrderSkuVoArrayList();
for (GoblinOrderSqlParam item : sqlParams) { for (GoblinOrderSqlParam item : sqlParams) {
List<String> goblinOrderSkuIdList = CollectionUtil.linkedListString(); List<String> goblinOrderSkuIdList = CollectionUtil.linkedListString();
BigDecimal restVoucherPrice = item.getStoreOrder().getPriceVoucher();
for (int i = 0; i < item.getOrderSkuList().size(); i++) { for (int i = 0; i < item.getOrderSkuList().size(); i++) {
GoblinOrderSku orderSku = item.getOrderSkuList().get(i); GoblinOrderSku orderSku = item.getOrderSkuList().get(i);
if (item.getStoreOrder().getPriceVoucher().compareTo(BigDecimal.ZERO) > 0 && i == 0) { if (item.getStoreOrder().getPriceVoucher().compareTo(BigDecimal.ZERO) > 0) {
orderSku.setPriceVoucher(item.getStoreOrder().getPriceVoucher()); restVoucherPrice = restVoucherPrice.subtract(orderSku.getSkuPrice());
BigDecimal skuPriceActual = orderSku.getSkuPrice().subtract(item.getStoreOrder().getPriceVoucher()); if (restVoucherPrice.compareTo(BigDecimal.ZERO) > 0) {
orderSku.setSkuPriceActual(skuPriceActual.compareTo(BigDecimal.ZERO) > 0 ? skuPriceActual : BigDecimal.ZERO); orderSku.setPriceVoucher(orderSku.getSkuPrice());
BigDecimal skuPriceActual = orderSku.getSkuPrice().subtract(orderSku.getSkuPrice());
orderSku.setSkuPriceActual(skuPriceActual.compareTo(BigDecimal.ZERO) > 0 ? skuPriceActual : BigDecimal.ZERO);
} else {
orderSku.setPriceVoucher(restVoucherPrice.add(orderSku.getSkuPrice()));
BigDecimal skuPriceActual = orderSku.getSkuPrice().subtract(orderSku.getPriceVoucher());
orderSku.setSkuPriceActual(skuPriceActual.compareTo(BigDecimal.ZERO) > 0 ? skuPriceActual : BigDecimal.ZERO);
}
} }
sqlDataSku.add(new Object[]{ sqlDataSku.add(new Object[]{
orderSku.getOrderSkuId(), orderSku.getOrderId(), orderSku.getSpuId(), orderSku.getSpuName(), orderSku.getSpuPic(), orderSku.getSkuId(), orderSku.getNum(), orderSku.getSkuPrice(), orderSku.getSkuPriceActual(), orderSku.getSkuName(), orderSku.getOrderSkuId(), orderSku.getOrderId(), orderSku.getSpuId(), orderSku.getSpuName(), orderSku.getSpuPic(), orderSku.getSkuId(), orderSku.getNum(), orderSku.getSkuPrice(), orderSku.getSkuPriceActual(), orderSku.getSkuName(),
...@@ -724,7 +733,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -724,7 +733,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_5.getValue() && syncOrderParam.getStatus().equals(1)) { if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_5.getValue() && syncOrderParam.getStatus().equals(1)) {
log.error("订单号为 {} 的订单超时支付", syncOrderParam.getOrderCode()); log.error("订单号为 {} 的订单超时支付", syncOrderParam.getOrderCode());
// 商铺退款逻辑 // 商铺退款逻辑
orderUtils.refundOrderSku(orderId,syncOrderParam.getPaymentId(),syncOrderParam.getPaymentType()); orderUtils.refundOrderSku(orderId, syncOrderParam.getPaymentId(), syncOrderParam.getPaymentType());
// orderVo.setStatus(GoblinStatusConst.OrderStatus.ORDER_STATUS_61.getValue()); // orderVo.setStatus(GoblinStatusConst.OrderStatus.ORDER_STATUS_61.getValue());
// redisUtils.setGoblinOrder(orderVo.getOrderId(),orderVo); // redisUtils.setGoblinOrder(orderVo.getOrderId(),orderVo);
} else if ((orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_6.getValue() || orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_7.getValue()) && syncOrderParam.getStatus().equals(1)) { } else if ((orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_6.getValue() || orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_7.getValue()) && syncOrderParam.getStatus().equals(1)) {
...@@ -766,7 +775,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -766,7 +775,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
logVo.setOrderCode(orderVo.getOrderCode()); logVo.setOrderCode(orderVo.getOrderCode());
logVo.setPayCode(orderVo.getPayCode()); logVo.setPayCode(orderVo.getPayCode());
logVo.setStoreId(orderVo.getStoreId()); logVo.setStoreId(orderVo.getStoreId());
if (orderSkuVo.getSkuId().indexOf(GoblinStatusConst.MarketPreStatus.MARKET_PRE_PURCHASE.getValue()) > 0) { if (orderSkuVo.getSkuId().indexOf(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue()) > 0) {
logVo.setOrderType("zhengzai"); logVo.setOrderType("zhengzai");
} else { } else {
logVo.setOrderType("order"); logVo.setOrderType("order");
...@@ -903,7 +912,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -903,7 +912,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
String orderId = backOrderVo.getOrderId(); String orderId = backOrderVo.getOrderId();
List<GoblinBackOrderSkuVo> backOrderSkuVos = backOrderVo.getBackOrderSkuVos(); List<GoblinBackOrderSkuVo> backOrderSkuVos = backOrderVo.getBackOrderSkuVos();
GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId); GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId);
orderVo.setPriceRefund(orderVo.getPriceRefund()==null?BigDecimal.ZERO:orderVo.getPriceRefund().add(refundCallbackParam.getRefundPrice())); orderVo.setPriceRefund(orderVo.getPriceRefund() == null ? BigDecimal.ZERO : orderVo.getPriceRefund().add(refundCallbackParam.getRefundPrice()));
if (orderVo.getPriceRefund().compareTo(orderVo.getPriceActual()) >= 0) { if (orderVo.getPriceRefund().compareTo(orderVo.getPriceActual()) >= 0) {
//整单退款 退券 //整单退款 退券
orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_6.getValue()); orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_6.getValue());
...@@ -943,7 +952,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -943,7 +952,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
logVo.setOrderId(orderVo.getOrderId()); logVo.setOrderId(orderVo.getOrderId());
logVo.setOrderCode(orderVo.getOrderCode()); logVo.setOrderCode(orderVo.getOrderCode());
logVo.setPayCode(orderVo.getPayCode()); logVo.setPayCode(orderVo.getPayCode());
if (orderSkuVo.getSkuId().indexOf(GoblinStatusConst.MarketPreStatus.MARKET_PRE_PURCHASE.getValue()) > 0) { if (orderSkuVo.getSkuId().indexOf(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue()) > 0) {
logVo.setOrderType("zhengzai"); logVo.setOrderType("zhengzai");
} else { } else {
logVo.setOrderType("order"); logVo.setOrderType("order");
...@@ -952,9 +961,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -952,9 +961,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
logVo.setSpuId(orderSkuVo.getSpuId()); logVo.setSpuId(orderSkuVo.getSpuId());
logVo.setSpuName(backOrderSkuVo.getSpuName()); logVo.setSpuName(backOrderSkuVo.getSpuName());
logVo.setSkuId(backOrderSkuVo.getSkuId()); logVo.setSkuId(backOrderSkuVo.getSkuId());
if (orderVo.getStatus().equals(GoblinStatusConst.Status.ORDER_STATUS_6.getValue())) { // if (orderVo.getStatus().equals(GoblinStatusConst.Status.ORDER_STATUS_6.getValue())) {
refundSkuPrice = refundSkuPrice.subtract(orderVo.getPriceExpress()); // refundSkuPrice = refundSkuPrice.add(orderVo.getPriceExpress());
} // }
logVo.setSkuPriceActual(refundSkuPrice.multiply(BigDecimal.valueOf(100)).negate().longValue()); logVo.setSkuPriceActual(refundSkuPrice.multiply(BigDecimal.valueOf(100)).negate().longValue());
logVo.setStatus(GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue()); logVo.setStatus(GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue());
logVo.setRemark("订单退款"); logVo.setRemark("订单退款");
......
...@@ -19,10 +19,10 @@ public class DataController { ...@@ -19,10 +19,10 @@ public class DataController {
private DataImpl data; private DataImpl data;
@PostMapping("refreshScore") @PostMapping("phpGoodsOrder")
@ApiOperation("过期历史积分") @ApiOperation("php今年订单迁移")
public ResponseDto<Boolean> fieldData() { public ResponseDto<Boolean> fieldData() {
data.refreshScore(); data.fieldData();
return ResponseDto.success(); return ResponseDto.success();
} }
......
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