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;
|
}
|
}
|