自动化立体仓库 - WMS系统
#
lsh
2025-02-14 dfdd7980577e12e32fc9571f46f49385ac5edcdd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.zy.asrs.service.impl;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.entity.Order;
import com.zy.asrs.entity.OrderDetlGift;
import com.zy.asrs.mapper.OrderGiftMapper;
import com.zy.asrs.entity.OrderGift;
import com.zy.asrs.service.OrderDetlGiftService;
import com.zy.asrs.service.OrderGiftService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
@Service("orderGiftService")
public class OrderGiftServiceImpl extends ServiceImpl<OrderGiftMapper, OrderGift> implements OrderGiftService {
 
    @Autowired
    private OrderDetlGiftService orderDetlGiftService;
 
    @Override
    public void remove(Long orderId) {
        if (!this.deleteById(orderId)) {
            throw new CoolException("删除单据失败");
        }
        orderDetlGiftService.delete(new EntityWrapper<OrderDetlGift>().eq("order_id", orderId));
    }
 
    @Override
    public OrderGift selectByNo(String orderNo) {
        List<OrderGift> orderList = this.selectList(new EntityWrapper<OrderGift>().eq("order_no", orderNo));
        if (Cools.isEmpty(orderList)) {
            return null;
        }
        return orderList.get(0);
    }
}