| | |
| | | import com.hxzk.pojo.TbAchor; |
| | | import com.hxzk.pojo.TbSystemOperationLog; |
| | | import com.hxzk.pojo.TbTag; |
| | | import com.hxzk.pojo.TbUser; |
| | | import com.hxzk.service.AchorService; |
| | | import com.hxzk.service.SystemLogService; |
| | | import com.hxzk.udp.Udp_Out; |
| | | import com.hxzk.util.SessionManager; |
| | | import com.hxzk.util.result; |
| | | import com.hxzk.util.resultutil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | SystemLogService systemLogService; |
| | | @Autowired |
| | | SessionManager sessionManager; |
| | | |
| | | //查找基站 |
| | | @GetMapping("findanchor") |
| | | result<List<TbAchor>> findanchor(Integer page, Integer limit){ |
| | |
| | | |
| | | //删除基站 |
| | | @GetMapping("deleteanchor") |
| | | public void deleteanchor(Integer id){ |
| | | public void deleteanchor(Integer id,HttpServletRequest request){ |
| | | TbUser user = sessionManager.getCurrentUser(request); |
| | | String xieyi = "BSTOCS1,DELETEANC," + id + ",END"; |
| | | TbSystemOperationLog systemOperationLog = new TbSystemOperationLog(); |
| | | systemOperationLog.setName(UserController.username); |
| | | systemOperationLog.setTime(gettime()); |
| | | systemOperationLog.setContent("删除了一个基站,该基站为:"+id); |
| | | systemLogService.insertSystem(systemOperationLog); |
| | | String content = "删除了一个基站,该基站为:"+id; |
| | | String contentew = "Удалена базовая станция, которая является:"+id; |
| | | SystemLogController.InsertSystemLog(user.getUsername(),gettime(),content,contentew); |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | //查重 |
| | |
| | | //新增标签 |
| | | @PostMapping("addAnchor") |
| | | @ResponseBody |
| | | public void addAnchor(TbAchor achor, HttpServletResponse response) throws IOException { |
| | | public void addAnchor(TbAchor achor, HttpServletResponse response,HttpServletRequest request) throws IOException { |
| | | TbUser user = sessionManager.getCurrentUser(request); |
| | | String xieyi = "BSTOCS1,ADDANC," + achor.getAnchorid() +","+achor.getPosx()+","+achor.getPosy()+","+achor.getPosz()+","+achor.getLayer()+",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | TbSystemOperationLog systemOperationLog = new TbSystemOperationLog(); |
| | | systemOperationLog.setName(UserController.username); |
| | | systemOperationLog.setTime(gettime()); |
| | | systemOperationLog.setContent("增加了一个基站,该基站为:"+achor.getAnchorid()); |
| | | systemLogService.insertSystem(systemOperationLog); |
| | | String content = "增加了一个基站,该基站为:"+achor.getAnchorid(); |
| | | String contentew ="Добавлена базовая станция, которая является:"+achor.getAnchorid(); |
| | | SystemLogController.InsertSystemLog(user.getUsername(),gettime(),content,contentew); |
| | | response.sendRedirect("/hxzkuwb/HouTai/Anchor/Anchor.jsp"); |
| | | } |
| | | //修改标签 |
| | | @PostMapping("upAnchor") |
| | | @ResponseBody |
| | | public void upAnchor(TbAchor achor, HttpServletResponse response) throws IOException { |
| | | public void upAnchor(TbAchor achor, HttpServletResponse response,HttpServletRequest request) throws IOException { |
| | | TbUser user = sessionManager.getCurrentUser(request); |
| | | String xieyi = "BSTOCS1,UPDATEANC," + achor.getAnchorid() +","+achor.getPosx()+","+achor.getPosy()+","+achor.getPosz()+","+achor.getLayer()+",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | TbSystemOperationLog systemOperationLog = new TbSystemOperationLog(); |
| | | systemOperationLog.setName(UserController.username); |
| | | systemOperationLog.setTime(gettime()); |
| | | systemOperationLog.setContent("修改了一个基站,该基站为:"+achor.getAnchorid()); |
| | | systemLogService.insertSystem(systemOperationLog); |
| | | String content = "修改了一个基站,该基站为:"+achor.getAnchorid(); |
| | | String contentew = "Изменена базовая станция, которая является:"+achor.getAnchorid(); |
| | | SystemLogController.InsertSystemLog(user.getUsername(),gettime(),content,contentew); |
| | | response.sendRedirect("/hxzkuwb/HouTai/Anchor/Anchor.jsp"); |
| | | } |
| | | |
| | |
| | | return achorService.FindSanWeiJiZhan(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("UpJiZhanShow") |
| | | public void UpJiZhanShow(TbAchor achor){ |
| | | achorService.UpJiZhanShow(achor); |
| | | } |
| | | |
| | | public String gettime(){ |
| | | Date now = new Date(); |
| | | // 创建日期格式化对象,设置格式为 "yyyy-MM-dd HH:mm" |