采用阿里代码规约,对代码进行优化

This commit is contained in:
lifenlong
2021-07-09 01:56:24 +08:00
parent 9e240f22b6
commit 3e73257922
343 changed files with 2626 additions and 1476 deletions

View File

@@ -12,6 +12,7 @@ import cn.lili.modules.order.order.entity.dto.OrderMessage;
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
import cn.lili.timetask.handler.EveryDayExecute;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -23,13 +24,18 @@ import javax.annotation.Resource;
* @author Chopper
* @date 2020-07-03 11:20
*/
@Slf4j
@Service
public class DistributionOrderExecute implements OrderStatusChangeEvent, EveryDayExecute, AfterSaleStatusChangeEvent {
//分销订单
/**
* 分销订单
*/
@Autowired
private DistributionOrderService distributionOrderService;
//分销订单持久层
/**
* 分销订单持久层
*/
@Resource
private DistributionOrderMapper distributionOrderMapper;
@@ -48,6 +54,9 @@ public class DistributionOrderExecute implements OrderStatusChangeEvent, EveryDa
distributionOrderService.cancelOrder(orderMessage.getOrderSn());
break;
}
default:
log.error("分销订单执行异常:", orderMessage.getOrderSn());
break;
}
}

View File

@@ -44,7 +44,7 @@ public class NoticeMessageExecute implements TradeEvent, OrderStatusChangeEvent,
NoticeMessageDTO noticeMessageDTO = new NoticeMessageDTO();
noticeMessageDTO.setMemberId(tradeDTO.getMemberId());
noticeMessageDTO.setNoticeMessageNodeEnum(NoticeMessageNodeEnum.ORDER_CREATE_SUCCESS);
Map<String, String> params = new HashMap<>();
Map<String, String> params = new HashMap<>(2);
params.put("goods", tradeDTO.getSkuList().get(0).getGoodsSku().getGoodsName());
noticeMessageDTO.setParameter(params);
//保存站内信
@@ -58,7 +58,7 @@ public class NoticeMessageExecute implements TradeEvent, OrderStatusChangeEvent,
NoticeMessageDTO noticeMessageDTO = new NoticeMessageDTO();
//如果订单状态不为空
if (orderDetailVO != null) {
Map<String, String> params = new HashMap<>();
Map<String, String> params = new HashMap<>(2);
switch (orderMessage.getNewStatus()) {
//如果订单新的状态为已取消 则发送取消订单站内信
case CANCELLED:
@@ -103,7 +103,7 @@ public class NoticeMessageExecute implements TradeEvent, OrderStatusChangeEvent,
public void afterSaleStatusChange(AfterSale afterSale) {
NoticeMessageDTO noticeMessageDTO = new NoticeMessageDTO();
noticeMessageDTO.setMemberId(afterSale.getMemberId());
Map<String, String> params = new HashMap<>();
Map<String, String> params = new HashMap<>(2);
params.put("goods", afterSale.getGoodsName());
params.put("refuse", afterSale.getAuditRemark());
noticeMessageDTO.setParameter(params);
@@ -154,7 +154,7 @@ public class NoticeMessageExecute implements TradeEvent, OrderStatusChangeEvent,
//组织站内信参数
NoticeMessageDTO noticeMessageDTO = new NoticeMessageDTO();
noticeMessageDTO.setMemberId(memberPointMessage.getMemberId());
Map<String, String> params = new HashMap<>();
Map<String, String> params = new HashMap<>(2);
if (memberPointMessage.getType()) {
params.put("expenditure_points", "0");
params.put("income_points", memberPointMessage.getPoint().toString());
@@ -178,7 +178,7 @@ public class NoticeMessageExecute implements TradeEvent, OrderStatusChangeEvent,
//组织参数
NoticeMessageDTO noticeMessageDTO = new NoticeMessageDTO();
noticeMessageDTO.setMemberId(memberWithdrawalMessage.getMemberId());
Map<String, String> params = new HashMap<>();
Map<String, String> params = new HashMap<>(2);
params.put("income", memberWithdrawalMessage.getPrice().toString());
noticeMessageDTO.setParameter(params);
noticeMessageDTO.setNoticeMessageNodeEnum(NoticeMessageNodeEnum.WALLET_WITHDRAWAL_SUCCESS);

View File

@@ -10,6 +10,7 @@ import cn.lili.modules.order.order.service.OrderService;
import cn.lili.modules.payment.entity.RefundLog;
import cn.lili.modules.payment.kit.Payment;
import cn.lili.modules.payment.kit.enums.PaymentMethodEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -19,6 +20,7 @@ import org.springframework.stereotype.Service;
* @author Chopper
* @date 2021-03-13 16:58
*/
@Slf4j
@Service
public class PaymentExecute implements OrderStatusChangeEvent {
@@ -64,6 +66,9 @@ public class PaymentExecute implements OrderStatusChangeEvent {
break;
case BANK_TRANSFER:
break;
default:
log.error("订单支付执行异常,订单编号:", orderMessage.getOrderSn());
break;
}
break;
default: