package com.hxzk.gps.service.impl.FzRadar;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageInfo;
|
import com.hxzk.gps.controller.Radar.dto.TableSearchResult.TableSearchResult;
|
import com.hxzk.gps.controller.System.SystemLogUtil;
|
import com.hxzk.gps.entity.FzRadar.TbFzanchor;
|
import com.hxzk.gps.mapper.FzRadar.TbFzanchorMapper;
|
import com.hxzk.gps.result.ListDataResult;
|
import com.hxzk.gps.result.ResultTable;
|
import com.hxzk.gps.result.table;
|
import com.hxzk.gps.service.FzRadar.TbFzanchorService;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.hxzk.gps.util.GetUser.UserInfoUtil;
|
import com.hxzk.gps.util.MessageUtils.MessageUtils;
|
import com.hxzk.gps.util.Result.ReturnMessage;
|
|
import com.hxzk.gps.util.UDP.UDP_FzAnchor;
|
import com.hxzk.gps.util.UDP.UDP_Person;
|
import org.springframework.stereotype.Service;
|
|
import java.util.Optional;
|
|
/**
|
* <p>
|
* 服务实现类
|
* </p>
|
*
|
* @author YuZhiTong
|
* @since 2025-05-22
|
*/
|
@Service
|
public class TbFzanchorServiceImpl extends ServiceImpl<TbFzanchorMapper, TbFzanchor> implements TbFzanchorService {
|
|
@Override
|
public ResultTable FindRadarInfo(TableSearchResult TableSearchResult) {
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
queryWrapper.eq("company", UserInfoUtil.getUserCompany());
|
Optional.ofNullable(TableSearchResult.getFzanchor().getAchorid()).ifPresent(achorid -> queryWrapper.like("achorid", achorid));
|
PageHelper.startPage(TableSearchResult.getTableList().getPageNum(),TableSearchResult.getTableList().getPageSize());
|
PageInfo<TbFzanchor> info = new PageInfo<>(baseMapper.selectList(queryWrapper));
|
table<TbFzanchor> achortable = new table<>(info.getList(),TableSearchResult.getTableList().getPageNum(),TableSearchResult.getTableList().getPageSize(),info.getTotal());
|
return ListDataResult.resultTableSuccess(achortable, MessageUtils.getMessage("Success"));
|
}
|
|
@Override
|
public ReturnMessage add(TbFzanchor fzanchor) {
|
/*
|
声明操作状态
|
* */
|
boolean isSuccess = false;
|
try {
|
/*
|
发送指令到CS
|
* */
|
UDP_FzAnchor.AddFzAnchor(fzanchor);
|
isSuccess = true;
|
}catch (Exception e){
|
|
}
|
return SystemLogUtil.handleAddResult(isSuccess,"RadarAdd",fzanchor.getAchorid());
|
}
|
|
@Override
|
public ReturnMessage update(TbFzanchor fzanchor) {
|
/*
|
声明操作状态
|
* */
|
boolean isSuccess = false;
|
try {
|
/*
|
发送指令到CS
|
* */
|
UDP_FzAnchor.UpFzAnchor(fzanchor);
|
isSuccess = true;
|
}catch (Exception e){
|
|
}
|
return SystemLogUtil.handleUpdateResult(isSuccess,"RadarUpdate",fzanchor.getAchorid());
|
}
|
|
@Override
|
public ReturnMessage delete(TbFzanchor fzanchor) {
|
/*
|
声明操作状态
|
* */
|
boolean isSuccess = false;
|
try {
|
/*
|
发送指令到CS
|
* */
|
UDP_FzAnchor.DeFzAnchor(fzanchor);
|
isSuccess = true;
|
}catch (Exception e){
|
|
}
|
return SystemLogUtil.handleDeleteResult(isSuccess,"RadarDelete",fzanchor.getAchorid());
|
}
|
}
|