From 2480c8896f05a3eb839fe64c3cad75b44f5a63d9 Mon Sep 17 00:00:00 2001 From: Elvis Date: Fri, 15 Jun 2018 15:47:41 +0800 Subject: [PATCH] 添加软件管理模块。对软件形成统一的管理 --- WebRoot/WEB-INF/jsp/software/software/software_edit.jsp | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ WebRoot/WEB-INF/jsp/software/software/software_list.jsp | 366 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ WebRoot/WEB-INF/jsp/software/softwareversion/softwareversion_edit.jsp | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ WebRoot/WEB-INF/jsp/software/softwareversion/softwareversion_list.jsp | 373 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_edit.jsp | 14 ++------------ WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_list.jsp | 2 -- WebRoot/WEB-INF/tld/elfun.tld | 8 ++++++++ resources/mybatis1/software/SoftWareMapper.xml | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ resources/mybatis1/software/SoftwareVersionMapper.xml | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ resources/mybatis1/sunvote/StudentTestMapper.xml | 18 ++++++++++++++++-- resources/mybatis1/sunvote/TestPaperInfoMapper.xml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- resources/mybatis1/sunvote/TestPaperMapper.xml | 27 +++++++++++++++++++++++++++ src/com/fh/controller/api/ApiServer.java | 4 ++-- src/com/fh/controller/api/V1.java | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------- src/com/fh/controller/software/software/SoftWareController.java | 207 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/com/fh/controller/software/softwareversion/SoftwareVersionController.java | 245 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/com/fh/controller/sunvote/Myelfun.java | 17 ++++++++++++++++- src/com/fh/service/software/software/SoftWareManager.java | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/com/fh/service/software/software/impl/SoftWareService.java | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/com/fh/service/software/softwareversion/SoftwareVersionManager.java | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/com/fh/service/software/softwareversion/impl/SoftwareVersionService.java | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/com/fh/service/sunvote/testpaper/TestPaperManager.java | 8 ++++++++ src/com/fh/service/sunvote/testpaper/impl/TestPaperService.java | 10 ++++++++++ src/com/fh/service/sunvote/testpaperinfo/TestPaperInfoManager.java | 8 ++++++++ src/com/fh/service/sunvote/testpaperinfo/impl/TestPaperInfoService.java | 8 ++++++++ 25 files changed, 2344 insertions(+), 38 deletions(-) create mode 100644 WebRoot/WEB-INF/jsp/software/software/software_edit.jsp create mode 100644 WebRoot/WEB-INF/jsp/software/software/software_list.jsp create mode 100644 WebRoot/WEB-INF/jsp/software/softwareversion/softwareversion_edit.jsp create mode 100644 WebRoot/WEB-INF/jsp/software/softwareversion/softwareversion_list.jsp create mode 100644 resources/mybatis1/software/SoftWareMapper.xml create mode 100644 resources/mybatis1/software/SoftwareVersionMapper.xml create mode 100644 src/com/fh/controller/software/software/SoftWareController.java create mode 100644 src/com/fh/controller/software/softwareversion/SoftwareVersionController.java create mode 100644 src/com/fh/service/software/software/SoftWareManager.java create mode 100644 src/com/fh/service/software/software/impl/SoftWareService.java create mode 100644 src/com/fh/service/software/softwareversion/SoftwareVersionManager.java create mode 100644 src/com/fh/service/software/softwareversion/impl/SoftwareVersionService.java diff --git a/WebRoot/WEB-INF/jsp/software/software/software_edit.jsp b/WebRoot/WEB-INF/jsp/software/software/software_edit.jsp new file mode 100644 index 0000000..fd5e3c9 --- /dev/null +++ b/WebRoot/WEB-INF/jsp/software/software/software_edit.jsp @@ -0,0 +1,108 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> +<% + String path = request.getContextPath(); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; +%> + + + + + + + + <%@ include file="../../system/index/top.jsp"%> + + + + + +
+ +
+
+
+
+
+ +
+ +
+ + + + + + + + + + + + +
软件名称:
软件描述:
+ 保存 + 取消 +
+
+ +
+
+ +
+ +
+ +
+
+ +
+ + + + + <%@ include file="../../system/index/foot.jsp"%> + + + + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/jsp/software/software/software_list.jsp b/WebRoot/WEB-INF/jsp/software/software/software_list.jsp new file mode 100644 index 0000000..6606c80 --- /dev/null +++ b/WebRoot/WEB-INF/jsp/software/software/software_list.jsp @@ -0,0 +1,366 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> +<% + String path = request.getContextPath(); + String basePath = request.getScheme() + "://" + + request.getServerName() + ":" + request.getServerPort() + + path + "/"; +%> + + + + + + + +<%@ include file="../../system/index/top.jsp"%> + + + + + + +
+ +
+
+
+
+
+ + +
+ + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 序号软件名称软件描述操作
+ + ${vs.index+1}${var.NAME}${var.DESC} + + + + + +
您无权查看
没有相关数据
+ +
+ +
+ +
+ +
+ +
+
+ + + + + + + +
+ + + + + <%@ include file="../../system/index/foot.jsp"%> + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/jsp/software/softwareversion/softwareversion_edit.jsp b/WebRoot/WEB-INF/jsp/software/softwareversion/softwareversion_edit.jsp new file mode 100644 index 0000000..43adacb --- /dev/null +++ b/WebRoot/WEB-INF/jsp/software/softwareversion/softwareversion_edit.jsp @@ -0,0 +1,160 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> +<%@ taglib prefix="myelfun" uri="/WEB-INF/tld/elfun.tld"%> +<% + String path = request.getContextPath(); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; +%> + + + + + + + + <%@ include file="../../system/index/top.jsp"%> + + + + + +
+ +
+
+
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
软件名称: + +
版本名称:
版本代号:
文件:
版本描述:
+ 保存 + 取消 +
+
+ +
+
+ +
+ +
+ +
+
+ +
+ + + + + <%@ include file="../../system/index/foot.jsp"%> + + + + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/jsp/software/softwareversion/softwareversion_list.jsp b/WebRoot/WEB-INF/jsp/software/softwareversion/softwareversion_list.jsp new file mode 100644 index 0000000..0fe68bb --- /dev/null +++ b/WebRoot/WEB-INF/jsp/software/softwareversion/softwareversion_list.jsp @@ -0,0 +1,373 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> +<%@ taglib prefix="myelfun" uri="/WEB-INF/tld/elfun.tld"%> +<% + String path = request.getContextPath(); + String basePath = request.getScheme() + "://" + + request.getServerName() + ":" + request.getServerPort() + + path + "/"; +%> + + + + + + + +<%@ include file="../../system/index/top.jsp"%> + + + + + + +
+ +
+
+
+
+
+ + +
+ + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 序号软件名称版本名称版本代号版本存放路径更新描述操作
+ + ${vs.index+1}${myelfun:findSoftwareName(var.SOFTWARE_ID)}${var.VERSION_NAME}${var.VERSION_CODE}下载${var.VERSION_DESC} + + + + + +
您无权查看
没有相关数据
+ +
+ +
+ +
+ +
+ +
+
+ + + + + + + +
+ + + + + <%@ include file="../../system/index/foot.jsp"%> + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_edit.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_edit.jsp index 5ddacfd..8c91a78 100644 --- a/WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_edit.jsp +++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_edit.jsp @@ -76,10 +76,10 @@ <%-- --%> - + <%-- 科目列表: - + --%> 教师卡编号: @@ -199,16 +199,6 @@ $("#SEX").focus(); return false; } - if($("#SUBJECT_IDS").val()==""){ - $("#SUBJECT_IDS").tips({ - side:3, - msg:'请输入科目列表', - bg:'#AE81FF', - time:2 - }); - $("#SUBJECT_IDS").focus(); - return false; - } if($("#KEYPAD_ID").val()==""){ $("#KEYPAD_ID").tips({ side:3, diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_list.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_list.jsp index 5c6495b..d561a53 100644 --- a/WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_list.jsp +++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_list.jsp @@ -74,7 +74,6 @@ 证件号 账号 性别 - 科目列表 教师卡编号 操作 @@ -98,7 +97,6 @@ ${var.CARD_NO} ${var.ACCOUT} ${var.SEX == 1? "男":"女"} - ${var.SUBJECT_IDS} ${var.KEYPAD_ID} diff --git a/WebRoot/WEB-INF/tld/elfun.tld b/WebRoot/WEB-INF/tld/elfun.tld index 277e870..1a047de 100644 --- a/WebRoot/WEB-INF/tld/elfun.tld +++ b/WebRoot/WEB-INF/tld/elfun.tld @@ -126,6 +126,14 @@ ${myelfun:findTestPaperName(obj1)} + + 根据ID查找软件名称 + findSoftwareName + com.fh.controller.sunvote.Myelfun + java.lang.String findSoftwareName(java.lang.String) + ${myelfun:findSoftwareName(obj1)} + + diff --git a/resources/mybatis1/software/SoftWareMapper.xml b/resources/mybatis1/software/SoftWareMapper.xml new file mode 100644 index 0000000..f04a622 --- /dev/null +++ b/resources/mybatis1/software/SoftWareMapper.xml @@ -0,0 +1,104 @@ + + + + + + + SW_SOFTWARE + + + + + `NAME`, + `DESC`, + SOFTWARE_ID + + + + + #{NAME}, + #{DESC}, + #{SOFTWARE_ID} + + + + + insert into + + ( + + ) values ( + + ) + + + + + delete from + + where + SOFTWARE_ID = #{SOFTWARE_ID} + + + + + update + + set + `NAME` = #{NAME}, + `DESC` = #{DESC}, + SOFTWARE_ID = SOFTWARE_ID + where + SOFTWARE_ID = #{SOFTWARE_ID} + + + + + + + + + + + + + + delete from + + where + SOFTWARE_ID in + + #{item} + + + + + \ No newline at end of file diff --git a/resources/mybatis1/software/SoftwareVersionMapper.xml b/resources/mybatis1/software/SoftwareVersionMapper.xml new file mode 100644 index 0000000..5c889ea --- /dev/null +++ b/resources/mybatis1/software/SoftwareVersionMapper.xml @@ -0,0 +1,128 @@ + + + + + + + SW_SOFTWAREVERSION + + + + + SOFTWARE_ID, + VERSION_NAME, + VERSION_CODE, + VERSION_PATH, + VERSION_DESC, + SOFTWAREVERSION_ID + + + + + #{SOFTWARE_ID}, + #{VERSION_NAME}, + #{VERSION_CODE}, + #{VERSION_PATH}, + #{VERSION_DESC}, + #{SOFTWAREVERSION_ID} + + + + + insert into + + ( + + ) values ( + + ) + + + + + delete from + + where + SOFTWAREVERSION_ID = #{SOFTWAREVERSION_ID} + + + + + update + + set + SOFTWARE_ID = #{SOFTWARE_ID}, + VERSION_NAME = #{VERSION_NAME}, + VERSION_CODE = #{VERSION_CODE}, + VERSION_PATH = #{VERSION_PATH}, + VERSION_DESC = #{VERSION_DESC}, + SOFTWAREVERSION_ID = SOFTWAREVERSION_ID + where + SOFTWAREVERSION_ID = #{SOFTWAREVERSION_ID} + + + + + + + + + + + + + + + + + delete from + + where + SOFTWAREVERSION_ID in + + #{item} + + + + + \ No newline at end of file diff --git a/resources/mybatis1/sunvote/StudentTestMapper.xml b/resources/mybatis1/sunvote/StudentTestMapper.xml index cbfd91d..28e077f 100644 --- a/resources/mybatis1/sunvote/StudentTestMapper.xml +++ b/resources/mybatis1/sunvote/StudentTestMapper.xml @@ -42,8 +42,22 @@ delete from - where - STUDENTTEST_ID = #{STUDENTTEST_ID} + where 1 =1 + + and STUDENTTEST_ID = #{STUDENTTEST_ID} + + + and STUDENT_ID = #{STUDENT_ID} + + + and TEST_ID = #{TEST_ID} + + + and PAPER_ID = #{PAPER_ID} + + + and CLASS_ID = #{CLASS_ID} + diff --git a/resources/mybatis1/sunvote/TestPaperInfoMapper.xml b/resources/mybatis1/sunvote/TestPaperInfoMapper.xml index e3cb98e..9964956 100644 --- a/resources/mybatis1/sunvote/TestPaperInfoMapper.xml +++ b/resources/mybatis1/sunvote/TestPaperInfoMapper.xml @@ -58,12 +58,65 @@ ) + + + insert into + + ( + + ) values + + + ( + #{item.PAPER_ID}, + #{item.STUDENT_ID}, + #{item.TEST_ID}, + #{item.QUESTION_ID}, + #{item.ANSWER}, + #{item.RIGHT}, + #{item.SCORE}, + #{item.LIKES}, + #{item.ANSWER_TYPE}, + #{item.PRESS_TIME}, + #{item.RECEIVER_DATE}, + #{item.SUBJECTIVE}, + #{item.NOTE}, + #{item.MARK_NO}, + #{item.RANK}, + #{item.TESTPAPERINFO_ID} + ) + + + + delete from - where - TESTPAPERINFO_ID = #{TESTPAPERINFO_ID} + where 1 =1 + + and TESTPAPERINFO_ID = #{TESTPAPERINFO_ID} + + + and TEST_ID = #{TEST_ID} + + + and STUDENT_ID = #{STUDENT_ID} + + + and PAPER_ID = #{PAPER_ID} + + + and QUESTION_ID = #{QUESTION_ID} + + + + and 1 = 2 + diff --git a/resources/mybatis1/sunvote/TestPaperMapper.xml b/resources/mybatis1/sunvote/TestPaperMapper.xml index 5bef5e6..ad962e0 100644 --- a/resources/mybatis1/sunvote/TestPaperMapper.xml +++ b/resources/mybatis1/sunvote/TestPaperMapper.xml @@ -129,6 +129,9 @@ and (TEACHER_ID = #{TEACHER_ID}) + + and (CREATE_DATE = #{CREATE_DATE}) + and (NAME = #{NAME}) @@ -146,5 +149,29 @@ + + + delete from + + where 1 =1 + + + and (PAPER_ID = #{PAPER_ID}) + + + and (SCLASS_ID = #{CLASS_ID}) + + + and (TEACHER_ID = #{TEACHER_ID}) + + + and (CREATE_DATE = #{CREATE_DATE}) + + + and (NAME = #{NAME}) + + + + \ No newline at end of file diff --git a/src/com/fh/controller/api/ApiServer.java b/src/com/fh/controller/api/ApiServer.java index 4bd1706..91d1db8 100644 --- a/src/com/fh/controller/api/ApiServer.java +++ b/src/com/fh/controller/api/ApiServer.java @@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.commons.CommonsMultipartFile; import Decoder.BASE64Decoder; @@ -348,7 +348,7 @@ public class ApiServer extends BaseController { @RequestMapping(value = "/feedback/add", produces = "application/json;charset=UTF-8") @ResponseBody - public Object feedbackAdd(MultipartFile file, HttpServletRequest request) + public Object feedbackAdd(CommonsMultipartFile file, HttpServletRequest request) throws Exception { PageData pd = this.getPageData(); ResponseGson res = new ResponseGson(); diff --git a/src/com/fh/controller/api/V1.java b/src/com/fh/controller/api/V1.java index 9a813a0..0080dc6 100644 --- a/src/com/fh/controller/api/V1.java +++ b/src/com/fh/controller/api/V1.java @@ -5,9 +5,11 @@ import java.util.Date; import java.util.List; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -22,6 +24,7 @@ import com.fh.entity.Page; import com.fh.service.api.V1Manager; import com.fh.service.feedback.feedback.FeedbackManager; import com.fh.service.feedback.problemphenomenon.ProblemPhenomenonManager; +import com.fh.service.software.softwareversion.SoftwareVersionManager; import com.fh.service.sunvote.basestation.BasestationManager; import com.fh.service.sunvote.chapter.ChapterManager; import com.fh.service.sunvote.classbasetation.ClassBasetationManager; @@ -141,6 +144,9 @@ public class V1 extends BaseController { @Resource(name = "v1Service") private V1Manager v1Service; + + @Resource(name="softwareversionService") + private SoftwareVersionManager softwareversionService; @RequestMapping(value = "/login", produces = "application/json;charset=UTF-8") @ResponseBody @@ -185,6 +191,7 @@ public class V1 extends BaseController { @RequestMapping(value = "/class", produces = "application/json;charset=UTF-8") @ResponseBody public Object sclass() throws Exception { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); if (pd.containsKey("ID")) { ResponseGson res = new ResponseGson(); @@ -198,39 +205,45 @@ public class V1 extends BaseController { } else { res.set2Error(); } + logger.info("class cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); } else { ResponseGson> res = new ResponseGson(); List list = sclassService.listAll(pd); res.setData(list); + logger.info("class cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); - } } @RequestMapping(value = "/questiontype", produces = "application/json;charset=UTF-8") @ResponseBody public Object questiontype() throws Exception { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson> res = new ResponseGson(); List list = questiontypeService.listAll(pd); res.setData(list); + logger.info("questiontype cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); } @RequestMapping(value = "/classtype", produces = "application/json;charset=UTF-8") @ResponseBody public Object classtype() throws Exception { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson> res = new ResponseGson(); List list = classtypeService.listAll(pd); res.setData(list); + logger.info("classtype cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); } @RequestMapping(value = "/grade", produces = "application/json;charset=UTF-8") @ResponseBody public Object grade() throws Exception { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson> res = new ResponseGson(); if (!pd.containsKey("SCHOOL_ID")) { @@ -240,12 +253,14 @@ public class V1 extends BaseController { List list = schoolgradesubjectService.listAllGrade(pd); res.setData(list); } + logger.info("class cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); } @RequestMapping(value = "/subject", produces = "application/json;charset=UTF-8") @ResponseBody public Object subject() throws Exception { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson> res = new ResponseGson(); if (!pd.containsKey("SCHOOL_ID")) { @@ -255,6 +270,7 @@ public class V1 extends BaseController { List list = schoolgradesubjectService.listAllSubject(pd); res.setData(list); } + logger.info("subject cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); } @@ -263,6 +279,7 @@ public class V1 extends BaseController { @RequestMapping(value = "/keypadscan", produces = "application/json;charset=UTF-8") @ResponseBody public Object keypadScan() throws Exception { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson res = new ResponseGson(); String ID = get32UUID(); @@ -275,12 +292,14 @@ public class V1 extends BaseController { } catch (Exception ex) { res.setDataError(); } + logger.info("keypadScan cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); } @RequestMapping(value = "/paper", produces = "application/json;charset=UTF-8") @ResponseBody public Object paper() throws Exception { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson> res = new ResponseGson>(); if (pd.containsKey("PAPER_TYPE") && pd.containsKey("USER_ID")) { @@ -308,12 +327,14 @@ public class V1 extends BaseController { } else { res.setParmError(); } + logger.info("paper cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); } @RequestMapping(value = "/paperinfo", produces = "application/json;charset=UTF-8") @ResponseBody public Object paperInfo() throws Exception { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson res = new ResponseGson(); if (pd.containsKey("PAPER_ID")) { @@ -412,21 +433,24 @@ public class V1 extends BaseController { } else { res.setOtherError(); } + logger.info("paperInfo cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); } @RequestMapping(value = "/paperquestion", produces = "application/json;charset=UTF-8") @ResponseBody public Object paperQuestion() throws Exception { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson res = new ResponseGson(); - + logger.info("paperquestion cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); } @RequestMapping(value = "/question", produces = "application/json;charset=UTF-8") @ResponseBody public Object question() throws Exception { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson res = new ResponseGson(); if(pd.containsKey("ID")){ @@ -436,22 +460,26 @@ public class V1 extends BaseController { }else{ res.setDataError(); } + logger.info("question cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); } @RequestMapping(value = "/question/add", produces = "application/json;charset=UTF-8") @ResponseBody public Object questionAdd() throws Exception { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson res = new ResponseGson(); pd.put("QUESTION_ID", this.get32UUID()); questionService.save(pd); + logger.info("questionAdd cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); } @RequestMapping(value = "/uploadpaper", produces = "application/json;charset=UTF-8") @ResponseBody public Object uploadpaper() throws Exception { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson res = new ResponseGson(); @@ -571,7 +599,7 @@ public class V1 extends BaseController { } else { res.setDataError(); } - + logger.info("uploadpaper cost time : " + (System.currentTimeMillis() - cur)); return res.toJson(); } @@ -588,18 +616,140 @@ public class V1 extends BaseController { try { PageData testPd = new PageData(); String testPaperId = this.get32UUID(); - testPd.put("TESTPAPER_ID", testPaperId); testPd.put("TEACHER_ID", testPaper.getTeacherId()); - testPd.put("NAME", testPaper.getName()); testPd.put("PAPER_ID", testPaper.getPaperId()); testPd.put("SCLASS_ID", testPaper.getClassId()); - testPd.put("START_DATE", testPaper.getStartDate()); - testPd.put("END_DATE", testPaper.getEndDate()); testPd.put( "CREATE_DATE", testPaper.getCreateDate() == null ? Tools .date2Str(new Date()) : testPaper .getCreateDate()); + List listData = testpaperService.listAll(testPd); + if (!(listData != null && listData.size() > 0)) { + testPd.put("START_DATE", testPaper.getStartDate()); + testPd.put("END_DATE", testPaper.getEndDate()); + testPd.put("NAME", testPaper.getName()); + testPd.put("TESTPAPER_ID", testPaperId); + testPd.put("OTHER_SCORE", testPaper.getOtherScore()); + testPd.put("HIGHT_SCORE", testPaper.getHighScore()); + testPd.put("LOW_SCORE", testPaper.getLowScore()); + testPd.put("AVG_SCORE", testPaper.getAvgScore()); + testPd.put("REMARK", testPaper.getRemark()); + testpaperService.save(testPd); + if (testPaper.getStudents() != null) { + List testInfoPdList = new ArrayList(); + PageData testInfoPd = null; + for (StudentAnswer studentAnswer : testPaper + .getStudents()) { + if (studentAnswer.getQuestions() != null) { + PageData studentPageData = new PageData(); + studentPageData.put("STUDENTTEST_ID", + get32UUID()); + studentPageData.put("STUDENT_ID", + studentAnswer.getStudentId()); + studentPageData.put("TEST_ID", testPaperId); + studentPageData.put("PAPER_ID", + testPaper.getPaperId()); + studentPageData.put("SCORE", + studentAnswer.getScore()); + studentPageData.put("CLASS_ID", + testPaper.getClassId()); + studenttestService.save(studentPageData); + + for (TestPaperInfo testPaperInfo : studentAnswer + .getQuestions()) { + testInfoPd = new PageData(); + testInfoPd.put("TESTPAPERINFO_ID", + this.get32UUID()); + testInfoPd.put("PAPER_ID", + testPaper.getPaperId()); + testInfoPd.put("STUDENT_ID", + studentAnswer.getStudentId()); + testInfoPd.put("TEST_ID", testPaperId); + testInfoPd.put("QUESTION_ID", + testPaperInfo.getQuestionId()); + testInfoPd.put("ANSWER", + testPaperInfo.getAnswer()); + testInfoPd.put("RIGHT", + testPaperInfo.getRight()); + testInfoPd.put("SCORE", + testPaperInfo.getScore()); + testInfoPd.put("LIKES", + testPaperInfo.getLikes()); + testInfoPd + .put("ANSWER_TYPE", + testPaperInfo + .getAnswerType() == null ? "1" + : testPaperInfo + .getAnswerType()); + testInfoPd.put("PRESS_TIME", + testPaperInfo.getPressTime()); + testInfoPd.put("RECEIVER_DATE", + testPaperInfo.getReceiverDate()); + testInfoPd.put("SUBJECTIVE", + testPaperInfo.getSubjective()); + testInfoPd.put("NOTE", + testPaperInfo.getNote()); + testInfoPd.put("MARK_NO", + testPaperInfo.getMarkNo()); + testInfoPdList.add(testInfoPd); + } + } + } + testpaperinfoService.batchSave(testInfoPdList); + } + }else{ + testPaperId = listData.get(0).getString("TESTPAPER_ID"); + } + res.setData(testPaperId); + } catch (Exception e) { + e.printStackTrace(); + res.setError(); + res.setMessage(e.getMessage()); + } + } else { + res.setDataError(); + } + logger.info("uploadtestpaper cost time:" + (System.currentTimeMillis() - cur)); + + return res.toJson(); + + } + + + // 上传测验成绩 + @RequestMapping(value = "/uploadupdatetestpaper", produces = "application/json;charset=UTF-8") + @ResponseBody + public Object uploadupdateTestpaper() { + long cur = System.currentTimeMillis(); + PageData pd = this.getPageData(); + ResponseGson res = new ResponseGson(); + if (!StringUtils.isEmpty(pd.getJsonString())) { + logger.info(pd.getJsonString()); + TestPaper testPaper = TestPaper.parse(pd.getJsonString()); + try { + PageData testPd = new PageData(); + String testPaperId = this.get32UUID(); + testPd.put("TEACHER_ID", testPaper.getTeacherId()); + testPd.put("PAPER_ID", testPaper.getPaperId()); + testPd.put("SCLASS_ID", testPaper.getClassId()); + testPd.put( + "CREATE_DATE", + testPaper.getCreateDate() == null ? Tools + .date2Str(new Date()) : testPaper + .getCreateDate()); + List listData = testpaperService.listAll(testPd); + if ((listData != null && listData.size() > 0)) { + testPaperId = listData.get(0).getString("TESTPAPER_ID"); + testpaperService.deleteList(testPd); + testPd.put("TEST_ID", testPaperId); + testpaperinfoService.delete(testPd); + studenttestService.delete(testPd); + } + testPd.put("START_DATE", testPaper.getStartDate()); + testPd.put("END_DATE", testPaper.getEndDate()); + testPd.put("NAME", testPaper.getName()); + testPd.put("TESTPAPER_ID", testPaperId); testPd.put("OTHER_SCORE", testPaper.getOtherScore()); testPd.put("HIGHT_SCORE", testPaper.getHighScore()); testPd.put("LOW_SCORE", testPaper.getLowScore()); @@ -607,10 +757,11 @@ public class V1 extends BaseController { testPd.put("REMARK", testPaper.getRemark()); testpaperService.save(testPd); if (testPaper.getStudents() != null) { + List testInfoPdList = new ArrayList(); + PageData testInfoPd = null; for (StudentAnswer studentAnswer : testPaper.getStudents()) { if (studentAnswer.getQuestions() != null) { PageData studentPageData = new PageData(); - studentPageData.put("STUDENTTEST_ID", get32UUID()); studentPageData.put("STUDENT_ID", studentAnswer.getStudentId()); studentPageData.put("TEST_ID", testPaperId); @@ -620,11 +771,12 @@ public class V1 extends BaseController { studentAnswer.getScore()); studentPageData.put("CLASS_ID", testPaper.getClassId()); + studentPageData.put("STUDENTTEST_ID", get32UUID()); studenttestService.save(studentPageData); for (TestPaperInfo testPaperInfo : studentAnswer .getQuestions()) { - PageData testInfoPd = new PageData(); + testInfoPd = new PageData(); testInfoPd.put("TESTPAPERINFO_ID", this.get32UUID()); testInfoPd.put("PAPER_ID", @@ -642,8 +794,9 @@ public class V1 extends BaseController { testPaperInfo.getScore()); testInfoPd.put("LIKES", testPaperInfo.getLikes()); - testInfoPd.put("ANSWER_TYPE", - testPaperInfo.getAnswerType()); + testInfoPd.put("ANSWER_TYPE", testPaperInfo + .getAnswerType() == null ? "1" + : testPaperInfo.getAnswerType()); testInfoPd.put("PRESS_TIME", testPaperInfo.getPressTime()); testInfoPd.put("RECEIVER_DATE", @@ -653,10 +806,11 @@ public class V1 extends BaseController { testInfoPd.put("NOTE", testPaperInfo.getNote()); testInfoPd.put("MARK_NO", testPaperInfo.getMarkNo()); - testpaperinfoService.save(testInfoPd); + testInfoPdList.add(testInfoPd); } } } + testpaperinfoService.batchSave(testInfoPdList); } res.setData(testPaperId); } catch (Exception e) { @@ -667,7 +821,8 @@ public class V1 extends BaseController { } else { res.setDataError(); } - logger.info("uploadtestpaper cost time:" + (System.currentTimeMillis() - cur)); + logger.info("uploadtestpaper cost time:" + + (System.currentTimeMillis() - cur)); return res.toJson(); @@ -677,6 +832,7 @@ public class V1 extends BaseController { @RequestMapping(value = "/downloadtestpaper", produces = "application/json;charset=UTF-8") @ResponseBody public Object downloadTestpaper() { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson res = new ResponseGson(); @@ -752,7 +908,7 @@ public class V1 extends BaseController { res.setError(); } } - + logger.info("downloadtestpaper cost time:" + (System.currentTimeMillis() - cur)); return res.toJson(); } @@ -761,6 +917,7 @@ public class V1 extends BaseController { @RequestMapping(value = "/testpaper", produces = "application/json;charset=UTF-8") @ResponseBody public Object testpaper() { + long cur = System.currentTimeMillis(); PageData pd = this.getPageData(); ResponseGson> res = new ResponseGson(); pd.put("TEACHER_ID", pd.getString("USER_ID")); @@ -792,7 +949,7 @@ public class V1 extends BaseController { res.setMessage(e.getMessage()); e.printStackTrace(); } - + logger.info("testpaper cost time:" + (System.currentTimeMillis() - cur)); return res.toJson(); } @@ -803,8 +960,36 @@ public class V1 extends BaseController { public void schoolAdmin(){ PageData pd = this.getPageData(); this.getUserID(); - - } + @RequestMapping(value = "/newversion", produces = "application/json;charset=UTF-8") + @ResponseBody + public Object getNewVersion(HttpServletRequest request) throws Exception{ + PageData pd = this.getPageData(); + String softId = pd.getString("SOFTID"); + String path = request.getContextPath(); + String basePath = request.getScheme() + "://" + + request.getServerName() + ":" + request.getServerPort() + + path + "/"; + ResponseGson res = new ResponseGson(); + if(softId != null && !"".equals(softId)){ + pd.put("SOFTWARE_ID", softId); + PageData result = softwareversionService.findNewVersion(pd); + if(result != null){ + result.remove("SOFTWAREVERSION_ID"); + result.remove("SOFTWARE_ID"); + result.put("VERSION_PATH",basePath + "/uploadFiles/uploadFile/" + result.getString("VERSION_PATH")); + res.setData(result); + }else{ + res.setDataError(); + } + }else{ + res.setDataError(); + } + return res.toJson(); + } + + + + } diff --git a/src/com/fh/controller/software/software/SoftWareController.java b/src/com/fh/controller/software/software/SoftWareController.java new file mode 100644 index 0000000..5cc138e --- /dev/null +++ b/src/com/fh/controller/software/software/SoftWareController.java @@ -0,0 +1,207 @@ +package com.fh.controller.software.software; + +import java.io.PrintWriter; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Resource; +import org.springframework.beans.propertyeditors.CustomDateEditor; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.InitBinder; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; +import com.fh.controller.base.BaseController; +import com.fh.entity.Page; +import com.fh.util.AppUtil; +import com.fh.util.ObjectExcelView; +import com.fh.util.PageData; +import com.fh.util.Jurisdiction; +import com.fh.util.Tools; +import com.fh.service.software.software.SoftWareManager; + +/** + * 说明:软件管理 + * 创建人:FH Q313596790 + * 创建时间:2018-06-14 + */ +@Controller +@RequestMapping(value="/software") +public class SoftWareController extends BaseController { + + String menuUrl = "software/list.do"; //菜单地址(权限用) + @Resource(name="softwareService") + private SoftWareManager softwareService; + + /**保存 + * @param + * @throws Exception + */ + @RequestMapping(value="/save") + public ModelAndView save() throws Exception{ + logBefore(logger, Jurisdiction.getUsername()+"新增SoftWare"); + if(!Jurisdiction.buttonJurisdiction(menuUrl, "add")){return null;} //校验权限 + ModelAndView mv = this.getModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("SOFTWARE_ID", this.get32UUID()); //主键 + softwareService.save(pd); + mv.addObject("msg","success"); + mv.setViewName("save_result"); + return mv; + } + + /**删除 + * @param out + * @throws Exception + */ + @RequestMapping(value="/delete") + public void delete(PrintWriter out) throws Exception{ + logBefore(logger, Jurisdiction.getUsername()+"删除SoftWare"); + if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return;} //校验权限 + PageData pd = new PageData(); + pd = this.getPageData(); + softwareService.delete(pd); + out.write("success"); + out.close(); + } + + /**修改 + * @param + * @throws Exception + */ + @RequestMapping(value="/edit") + public ModelAndView edit() throws Exception{ + logBefore(logger, Jurisdiction.getUsername()+"修改SoftWare"); + if(!Jurisdiction.buttonJurisdiction(menuUrl, "edit")){return null;} //校验权限 + ModelAndView mv = this.getModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + softwareService.edit(pd); + mv.addObject("msg","success"); + mv.setViewName("save_result"); + return mv; + } + + /**列表 + * @param page + * @throws Exception + */ + @RequestMapping(value="/list") + public ModelAndView list(Page page) throws Exception{ + logBefore(logger, Jurisdiction.getUsername()+"列表SoftWare"); + //if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) + ModelAndView mv = this.getModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + String keywords = pd.getString("keywords"); //关键词检索条件 + if(null != keywords && !"".equals(keywords)){ + pd.put("keywords", keywords.trim()); + } + page.setPd(pd); + List varList = softwareService.list(page); //列出SoftWare列表 + mv.setViewName("software/software/software_list"); + mv.addObject("varList", varList); + mv.addObject("pd", pd); + mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 + return mv; + } + + /**去新增页面 + * @param + * @throws Exception + */ + @RequestMapping(value="/goAdd") + public ModelAndView goAdd()throws Exception{ + ModelAndView mv = this.getModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + mv.setViewName("software/software/software_edit"); + mv.addObject("msg", "save"); + mv.addObject("pd", pd); + return mv; + } + + /**去修改页面 + * @param + * @throws Exception + */ + @RequestMapping(value="/goEdit") + public ModelAndView goEdit()throws Exception{ + ModelAndView mv = this.getModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + pd = softwareService.findById(pd); //根据ID读取 + mv.setViewName("software/software/software_edit"); + mv.addObject("msg", "edit"); + mv.addObject("pd", pd); + return mv; + } + + /**批量删除 + * @param + * @throws Exception + */ + @RequestMapping(value="/deleteAll") + @ResponseBody + public Object deleteAll() throws Exception{ + logBefore(logger, Jurisdiction.getUsername()+"批量删除SoftWare"); + if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return null;} //校验权限 + PageData pd = new PageData(); + Map map = new HashMap(); + pd = this.getPageData(); + List pdList = new ArrayList(); + String DATA_IDS = pd.getString("DATA_IDS"); + if(null != DATA_IDS && !"".equals(DATA_IDS)){ + String ArrayDATA_IDS[] = DATA_IDS.split(","); + softwareService.deleteAll(ArrayDATA_IDS); + pd.put("msg", "ok"); + }else{ + pd.put("msg", "no"); + } + pdList.add(pd); + map.put("list", pdList); + return AppUtil.returnObject(pd, map); + } + + /**导出到excel + * @param + * @throws Exception + */ + @RequestMapping(value="/excel") + public ModelAndView exportExcel() throws Exception{ + logBefore(logger, Jurisdiction.getUsername()+"导出SoftWare到excel"); + if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} + ModelAndView mv = new ModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + Map dataMap = new HashMap(); + List titles = new ArrayList(); + titles.add("软件名称"); //1 + titles.add("软件描述"); //2 + dataMap.put("titles", titles); + List varOList = softwareService.listAll(pd); + List varList = new ArrayList(); + for(int i=0;i varList = softwareversionService.list(page); //列出SoftwareVersion列表 + mv.setViewName("software/softwareversion/softwareversion_list"); + mv.addObject("varList", varList); + mv.addObject("pd", pd); + mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 + return mv; + } + + /**去新增页面 + * @param + * @throws Exception + */ + @RequestMapping(value="/goAdd") + public ModelAndView goAdd()throws Exception{ + ModelAndView mv = this.getModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + mv.setViewName("software/softwareversion/softwareversion_edit"); + List softwares = softwareService.listAll(pd); + mv.addObject("softwares", softwares); + mv.addObject("msg", "save"); + mv.addObject("pd", pd); + return mv; + } + + /**去修改页面 + * @param + * @throws Exception + */ + @RequestMapping(value="/goEdit") + public ModelAndView goEdit()throws Exception{ + ModelAndView mv = this.getModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + pd = softwareversionService.findById(pd); //根据ID读取 + mv.setViewName("software/softwareversion/softwareversion_edit"); + List softwares = softwareService.listAll(pd); + mv.addObject("softwares", softwares); + mv.addObject("msg", "edit"); + mv.addObject("pd", pd); + return mv; + } + + /**批量删除 + * @param + * @throws Exception + */ + @RequestMapping(value="/deleteAll") + @ResponseBody + public Object deleteAll() throws Exception{ + logBefore(logger, Jurisdiction.getUsername()+"批量删除SoftwareVersion"); + if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return null;} //校验权限 + PageData pd = new PageData(); + Map map = new HashMap(); + pd = this.getPageData(); + List pdList = new ArrayList(); + String DATA_IDS = pd.getString("DATA_IDS"); + if(null != DATA_IDS && !"".equals(DATA_IDS)){ + String ArrayDATA_IDS[] = DATA_IDS.split(","); + softwareversionService.deleteAll(ArrayDATA_IDS); + pd.put("msg", "ok"); + }else{ + pd.put("msg", "no"); + } + pdList.add(pd); + map.put("list", pdList); + return AppUtil.returnObject(pd, map); + } + + /**导出到excel + * @param + * @throws Exception + */ + @RequestMapping(value="/excel") + public ModelAndView exportExcel() throws Exception{ + logBefore(logger, Jurisdiction.getUsername()+"导出SoftwareVersion到excel"); + if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} + ModelAndView mv = new ModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + Map dataMap = new HashMap(); + List titles = new ArrayList(); + titles.add("软件名称"); //1 + titles.add("版本名称"); //2 + titles.add("版本代号"); //3 + titles.add("版本存放路径"); //4 + titles.add("更新描述"); //5 + dataMap.put("titles", titles); + List varOList = softwareversionService.listAll(pd); + List varList = new ArrayList(); + for(int i=0;i list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; + +} + diff --git a/src/com/fh/service/software/software/impl/SoftWareService.java b/src/com/fh/service/software/software/impl/SoftWareService.java new file mode 100644 index 0000000..638c152 --- /dev/null +++ b/src/com/fh/service/software/software/impl/SoftWareService.java @@ -0,0 +1,82 @@ +package com.fh.service.software.software.impl; + +import java.util.List; +import javax.annotation.Resource; +import org.springframework.stereotype.Service; +import com.fh.dao.DaoSupport; +import com.fh.entity.Page; +import com.fh.util.PageData; +import com.fh.service.software.software.SoftWareManager; + +/** + * 说明: 软件管理 + * 创建人:FH Q313596790 + * 创建时间:2018-06-14 + * @version + */ +@Service("softwareService") +public class SoftWareService implements SoftWareManager{ + + @Resource(name = "daoSupport") + private DaoSupport dao; + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception{ + dao.save("SoftWareMapper.save", pd); + } + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception{ + dao.delete("SoftWareMapper.delete", pd); + } + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception{ + dao.update("SoftWareMapper.edit", pd); + } + + /**列表 + * @param page + * @throws Exception + */ + @SuppressWarnings("unchecked") + public List list(Page page)throws Exception{ + return (List)dao.findForList("SoftWareMapper.datalistPage", page); + } + + /**列表(全部) + * @param pd + * @throws Exception + */ + @SuppressWarnings("unchecked") + public List listAll(PageData pd)throws Exception{ + return (List)dao.findForList("SoftWareMapper.listAll", pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception{ + return (PageData)dao.findForObject("SoftWareMapper.findById", pd); + } + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ + dao.delete("SoftWareMapper.deleteAll", ArrayDATA_IDS); + } + +} + diff --git a/src/com/fh/service/software/softwareversion/SoftwareVersionManager.java b/src/com/fh/service/software/softwareversion/SoftwareVersionManager.java new file mode 100644 index 0000000..888b7b2 --- /dev/null +++ b/src/com/fh/service/software/softwareversion/SoftwareVersionManager.java @@ -0,0 +1,61 @@ +package com.fh.service.software.softwareversion; + +import java.util.List; +import com.fh.entity.Page; +import com.fh.util.PageData; + +/** + * 说明: 软件管理接口 + * 创建人:FH Q313596790 + * 创建时间:2018-06-14 + * @version + */ +public interface SoftwareVersionManager{ + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception; + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception; + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; + + + public PageData findNewVersion(PageData pd)throws Exception; + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; + +} + diff --git a/src/com/fh/service/software/softwareversion/impl/SoftwareVersionService.java b/src/com/fh/service/software/softwareversion/impl/SoftwareVersionService.java new file mode 100644 index 0000000..4e07910 --- /dev/null +++ b/src/com/fh/service/software/softwareversion/impl/SoftwareVersionService.java @@ -0,0 +1,90 @@ +package com.fh.service.software.softwareversion.impl; + +import java.util.List; +import javax.annotation.Resource; +import org.springframework.stereotype.Service; +import com.fh.dao.DaoSupport; +import com.fh.entity.Page; +import com.fh.util.PageData; +import com.fh.service.software.softwareversion.SoftwareVersionManager; + +/** + * 说明: 软件管理 + * 创建人:FH Q313596790 + * 创建时间:2018-06-14 + * @version + */ +@Service("softwareversionService") +public class SoftwareVersionService implements SoftwareVersionManager{ + + @Resource(name = "daoSupport") + private DaoSupport dao; + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception{ + dao.save("SoftwareVersionMapper.save", pd); + } + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception{ + dao.delete("SoftwareVersionMapper.delete", pd); + } + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception{ + dao.update("SoftwareVersionMapper.edit", pd); + } + + /**列表 + * @param page + * @throws Exception + */ + @SuppressWarnings("unchecked") + public List list(Page page)throws Exception{ + return (List)dao.findForList("SoftwareVersionMapper.datalistPage", page); + } + + /**列表(全部) + * @param pd + * @throws Exception + */ + @SuppressWarnings("unchecked") + public List listAll(PageData pd)throws Exception{ + return (List)dao.findForList("SoftwareVersionMapper.listAll", pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception{ + return (PageData)dao.findForObject("SoftwareVersionMapper.findById", pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findNewVersion(PageData pd)throws Exception{ + return (PageData)dao.findForObject("SoftwareVersionMapper.findNewVersion", pd); + } + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ + dao.delete("SoftwareVersionMapper.deleteAll", ArrayDATA_IDS); + } + +} + diff --git a/src/com/fh/service/sunvote/testpaper/TestPaperManager.java b/src/com/fh/service/sunvote/testpaper/TestPaperManager.java index 453b19b..6b395c9 100644 --- a/src/com/fh/service/sunvote/testpaper/TestPaperManager.java +++ b/src/com/fh/service/sunvote/testpaper/TestPaperManager.java @@ -1,6 +1,7 @@ package com.fh.service.sunvote.testpaper; import java.util.List; + import com.fh.entity.Page; import com.fh.util.PageData; @@ -53,5 +54,12 @@ public interface TestPaperManager{ */ public void deleteAll(String[] ArrayDATA_IDS)throws Exception; + /** + * + * @param pd + * @throws Exception + */ + public void deleteList(PageData pd)throws Exception; + } diff --git a/src/com/fh/service/sunvote/testpaper/impl/TestPaperService.java b/src/com/fh/service/sunvote/testpaper/impl/TestPaperService.java index b1241dd..020249e 100644 --- a/src/com/fh/service/sunvote/testpaper/impl/TestPaperService.java +++ b/src/com/fh/service/sunvote/testpaper/impl/TestPaperService.java @@ -61,6 +61,15 @@ public class TestPaperService implements TestPaperManager{ return (List)dao.findForList("TestPaperMapper.listAll", pd); } + /**列表(全部) + * @param pd + * @throws Exception + */ + @SuppressWarnings("unchecked") + public void deleteList(PageData pd)throws Exception{ + dao.delete("TestPaperMapper.deleteList", pd); + } + /**通过id获取数据 * @param pd * @throws Exception @@ -69,6 +78,7 @@ public class TestPaperService implements TestPaperManager{ return (PageData)dao.findForObject("TestPaperMapper.findById", pd); } + /**批量删除 * @param ArrayDATA_IDS * @throws Exception diff --git a/src/com/fh/service/sunvote/testpaperinfo/TestPaperInfoManager.java b/src/com/fh/service/sunvote/testpaperinfo/TestPaperInfoManager.java index 9031aff..4373258 100644 --- a/src/com/fh/service/sunvote/testpaperinfo/TestPaperInfoManager.java +++ b/src/com/fh/service/sunvote/testpaperinfo/TestPaperInfoManager.java @@ -1,6 +1,7 @@ package com.fh.service.sunvote.testpaperinfo; import java.util.List; + import com.fh.entity.Page; import com.fh.util.PageData; @@ -17,6 +18,13 @@ public interface TestPaperInfoManager{ */ public void save(PageData pd)throws Exception; + + /**新增 + * @param pd + * @throws Exception + */ + public void batchSave(List pd)throws Exception; + /**删除 * @param pd * @throws Exception diff --git a/src/com/fh/service/sunvote/testpaperinfo/impl/TestPaperInfoService.java b/src/com/fh/service/sunvote/testpaperinfo/impl/TestPaperInfoService.java index 937715d..391968b 100644 --- a/src/com/fh/service/sunvote/testpaperinfo/impl/TestPaperInfoService.java +++ b/src/com/fh/service/sunvote/testpaperinfo/impl/TestPaperInfoService.java @@ -27,6 +27,14 @@ public class TestPaperInfoService implements TestPaperInfoManager{ dao.save("TestPaperInfoMapper.save", pd); } + /**新增 + * @param pd + * @throws Exception + */ + public void batchSave(List pd)throws Exception{ + dao.save("TestPaperInfoMapper.batchSave", pd); + } + /**删除 * @param pd * @throws Exception -- libgit2 0.21.4