• 大小: 8.57MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-19
  • 语言: 数据库
  • 标签: Java  

资源简介

使用SpringMVC + Spring + MyBatis、实现企业工单管理系统MySQL 5 作为后台数据库,。该系统包括查看所有的项目信息、选择项目后进行工单加、添加完毕后显示添加后的工单信息三大功能。

资源截图

代码片段和文件信息

package cn.controller;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import cn.pojo.Project;
import cn.pojo.Workorder;
import cn.service.WorkorderService;


@Controller
public class WorkorderController {

private Logger logger = Logger.getLogger(WorkorderController.class);

@Resource
private WorkorderService workorderService;

/**
 * 异步获取项目
 * @return
 */
@RequestMapping(value=“/projectlist.json“method=RequestMethod.GET)
@ResponseBody
public List getProjectList(){
ListprojectList = null;
try {
projectList = workorderService.getproject();
} catch (Exception e) {
e.printStackTrace();
}
logger.info(“categoryList 数量:“+projectList.size());
return projectList;
}

/**
 * 增加工单
 * @param user
 * @return
 */
@RequestMapping(value = “/addsave.html“ method = RequestMethod.POST)
public String addWorkorder(Workorder workorderHttpSession session){
   workorder.setCreateDate(new Date());
   try {
   if(workorderService.add(workorder)>0)
   session.setAttribute(“tishi“ “保存成功!“);
   return “redirect:/workorderlist.html“;
   } catch (Exception e) {
   e.printStackTrace();
   }
    session.setAttribute(“tishi“ “保存失败!“);
    return “add“;
}

/**
 * 查询所有工单信息
 * @param model
 * @return
 */
@RequestMapping(value = “/workorderlist.html“)
public String getStudent(Model model){
List workoredrList = null;
try {
Workorder workorder=new Workorder();
workoredrList=workorderService.getWorkorderList(workorder);
} catch (Exception e) {
e.printStackTrace();
}
model.addAttribute(“workoredrList“workoredrList);
return “workorderlist“;
   }



/**
 * 获取项目的ID
 * @param projectId
 * @param session
 * @return
 * @throws NumberFormatException
 * @throws Exception
 */
@RequestMapping(value = “/getProById“ method = RequestMethod.GET)
@ResponseBody
public ModelAndView getProById(@RequestParam(“projectId“) String projectIdHttpSession session
    ) throws NumberFormatException Exception {
ModelAndView mv=new ModelAndView(“/add“); //要跳转的页面
mv.addobject(“projectId“ projectId);//保存项目ID
return mv;
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-22 09:17  Completion6\
     文件        1141  2018-12-18 19:46  Completion6\.classpath
     文件        1336  2018-12-05 10:35  Completion6\.project
     目录           0  2018-12-22 09:16  Completion6\.settings\
     文件         522  2018-12-05 09:38  Completion6\.settings\.jsdtscope
     文件          57  2018-12-18 16:01  Completion6\.settings\org.eclipse.core.resources.prefs
     文件         364  2018-12-18 19:46  Completion6\.settings\org.eclipse.jdt.core.prefs
     文件         572  2018-12-05 09:47  Completion6\.settings\org.eclipse.wst.common.component
     文件         414  2018-12-18 19:46  Completion6\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-12-05 09:38  Completion6\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-12-05 09:38  Completion6\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-12-22 09:16  Completion6\resources\
     文件        3644  2018-12-05 09:48  Completion6\resources\applicationContext-mybatis.xml
     文件         261  2018-12-05 09:48  Completion6\resources\database.properties
     文件        2987  2018-12-05 09:48  Completion6\resources\log4j.properties
     文件         508  2018-12-05 09:48  Completion6\resources\mybatis-config.xml
     文件        3066  2018-12-05 09:48  Completion6\resources\springmvc-servlet.xml
     目录           0  2018-12-22 09:16  Completion6\src\
     目录           0  2018-12-22 09:16  Completion6\src\cn\
     目录           0  2018-12-22 09:16  Completion6\src\cn\controller\
     文件        2852  2018-12-08 12:15  Completion6\src\cn\controller\WorkorderController.java
     目录           0  2018-12-22 09:16  Completion6\src\cn\dao\
     文件         578  2018-12-06 09:42  Completion6\src\cn\dao\WorkorderMapper.java
     文件         912  2018-12-06 09:42  Completion6\src\cn\dao\WorkorderMapper.xml
     目录           0  2018-12-22 09:16  Completion6\src\cn\pojo\
     文件         408  2018-12-05 10:02  Completion6\src\cn\pojo\Project.java
     文件        1546  2018-12-05 13:11  Completion6\src\cn\pojo\Workorder.java
     目录           0  2018-12-22 09:16  Completion6\src\cn\service\
     文件         575  2018-12-06 09:43  Completion6\src\cn\service\WorkorderService.java
     文件         751  2018-12-06 09:43  Completion6\src\cn\service\WorkorderServiceImpl.java
     目录           0  2018-12-22 09:16  Completion6\WebRoot\
............此处省略60个文件信息

评论

共有 条评论