Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Godfunc committed Aug 11, 2021
1 parent c1e7ca2 commit a2fc099
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
import com.godfunc.model.NotifyOrderInfo;
import com.godfunc.service.*;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;


/**
Expand All @@ -25,13 +22,8 @@
@RequiredArgsConstructor
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {

private final OrderDetailService orderDetailService;
private final OrderLogService orderLogService;





@Override
public Order getByOrderNo(String orderNo) {
return getOne(Wrappers.<Order>lambdaQuery().eq(Order::getOrderNo, orderNo));
Expand All @@ -46,17 +38,15 @@ public Order getByTradeNo(String tradeNo) {
public boolean updatePaid(Long id, int currentStatus, NotifyOrderInfo notifyOrderInfo) {
boolean flag = lambdaUpdate().set(Order::getTradeNo, notifyOrderInfo.getTradeNo())
.set(Order::getRealAmount, notifyOrderInfo.getRealAmount())
.set(Order::getStatus, currentStatus)
.set(Order::getStatus, OrderStatusEnum.PAID.getValue())
.set(Order::getNotifyTime, LocalDateTime.now())
.eq(Order::getId, id)
.eq(Order::getStatus, OrderStatusEnum.SCAN.getValue())
.eq(Order::getStatus, currentStatus)
.update();
orderLogService.save(new OrderLog(id, currentStatus, OrderStatusEnum.SCAN.getValue(), OrderStatusLogReasonEnum.ORDER_NOTIFY.getValue(), flag));
orderLogService.save(new OrderLog(id, currentStatus, OrderStatusEnum.PAID.getValue(), OrderStatusLogReasonEnum.ORDER_NOTIFY.getValue(), flag));
return flag;

}




}
1 change: 1 addition & 0 deletions manage/src/main/resources/mapper/merchant/OrderMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
<if test="status!=null">and status = #{status}</if>
<if test="createTime!=null">and create_time = #{createTime}</if>
</where>
order by create_time
</select>
</mapper>

0 comments on commit a2fc099

Please sign in to comment.