1
zhang
11 小时以前 675c3b5d83b928c2bfbb84cd99a7d3f222d4432c
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
package com.zy.asrs.service.impl;
 
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zy.acs.framework.exception.CoolException;
import com.zy.asrs.entity.Devp;
import com.zy.asrs.mapper.DevpMapper;
import com.zy.asrs.service.DevpService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
@Service("basDevpService")
public class DevpServiceImpl extends ServiceImpl<DevpMapper, Devp> implements DevpService {
 
    @Override
    public void updateBatchByDevpNo(List<Devp> devps) {
        for (Devp devp : devps) {
            Devp de = baseMapper.getDevpByDevNo(devp.getDevNo());
            if (de != null) {
                de.setSqlData(devp);
                baseMapper.updateById(de);
            }
        }
    }
 
 
 
 
    @Override
    public Devp checkSiteStatus(Integer devpNo) {
        return checkSiteStatus(devpNo, false);
    }
 
    @Override
    public Devp checkSiteStatus(Integer devpNo, boolean put) {
        Devp station = selectById(devpNo);
        if (station == null) {
            throw new CoolException(devpNo + "站点不存在");
        }
        if (put) {
            if (station.getAutoing() == null || !station.getAutoing().equals("Y")) {
                throw new CoolException(devpNo + "站点不是自动状态");
            }
            if (station.getLoading() == null || !station.getLoading().equals("Y")) {
                throw new CoolException(devpNo + "站点无物");
            }
            if (station.getWrkNo() != null && station.getWrkNo() > 0) {
                throw new CoolException(devpNo + "站点已有工作号");
            }
 
        }
        return station;
    }
}