|
|
|
|
@ -13,6 +13,7 @@ import com.zhehekeji.web.pojo.street.StreetSearch;
|
|
|
|
|
import com.zhehekeji.web.pojo.street.StreetType;
|
|
|
|
|
import com.zhehekeji.web.pojo.street.StreetVO;
|
|
|
|
|
import com.zhehekeji.web.service.robotic.NettyClient;
|
|
|
|
|
import jdk.internal.org.objectweb.asm.Handle;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
|
|
|
@ -27,7 +28,9 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
|
@ -87,7 +90,7 @@ public class StreetService {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
thread.start();
|
|
|
|
|
if(!StringUtils.isEmpty(streetVO.getLightSourceIp()) && streetVO.getLightSourcePort() != null){
|
|
|
|
|
if(!StringUtils.isEmpty(streetVO.getLightSourceIp()) && streetVO.getLightSourcePort() != null && streetVO.getLightSourcePort() != 0){
|
|
|
|
|
LightSource lightSource = new LightSource();
|
|
|
|
|
lightSource.setStreetId(street.getId());
|
|
|
|
|
lightSource.setIp(streetVO.getLightSourceIp());
|
|
|
|
|
@ -139,6 +142,9 @@ public class StreetService {
|
|
|
|
|
}
|
|
|
|
|
delByPlcId(street.getPlcId());
|
|
|
|
|
streetMapper.deleteById(id);
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("street_id",id);
|
|
|
|
|
lightSourceMapper.deleteByMap(map);
|
|
|
|
|
StreetConn.del(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -198,17 +204,37 @@ public class StreetService {
|
|
|
|
|
}
|
|
|
|
|
List<LightSource> list = lightSourceMapper.selectList(new QueryWrapper<LightSource>().eq("street_id",street.getId()));
|
|
|
|
|
if(list.size() == 0){
|
|
|
|
|
if(!StringUtils.isEmpty(streetVO.getLightSourceIp()) && streetVO.getLightSourcePort() != null && streetVO.getLightSourcePort() != 0){
|
|
|
|
|
LightSource lightSource = new LightSource();
|
|
|
|
|
lightSource.setPort(streetVO.getLightSourcePort());
|
|
|
|
|
lightSource.setIp(streetVO.getLightSourceIp());
|
|
|
|
|
lightSource.setStreetId(street.getId());
|
|
|
|
|
lightSource.setIp(streetVO.getLightSourceIp());
|
|
|
|
|
lightSource.setPort(streetVO.getLightSourcePort());
|
|
|
|
|
lightSourceMapper.insert(lightSource);
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
LightSource lightSource = new LightSource();
|
|
|
|
|
lightSource.setPort(streetVO.getLightSourcePort());
|
|
|
|
|
lightSource.setIp(streetVO.getLightSourceIp());
|
|
|
|
|
lightSourceMapper.update(lightSource,new UpdateWrapper<LightSource>().eq("street_id",street.getId()));
|
|
|
|
|
}
|
|
|
|
|
Thread thread2 = new Thread(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
if (StreetType.SINGLE.getType().equals(street.getLeftType())) {
|
|
|
|
|
stockService.init(street.getLeftShelveId(),street.getLeftRow(),street.getLeftColumn());
|
|
|
|
|
}else if(StreetType.DOUBLE.getType().equals(street.getLeftType())){
|
|
|
|
|
stockService.init(street.getLeftInsideShelveId(),street.getLeftRow(),street.getLeftColumn());
|
|
|
|
|
stockService.init(street.getLeftOutsideShelveId(),street.getLeftRow(),street.getLeftColumn());
|
|
|
|
|
}
|
|
|
|
|
if (StreetType.SINGLE.getType().equals(street.getRightType())) {
|
|
|
|
|
stockService.init(street.getRightShelveId(),street.getRightRow(),street.getRightColumn());
|
|
|
|
|
}else if (StreetType.DOUBLE.getType().equals(street.getRightType())) {
|
|
|
|
|
stockService.init(street.getRightInsideShelveId(),street.getRightRow(),street.getRightColumn());
|
|
|
|
|
stockService.init(street.getRightOutsideShelveId(),street.getRightRow(),street.getRightColumn());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
thread2.start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|