| | |
| | | import com.hxzk.service.SystemLogService; |
| | | import com.hxzk.service.UserService; |
| | | import com.hxzk.service.VoIceTipService; |
| | | import com.hxzk.util.SessionManager; |
| | | import com.hxzk.util.result; |
| | | import com.hxzk.util.resultutil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | |
| | | @Autowired |
| | | UserController userController; |
| | | |
| | | @Autowired |
| | | SessionManager sessionManager; |
| | | |
| | | |
| | | @GetMapping("findVoice") |
| | |
| | | } |
| | | |
| | | @PostMapping("addVoice") |
| | | public void addVoice(TbVoicetip voicetip, HttpServletResponse response) throws IOException { |
| | | public void addVoice(TbVoicetip voicetip, HttpServletResponse response, HttpServletRequest request) throws IOException { |
| | | TbUser user = sessionManager.getCurrentUser(request); |
| | | voicetip.setUsername(UserController.username); |
| | | voicetip.setAddtime(gettime()); |
| | | voIceTipService.addVoice(voicetip); |
| | | TbSystemOperationLog systemOperationLog = new TbSystemOperationLog(); |
| | | systemOperationLog.setName(UserController.username); |
| | | systemOperationLog.setTime(gettime()); |
| | | systemOperationLog.setContent("新增了一条信息内容,该内容类型为:"+voicetip.getWarningtype()); |
| | | systemLogService.insertSystem(systemOperationLog); |
| | | String content = "新增了一条信息内容,该内容类型为:"+voicetip.getWarningtype(); |
| | | String contentew = "Добавлен информационный контент, который является:"+voicetip.getWarningtype(); |
| | | String ipAddress = request.getRemoteAddr(); |
| | | SystemLogController.InsertSystemLog(user.getUsername(),gettime(),content,"新增",ipAddress); |
| | | response.sendRedirect("/hxzkuwb/HouTai/SMS/MsgReminder.jsp"); |
| | | } |
| | | |
| | | @PostMapping("upVoice") |
| | | public void upVoce(TbVoicetip voicetip, HttpServletResponse response) throws IOException { |
| | | public void upVoce(TbVoicetip voicetip, HttpServletResponse response, HttpServletRequest request) throws IOException { |
| | | TbUser user = sessionManager.getCurrentUser(request); |
| | | voicetip.setUsername(UserController.username); |
| | | voicetip.setAddtime(gettime()); |
| | | voIceTipService.upVoice(voicetip); |
| | | TbSystemOperationLog systemOperationLog = new TbSystemOperationLog(); |
| | | systemOperationLog.setName(UserController.username); |
| | | systemOperationLog.setTime(gettime()); |
| | | systemOperationLog.setContent("修改了一条信息内容,该内容类型为:"+voicetip.getWarningtype()); |
| | | systemLogService.insertSystem(systemOperationLog); |
| | | String content = "修改了一条信息内容,该内容类型为:"+voicetip.getWarningtype(); |
| | | String contentew = "Изменен информационный контент, который является:"+voicetip.getWarningtype(); |
| | | String ipAddress = request.getRemoteAddr(); |
| | | SystemLogController.InsertSystemLog(user.getUsername(),gettime(),content,"修改",ipAddress); |
| | | response.sendRedirect("/hxzkuwb/HouTai/SMS/MsgReminder.jsp"); |
| | | } |
| | | |
| | | @PostMapping("deVoice") |
| | | public void deVoice(Integer id){ |
| | | public void deVoice(Integer id, HttpServletRequest request){ |
| | | TbUser user = sessionManager.getCurrentUser(request); |
| | | voIceTipService.deVoice(id); |
| | | TbSystemOperationLog systemOperationLog = new TbSystemOperationLog(); |
| | | systemOperationLog.setName(UserController.username); |
| | | systemOperationLog.setTime(gettime()); |
| | | systemOperationLog.setContent("删除了一条信息提示内容"); |
| | | systemLogService.insertSystem(systemOperationLog); |
| | | String content = "删除了一条信息提示内容"; |
| | | String contentew = "Удалено сообщение"; |
| | | String ipAddress = request.getRemoteAddr(); |
| | | SystemLogController.InsertSystemLog(user.getUsername(),gettime(),content,"删除",ipAddress); |
| | | } |
| | | |
| | | |
| | | @GetMapping("findTypeVoice") |
| | | public Integer findTypeVoice(String type){ |
| | | return voIceTipService.findTypeVoice(type); |