diff --git a/src/main/java/cn/com/tenlion/materialstore/pojo/dtos/classplan/ClassPlanDTO.java b/src/main/java/cn/com/tenlion/materialstore/pojo/dtos/classplan/ClassPlanDTO.java index 885cb9f..b7a488d 100644 --- a/src/main/java/cn/com/tenlion/materialstore/pojo/dtos/classplan/ClassPlanDTO.java +++ b/src/main/java/cn/com/tenlion/materialstore/pojo/dtos/classplan/ClassPlanDTO.java @@ -77,6 +77,10 @@ public class ClassPlanDTO { private String examReason; @ApiModelProperty(name = "examStatus", value = "考点信息分配状态0未分配1已分配") private String examStatus; + @ApiModelProperty(name = "planImages", value = "开班申请图片") + private String planImages; + @ApiModelProperty(name = "planPDF", value = "开班申请PDF") + private String planPDF; public String getPlanNumber() { @@ -289,4 +293,20 @@ public class ClassPlanDTO { public void setExamStatus(String examStatus) { this.examStatus = examStatus; } + + public String getPlanImages() { + return planImages == null ? "" : planImages; + } + + public void setPlanImages(String planImages) { + this.planImages = planImages; + } + + public String getPlanPDF() { + return planPDF == null ? "" : planPDF; + } + + public void setPlanPDF(String planPDF) { + this.planPDF = planPDF; + } } diff --git a/src/main/java/cn/com/tenlion/materialstore/pojo/vos/classplan/ClassPlanVO.java b/src/main/java/cn/com/tenlion/materialstore/pojo/vos/classplan/ClassPlanVO.java index f118000..1721aa0 100644 --- a/src/main/java/cn/com/tenlion/materialstore/pojo/vos/classplan/ClassPlanVO.java +++ b/src/main/java/cn/com/tenlion/materialstore/pojo/vos/classplan/ClassPlanVO.java @@ -54,6 +54,10 @@ public class ClassPlanVO { private String estimateEnd; @ApiModelProperty(name = "examType", value = "考试申请类型1理论2实操3理论与实操") private String examType; + @ApiModelProperty(name = "planImages", value = "开班申请图片") + private String planImages; + @ApiModelProperty(name = "planPDF", value = "开班申请PDF") + private String planPDF; public String getPlanNumber() { return planNumber == null ? "" : planNumber.trim(); @@ -214,4 +218,20 @@ public class ClassPlanVO { public void setEstimateEnd(String estimateEnd) { this.estimateEnd = estimateEnd; } + + public String getPlanImages() { + return planImages == null ? "" : planImages; + } + + public void setPlanImages(String planImages) { + this.planImages = planImages; + } + + public String getPlanPDF() { + return planPDF == null ? "" : planPDF; + } + + public void setPlanPDF(String planPDF) { + this.planPDF = planPDF; + } } diff --git a/src/main/java/cn/com/tenlion/service/classplan/impl/ClassPlanServiceImpl.java b/src/main/java/cn/com/tenlion/service/classplan/impl/ClassPlanServiceImpl.java index be5f127..0b93eb1 100644 --- a/src/main/java/cn/com/tenlion/service/classplan/impl/ClassPlanServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/classplan/impl/ClassPlanServiceImpl.java @@ -143,6 +143,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl classPlanVO.setPlanAddress(obj.getString("planAddress")); classPlanVO.setChargePerson(obj.getString("chargePerson")); classPlanVO.setChargePersonTel(obj.getString("chargePersonTel")); + classPlanVO.setPlanImages(obj.getString("planImages")); + classPlanVO.setPlanPDF(obj.getString("planPDF")); Map params = HashMapUtil.beanToMap(classPlanVO); params.put("classPlanId", classPlanId); setSaveInfo(params); diff --git a/src/main/java/cn/com/tenlion/service/teacher/impl/TeacherServiceImpl.java b/src/main/java/cn/com/tenlion/service/teacher/impl/TeacherServiceImpl.java index 0351b7b..95a9d3b 100644 --- a/src/main/java/cn/com/tenlion/service/teacher/impl/TeacherServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/teacher/impl/TeacherServiceImpl.java @@ -178,9 +178,7 @@ public class TeacherServiceImpl extends DefaultBaseService implements ITeacherSe public List listTeacherLessonsTime(Map params) { List list = teacherDao.listTeacherLessonsTimeDTO(params); for(TeacherLessonsTimeDTO item : list){ - // 查询考试机构名称 - InstitutionDTO institutionDTO = iInstitutionService.get(item.getOrgId()); - item.setOrgName(institutionDTO.getInstitutionName()); + item.setOrgName(""); // 查询讲师名称 TeacherDTO byId = getById(item.getTeacherId()); item.setTeacherName(byId.getTeacherName()); diff --git a/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml b/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml index 2584db9..f48543f 100644 --- a/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml +++ b/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml @@ -20,6 +20,8 @@ + + @@ -74,6 +76,8 @@ charge_person_tel, report_type, report_reason, + plan_images, + plan_pdf, creator, gmt_create, modifier, @@ -95,6 +99,8 @@ #{chargePersonTel}, #{reportType}, #{reportReason}, + #{planImages}, + #{planPDF}, #{creator}, #{gmtCreate}, #{modifier}, @@ -178,6 +184,12 @@ report_reason = #{reportReason}, + + + plan_images = #{planImages}, + + + plan_pdf = #{planPDF}, class_plan_id = class_plan_id WHERE @@ -203,7 +215,9 @@ t1.charge_person_tel, t1.class_plan_id, t1.report_type, - t1.report_reason + t1.report_reason, + t1.plan_images, + t1.plan_pdf FROM e_class_plan t1 WHERE @@ -289,7 +303,9 @@ t1.charge_person, t1.charge_person_tel, t1.report_type, - t1.report_reason + t1.report_reason, + t1.plan_images, + t1.plan_pdf FROM e_class_plan t1 WHERE diff --git a/src/main/resources/static/assets/images/pdf_icon.jpg b/src/main/resources/static/assets/images/pdf_icon.jpg new file mode 100644 index 0000000..f6f22a2 Binary files /dev/null and b/src/main/resources/static/assets/images/pdf_icon.jpg differ diff --git a/src/main/resources/static/route/classplan/save.html b/src/main/resources/static/route/classplan/save.html index 376889f..db1d758 100644 --- a/src/main/resources/static/route/classplan/save.html +++ b/src/main/resources/static/route/classplan/save.html @@ -108,6 +108,70 @@ +
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
@@ -194,7 +242,8 @@ var teacherList = []; var classPlanLessons = []; var classPlanId = top.restAjax.params(window.location.href).classPlanId; - var orgId = '' + var orgId = ''; + var planImagesViewerObj = {}; // 初始化内容 function initData() { @@ -218,6 +267,8 @@ initTeacherList(data.orgId); classPlanLessons = data.classPlanLessons; orgId = data.orgId; + initPlanImagesUploadFile(); + initPlanPDFUploadFile(); }, function(code, data) { top.dialog.msg(data.msg); }, function() { @@ -264,6 +315,110 @@ }); } + // 初始化图片上传 + function initPlanImagesUploadFile() { + var files = $('#planImages').val(); + initFileList('planImages', files, function(fileName) { + var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false}); + planImagesViewerObj[fileName] = viewer; + }); + + form.on('button(planImagesUploadFile)', function(obj) { + var name = this.dataset.name; + var explain = this.dataset.explain; + top.dialog.file({ + type: 'image', + title: '上传'+ explain, + width: '400px', + height: '420px', + maxFileCount: '1', + onClose: function() { + var uploadFileArray = top.dialog.dialogData.uploadFileArray; + if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) { + var files = $('#'+ name).val(); + for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) { + if(files.length > 0) { + files += ','; + } + files += file.data; + } + initFileList(name, files, function(fileName) { + planImagesViewerObj[fileName].update(); + }); + } + } + }); + }); + + form.on('button(planImagesRemoveFile)', function(obj) { + var name = this.dataset.name; + var id = this.dataset.id; + var files = $('#'+ name).val().replace(id, ''); + files = files.replace(/\,+/g, ','); + if(files.charAt(0) == ',') { + files = files.substring(1); + } + if(files.charAt(files.length - 1) == ',') { + files = files.substring(0, files.length - 1); + } + initFileList(name, files, function(fileName) { + planImagesViewerObj[fileName].update(); + }); + }); + } + + // 初始化PDF上传 + function initPlanPDFUploadFile() { + var files = $('#planPDF').val(); + initFileList('planPDF', files, function(fileName) { + $(document).on('click', '.pdf-open-show', function(obj){ + var fileId = this.dataset.id; + window.open('route/file/download/true/' + fileId); + }) + }); + + form.on('button(planPDFUploadFile)', function(obj) { + var name = this.dataset.name; + var explain = this.dataset.explain; + top.dialog.file({ + type: 'file', + title: '上传'+ explain, + width: '400px', + height: '420px', + maxFileCount: '1', + onClose: function() { + var uploadFileArray = top.dialog.dialogData.uploadFileArray; + if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) { + var files = $('#'+ name).val(); + for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) { + if(files.length > 0) { + files += ','; + } + files += file.data; + } + initFileList(name, files, function(fileName) { + }); + } + } + }); + }); + + form.on('button(planPDFRemoveFile)', function(obj) { + var name = this.dataset.name; + var id = this.dataset.id; + var files = $('#'+ name).val().replace(id, ''); + files = files.replace(/\,+/g, ','); + if(files.charAt(0) == ',') { + files = files.substring(1); + } + if(files.charAt(files.length - 1) == ',') { + files = files.substring(0, files.length - 1); + } + initFileList(name, files, function(fileName) { + }); + }); + } + function reloadLessonsList(){ if(typeof (classPlanLessons) != 'undefined' && classPlanLessons.length > 0) $.each(classPlanLessons,function(i,e){ @@ -281,6 +436,41 @@ parent.layer.close(parent.layer.getFrameIndex(window.name)); } + function refreshDownloadTemplet(fileName, file) { + var dataRander = {}; + dataRander[fileName] = file; + + laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) { + document.getElementById(fileName +'FileBox').innerHTML = html; + }); + } + + // 初始化文件列表 + function initFileList(fileName, ids, callback) { + var dataForm = {}; + dataForm[fileName] = ids; + form.val('dataForm', dataForm); + + if(!ids) { + refreshDownloadTemplet(fileName, []); + if(callback) { + callback(fileName, []); + } + return; + } + + top.restAjax.get(top.restAjax.path('api/file/list', []), { + ids: ids + }, null, function(code, data) { + refreshDownloadTemplet(fileName, data); + if(callback) { + callback(fileName, data); + } + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + $('.close').on('click', function() { closeBox(); }); diff --git a/src/main/resources/static/route/classplan/update.html b/src/main/resources/static/route/classplan/update.html index 451673b..8f69a97 100644 --- a/src/main/resources/static/route/classplan/update.html +++ b/src/main/resources/static/route/classplan/update.html @@ -107,6 +107,70 @@ +
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
@@ -203,6 +267,7 @@ var classPlanLessons = []; var classPlanId = top.restAjax.params(window.location.href).classPlanId; var orgId = ''; + var planImagesViewerObj = {}; // 初始化内容 function initData() { @@ -231,6 +296,8 @@ initTeacherList(data.orgId); classPlanLessons = data.classPlanLessons; orgId = data.orgId + initPlanImagesUploadFile(); + initPlanPDFUploadFile(); }, function(code, data) { top.dialog.msg(data.msg); }, function() { @@ -310,6 +377,145 @@ }); } + // 初始化图片上传 + function initPlanImagesUploadFile() { + var files = $('#planImages').val(); + initFileList('planImages', files, function(fileName) { + var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false}); + planImagesViewerObj[fileName] = viewer; + }); + + form.on('button(planImagesUploadFile)', function(obj) { + var name = this.dataset.name; + var explain = this.dataset.explain; + top.dialog.file({ + type: 'image', + title: '上传'+ explain, + width: '400px', + height: '420px', + maxFileCount: '1', + onClose: function() { + var uploadFileArray = top.dialog.dialogData.uploadFileArray; + if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) { + var files = $('#'+ name).val(); + for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) { + if(files.length > 0) { + files += ','; + } + files += file.data; + } + initFileList(name, files, function(fileName) { + planImagesViewerObj[fileName].update(); + }); + } + } + }); + }); + + form.on('button(planImagesRemoveFile)', function(obj) { + var name = this.dataset.name; + var id = this.dataset.id; + var files = $('#'+ name).val().replace(id, ''); + files = files.replace(/\,+/g, ','); + if(files.charAt(0) == ',') { + files = files.substring(1); + } + if(files.charAt(files.length - 1) == ',') { + files = files.substring(0, files.length - 1); + } + initFileList(name, files, function(fileName) { + planImagesViewerObj[fileName].update(); + }); + }); + } + + // 初始化PDF上传 + function initPlanPDFUploadFile() { + var files = $('#planPDF').val(); + initFileList('planPDF', files, function(fileName) { + $(document).on('click', '.pdf-open-show', function(obj){ + var fileId = this.dataset.id; + window.open('route/file/download/true/' + fileId); + }) + }); + + form.on('button(planPDFUploadFile)', function(obj) { + var name = this.dataset.name; + var explain = this.dataset.explain; + top.dialog.file({ + type: 'file', + title: '上传'+ explain, + width: '400px', + height: '420px', + maxFileCount: '1', + onClose: function() { + var uploadFileArray = top.dialog.dialogData.uploadFileArray; + if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) { + var files = $('#'+ name).val(); + for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) { + if(files.length > 0) { + files += ','; + } + files += file.data; + } + initFileList(name, files, function(fileName) { + }); + } + } + }); + }); + + form.on('button(planPDFRemoveFile)', function(obj) { + var name = this.dataset.name; + var id = this.dataset.id; + var files = $('#'+ name).val().replace(id, ''); + files = files.replace(/\,+/g, ','); + if(files.charAt(0) == ',') { + files = files.substring(1); + } + if(files.charAt(files.length - 1) == ',') { + files = files.substring(0, files.length - 1); + } + initFileList(name, files, function(fileName) { + }); + }); + } + + function refreshDownloadTemplet(fileName, file) { + var dataRander = {}; + dataRander[fileName] = file; + + laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) { + document.getElementById(fileName +'FileBox').innerHTML = html; + }); + } + + // 初始化文件列表 + function initFileList(fileName, ids, callback) { + var dataForm = {}; + dataForm[fileName] = ids; + form.val('dataForm', dataForm); + + if(!ids) { + refreshDownloadTemplet(fileName, []); + if(callback) { + callback(fileName, []); + } + return; + } + + top.restAjax.get(top.restAjax.path('api/file/list', []), { + ids: ids + }, null, function(code, data) { + refreshDownloadTemplet(fileName, data); + if(callback) { + callback(fileName, data); + } + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + form.on('checkbox(lessonCheckBox)',function(data){ var lessonId = $(data.elem).attr('data-lesson-id'); var teacherId = $('#select-' + lessonId).val(); @@ -480,18 +686,8 @@ top.dialog.close(index); var loadLayerIndex; top.restAjax.put(top.restAjax.path('api/classplan/update/{classPlanId}', [classPlanId]), formData.field, null, function(code, data) { - var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { - time: 0, - btn: [top.dataMessage.button.yes, top.dataMessage.button.no], - shade: 0.3, - yes: function(index) { - top.dialog.close(index); - closeBox(); - }, - btn2: function() { - closeBox(); - } - }); + top.dialog.close(index); + closeBox(); }, function(code, data) { top.dialog.msg(data.msg); }, function() { diff --git a/src/main/resources/static/route/teacher/save.html b/src/main/resources/static/route/teacher/save.html index ee06327..8b8770a 100644 --- a/src/main/resources/static/route/teacher/save.html +++ b/src/main/resources/static/route/teacher/save.html @@ -211,7 +211,7 @@ layer.open({ type: 2, title: '选择授课工种', - closeBtn: 0, + closeBtn: 1, area: ['400px', '500px'], shadeClose: false, anim: 2, diff --git a/src/main/resources/static/route/teacher/update.html b/src/main/resources/static/route/teacher/update.html index c5590c7..d9d9f0e 100644 --- a/src/main/resources/static/route/teacher/update.html +++ b/src/main/resources/static/route/teacher/update.html @@ -243,7 +243,7 @@ layer.open({ type: 2, title: '选择授课工种', - closeBtn: 0, + closeBtn: 1, area: ['400px', '500px'], shadeClose: false, anim: 2,