18045010223
2025-07-07 0d3a683a0c97154b1f2e6657398664537e4e3e82
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package com.ruoyi.jt.service.impl;
 
import java.util.List;
 
import com.ruoyi.jt.uuid.IdUtils;
import io.netty.util.internal.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jt.mapper.JtDeviceMapper;
import com.ruoyi.jt.domain.JtDevice;
import com.ruoyi.jt.service.IJtDeviceService;
import org.yzh.web.model.entity.DeviceDO;
 
/**
 * 终端Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-21
 */
@Service
public class JtDeviceServiceImpl implements IJtDeviceService 
{
    @Autowired
    private JtDeviceMapper jtDeviceMapper;
 
    /**
     * 查询终端
     * 
     * @param id 终端主键
     * @return 终端
     */
    @Override
    public JtDevice selectJtDeviceById(Long id)
    {
        return jtDeviceMapper.selectJtDeviceById(id);
    }
 
    /**
     * 查询终端列表
     * 
     * @param jtDevice 终端
     * @return 终端
     */
    @Override
    public List<JtDevice> selectJtDeviceList(JtDevice jtDevice)
    {
        return jtDeviceMapper.selectJtDeviceList(jtDevice);
    }
 
    /**
     * 新增终端
     * 
     * @param jtDevice 终端
     * @return 结果
     */
    @Override
    public int insertJtDevice(JtDevice jtDevice)
    {
        jtDevice.setId(IdUtils.simpleUUID());
        return jtDeviceMapper.insertJtDevice(jtDevice);
    }
 
    /**
     * 修改终端
     * 
     * @param jtDevice 终端
     * @return 结果
     */
    @Override
    public int updateJtDevice(JtDevice jtDevice)
    {
        return jtDeviceMapper.updateJtDevice(jtDevice);
    }
 
    /**
     * 批量删除终端
     * 
     * @param ids 需要删除的终端主键
     * @return 结果
     */
    @Override
    public int deleteJtDeviceByIds(Long[] ids)
    {
        return jtDeviceMapper.deleteJtDeviceByIds(ids);
    }
 
    /**
     * 删除终端信息
     * 
     * @param id 终端主键
     * @return 结果
     */
    @Override
    public int deleteJtDeviceById(Long id)
    {
        return jtDeviceMapper.deleteJtDeviceById(id);
    }
 
 
    @Override
    public boolean isExistDevice(DeviceDO device) {
        if (!(StringUtil.isNullOrEmpty(device.getPlateNo()) || StringUtil.isNullOrEmpty(device.getMobileNo()))) {
            JtDevice jtDevice = new JtDevice();
            jtDevice.setPlateNo(device.getPlateNo());
            jtDevice.setClientId(device.getMobileNo());
            List list = jtDeviceMapper.selectJtDeviceList(jtDevice);
            return list.size() > 0;
        }
        return false;
    }
}