fix:移除多余日志

This commit is contained in:
haoxr 2021-03-21 10:11:17 +08:00
parent bd249300f0
commit a652073ff8
9 changed files with 41 additions and 22 deletions

View File

@ -39,6 +39,10 @@ public class OmsOrderItem extends BaseEntity {
* 商品sku编号
*/
private String skuCode;
private String skuName;
/**
* 商品sku名字
*/
@ -92,6 +96,4 @@ public class OmsOrderItem extends BaseEntity {
*/
private Integer deleted;
}

View File

@ -15,6 +15,7 @@ import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -41,8 +42,8 @@ public class OrderController {
@ApiImplicitParam(name = "status", value = "订单状态", paramType = "query", dataType = "Integer")
})
public Result list(
Long page,
Long limit,
@RequestParam(defaultValue = "1") Long page,
@RequestParam(defaultValue = "10") Long limit,
Integer status
) {
IPage<OmsOrder> result = orderService.list(new Page<>(page, limit), new OmsOrder().setStatus(status));

View File

@ -18,7 +18,7 @@ public interface OrderMapper extends BaseMapper<OmsOrder> {
@Select("<script>" +
" select id,order_sn,total_amount,pay_amount,status from oms_order" +
" select id,order_sn,total_amount,pay_amount,status,total_amount,total_quantity,gmt_create from oms_order" +
" where 1=1 " +
" <if test ='order.status !=null ' >" +
" AND status= #{order.status} " +

View File

@ -39,10 +39,7 @@ import org.springframework.data.redis.core.script.DefaultRedisScript;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.stream.Collectors;
@ -174,13 +171,18 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OmsOrder> impleme
.setSourceType(OrderTypeEnum.APP.getCode())
.setMemberId(RequestUtils.getUserId())
.setRemark(submitDTO.getRemark())
.setPayAmount(submitDTO.getPayAmount());
.setPayAmount(submitDTO.getPayAmount())
.setTotalQuantity(orderItems.stream().map(item -> item.getCount()).reduce(0, (x, y) -> x + y))
.setTotalAmount(orderItems.stream().map(item -> item.getPrice() * item.getCount()).reduce(0l, (x, y) -> x + y))
.setGmtCreate(new Date());
;
this.save(order);
// 创建订单商品
List<OmsOrderItem> orderItemList = orderItems.stream().map(item -> OmsOrderItem.builder()
.orderId(order.getId())
.skuId(item.getSkuId())
.skuName(item.getTitle())
.skuPrice(item.getPrice())
.skuPic(item.getPic())
.skuQuantity(item.getCount())
@ -247,7 +249,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OmsOrder> impleme
}
@Override
public IPage<OmsOrder> list(Page<OmsOrder> page, OmsOrder order) {
List<OmsOrder> list = this.baseMapper.list(page, order);

View File

@ -11,7 +11,7 @@ public class PmsSku extends BaseEntity {
@TableId(type = IdType.AUTO)
private Long id;
private Long spuId;
private String title;
private String name;
private String code;
private String pic;
private Long originPrice;

View File

@ -10,5 +10,7 @@ public class MemberVO {
private String avatar;
private Long balance;
}

View File

@ -11,3 +11,4 @@ spring:
config:
server-addr: ${spring.cloud.nacos.discovery.server-addr}
file-extension: yaml

View File

@ -59,6 +59,18 @@
<appender-ref ref="LOGIN_LOGSTASH"/>
</logger>
<logger name="com.alibaba.nacos" level="ERROR" additivity="true">
<appender-ref ref="CONSOLE"/>
</logger>
<logger name="org.springframework.data.redis" level="ERROR" additivity="true">
<appender-ref ref="CONSOLE"/>
</logger>
<logger name="io.lettuce" level="ERROR" additivity="true">
<appender-ref ref="CONSOLE"/>
</logger>
<!-- 根logger -->
<root>
<level>INFO</level>