From 2ba1dffa2f50faae7657cf171734ee8e501abe02 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Wed, 23 Jun 2021 09:50:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appraise/OrgAppraiseAppController.java | 34 ++---- .../BasicUserInfoAppController.java | 20 +++- .../tenlion/dao/appraise/IAppraiseDao.java | 12 ++ .../com/tenlion/pojo/dtos/apply/ApplyDTO.java | 20 ++++ .../dtos/appraise/TeacherAppraiseDTO.java | 38 ++++++- .../service/apply/impl/ApplyServiceImpl.java | 3 + .../service/appraise/IAppraiseService.java | 19 ++++ .../appraise/impl/AppraiseServiceImpl.java | 61 ++++++++++ .../service/classplan/IClassPlanService.java | 8 ++ .../classplan/impl/ClassPlanServiceImpl.java | 41 +++++++ .../myexamforapp/IMyExamForAppService.java | 4 +- .../impl/MyExamForAppServiceImpl.java | 105 +++++++----------- .../applystudents/apply-students-mapper.xml | 3 + .../mapper/appraise/appraise-mapper.xml | 32 +++++- .../route/classplan/list-report-exam.html | 3 +- 15 files changed, 302 insertions(+), 101 deletions(-) diff --git a/src/main/java/cn/com/tenlion/controller/app/api/appraise/OrgAppraiseAppController.java b/src/main/java/cn/com/tenlion/controller/app/api/appraise/OrgAppraiseAppController.java index 0eab5a2..9213174 100644 --- a/src/main/java/cn/com/tenlion/controller/app/api/appraise/OrgAppraiseAppController.java +++ b/src/main/java/cn/com/tenlion/controller/app/api/appraise/OrgAppraiseAppController.java @@ -4,13 +4,12 @@ import cn.com.tenlion.dao.classplan.IClassPlanDao; import cn.com.tenlion.pojo.dtos.appraise.OrgAppraiseDTO; import cn.com.tenlion.pojo.dtos.appraise.TeacherAppraiseDTO; import cn.com.tenlion.service.appraise.IAppraiseService; +import com.alibaba.fastjson.JSONObject; import ink.wgink.common.base.DefaultBaseController; import ink.wgink.exceptions.SaveException; -import ink.wgink.exceptions.SearchException; import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.pojo.result.ErrorResult; import ink.wgink.pojo.result.SuccessResult; -import ink.wgink.util.map.HashMapUtil; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -65,9 +64,8 @@ public class OrgAppraiseAppController extends DefaultBaseController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PostMapping("save-teacher-appraise") public SuccessResult saveTeacherAppraise(@RequestHeader("token") String token, - @RequestBody TeacherAppraiseDTO teacherAppraiseDTO) throws SaveException { - Map params = HashMapUtil.beanToMap(teacherAppraiseDTO); - //appraiseDao.saveTeacherAppraise(params); + @RequestBody JSONObject appraiseObj) throws SaveException { + appraiseService.saveTeacherAppraise(token, appraiseObj); return new SuccessResult(); } @@ -76,29 +74,11 @@ public class OrgAppraiseAppController extends DefaultBaseController { @ApiImplicitParam(name = "token", value = "token", paramType = "header"), }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @GetMapping("get-teacher-appraise") - public TeacherAppraiseDTO getTeacherAppraise(@RequestHeader("token") String token) { + @GetMapping("list-teacher-appraise") + public List getTeacherAppraise(@RequestHeader("token") String token) { Map params = requestParams(); - /*TeacherAppraiseDTO dto = appraiseDao.getTeacherAppraise(params); - return dto == null ? new TeacherAppraiseDTO() : dto;*/ - return new TeacherAppraiseDTO(); - } - - @ApiOperation(value = "查询培训计划的授课讲师", notes = "查询个人资料信息接口") - @ApiImplicitParams({ - @ApiImplicitParam(name = "token", value = "token", paramType = "header"), - }) - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @GetMapping("list-plan-teacher") - public List> listPlanTeacher(@RequestHeader("token") String token){ - Map params = requestParams(); - if(params.get("classPlanId") == null - || params.get("classPlanId").toString().length() == 0){ - throw new SearchException("classPlanId参数缺失,查询失败"); - } - String classPlanId = params.get("classPlanId").toString(); - List> list = classPlanDao.listClassPlanLessons(classPlanId); - return list; + List dto = appraiseService.getTeacherAppraise(token,params); + return dto; } } diff --git a/src/main/java/cn/com/tenlion/controller/app/api/basicuserinfo/BasicUserInfoAppController.java b/src/main/java/cn/com/tenlion/controller/app/api/basicuserinfo/BasicUserInfoAppController.java index e3b230b..5568727 100644 --- a/src/main/java/cn/com/tenlion/controller/app/api/basicuserinfo/BasicUserInfoAppController.java +++ b/src/main/java/cn/com/tenlion/controller/app/api/basicuserinfo/BasicUserInfoAppController.java @@ -1,8 +1,8 @@ package cn.com.tenlion.controller.app.api.basicuserinfo; import cn.com.tenlion.pojo.dtos.basicuserinfo.BasicUserInfoDTO; -import cn.com.tenlion.pojo.dtos.myexam.MyExamDTO; import cn.com.tenlion.service.basicuserinfo.IBasicUserInfoService; +import cn.com.tenlion.service.classplan.IClassPlanService; import cn.com.tenlion.service.myexamforapp.IMyExamForAppService; import ink.wgink.common.base.DefaultBaseController; import ink.wgink.exceptions.SaveException; @@ -33,6 +33,8 @@ public class BasicUserInfoAppController extends DefaultBaseController { private IMyExamForAppService myExamForAppService; @Autowired private IBasicUserInfoService basicUserInfoService; + @Autowired + private IClassPlanService classPlanService; @ApiOperation(value = "查询个人资料信息", notes = "查询个人资料信息接口") @ApiImplicitParams({ @@ -62,9 +64,21 @@ public class BasicUserInfoAppController extends DefaultBaseController { }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("list-my-exam") - public List listMyExam(@RequestHeader("token") String token) throws SaveException { + public List> listMyExam(@RequestHeader("token") String token) throws SaveException { Map params = requestParams(); - List list = myExamForAppService.listMyExam(token,params); + List> list = myExamForAppService.listMyExam(token,params); + return list; + } + + @ApiOperation(value = "查询我的培训", notes = "查询我的培训") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-my-class-plan") + public List> listMyClassPlan(@RequestHeader("token") String token) throws SaveException { + Map params = requestParams(); + List> list = classPlanService.listMyClassPlan(token,params); return list; } diff --git a/src/main/java/cn/com/tenlion/dao/appraise/IAppraiseDao.java b/src/main/java/cn/com/tenlion/dao/appraise/IAppraiseDao.java index 53e5bb5..6899ac4 100644 --- a/src/main/java/cn/com/tenlion/dao/appraise/IAppraiseDao.java +++ b/src/main/java/cn/com/tenlion/dao/appraise/IAppraiseDao.java @@ -40,4 +40,16 @@ public interface IAppraiseDao { * @return */ TeacherAppraiseDTO getTeacherAppraise(Map params); + + /** + * 删除用户机构评价 + * @param params + */ + void deleteOrgAppraise(Map params); + + /** + * 删除讲师评价 + * @param params + */ + void deleteTeacherAppraise(Map params); } diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java index 881d593..0d06a07 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java @@ -95,6 +95,10 @@ public class ApplyDTO { private Integer applyUserNum2; @ApiModelProperty(name = "applyUserNum3", value = "已通过审核人数") private Integer applyUserNum3; + @ApiModelProperty(name = "orgCharge", value = "机构负责人") + private String orgCharge; + @ApiModelProperty(name = "orgTel", value = "机构联系方式") + private String orgTel; @@ -388,4 +392,20 @@ public class ApplyDTO { public void setApplyUserNum3(Integer applyUserNum3) { this.applyUserNum3 = applyUserNum3; } + + public String getOrgCharge() { + return orgCharge == null ? "" : orgCharge; + } + + public void setOrgCharge(String orgCharge) { + this.orgCharge = orgCharge; + } + + public String getOrgTel() { + return orgTel == null ? "" : orgTel; + } + + public void setOrgTel(String orgTel) { + this.orgTel = orgTel; + } } diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/appraise/TeacherAppraiseDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/appraise/TeacherAppraiseDTO.java index 51d9629..1bc2f51 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/appraise/TeacherAppraiseDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/appraise/TeacherAppraiseDTO.java @@ -12,12 +12,18 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel public class TeacherAppraiseDTO { - @ApiModelProperty(name = "teacherId", value = "机构ID") + @ApiModelProperty(name = "teacherId", value = "讲师ID") private String teacherId; + @ApiModelProperty(name = "teacherName", value = "讲师姓名") + private String teacherName; @ApiModelProperty(name = "appraiseLevel", value = "评价等级1-5默认0") private String appraiseLevel; @ApiModelProperty(name = "classPlanId", value = "培训计划ID") private String classPlanId; + @ApiModelProperty(name = "lessonId", value = "课程ID") + private String lessonId; + @ApiModelProperty(name = "lessonName", value = "课程名称") + private String lessonName; @ApiModelProperty(name = "fullName", value = "评价人") private String fullName; @ApiModelProperty(name = "bindUserAccount", value = "统一用户Id") @@ -33,6 +39,14 @@ public class TeacherAppraiseDTO { this.teacherId = teacherId; } + public String getTeacherName() { + return teacherName == null ? "" : teacherName; + } + + public void setTeacherName(String teacherName) { + this.teacherName = teacherName; + } + public String getAppraiseLevel() { return appraiseLevel == null ? "" : appraiseLevel; } @@ -49,6 +63,22 @@ public class TeacherAppraiseDTO { this.classPlanId = classPlanId; } + public String getLessonId() { + return lessonId == null ? "" : lessonId; + } + + public void setLessonId(String lessonId) { + this.lessonId = lessonId; + } + + public String getLessonName() { + return lessonName == null ? "" : lessonName; + } + + public void setLessonName(String lessonName) { + this.lessonName = lessonName; + } + public String getFullName() { return fullName == null ? "" : fullName; } @@ -78,10 +108,16 @@ public class TeacherAppraiseDTO { final StringBuilder sb = new StringBuilder("{"); sb.append("\"teacherId\":\"") .append(teacherId).append('\"'); + sb.append(",\"teacherName\":\"") + .append(teacherName).append('\"'); sb.append(",\"appraiseLevel\":\"") .append(appraiseLevel).append('\"'); sb.append(",\"classPlanId\":\"") .append(classPlanId).append('\"'); + sb.append(",\"lessonId\":\"") + .append(lessonId).append('\"'); + sb.append(",\"lessonName\":\"") + .append(lessonName).append('\"'); sb.append(",\"fullName\":\"") .append(fullName).append('\"'); sb.append(",\"bindUserAccount\":\"") diff --git a/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java b/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java index ba95791..6c918ed 100644 --- a/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java @@ -191,6 +191,9 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic PageHelper.startPage(page.getPage(), page.getRows()); List applyDTOs = list(page.getParams()); for (ApplyDTO applyDTO : applyDTOs) { + InstitutionDTO orgInfo = iInstitutionService.get(applyDTO.getApplyInstitutionId()); + applyDTO.setOrgCharge(orgInfo.getInstitutionPrincipal()); + applyDTO.setOrgTel(orgInfo.getInstitutionContact()); //统计机构报名数量 List states = new ArrayList<>(); states.add("0"); diff --git a/src/main/java/cn/com/tenlion/service/appraise/IAppraiseService.java b/src/main/java/cn/com/tenlion/service/appraise/IAppraiseService.java index ebb7cd2..f4b2234 100644 --- a/src/main/java/cn/com/tenlion/service/appraise/IAppraiseService.java +++ b/src/main/java/cn/com/tenlion/service/appraise/IAppraiseService.java @@ -1,7 +1,10 @@ package cn.com.tenlion.service.appraise; import cn.com.tenlion.pojo.dtos.appraise.OrgAppraiseDTO; +import cn.com.tenlion.pojo.dtos.appraise.TeacherAppraiseDTO; +import com.alibaba.fastjson.JSONObject; +import java.util.List; import java.util.Map; /** @@ -25,4 +28,20 @@ public interface IAppraiseService { * @return */ OrgAppraiseDTO getOrgAppraise(String token, Map params); + + /** + * 保存讲师评价 + * @param token + * @param appraiseObj + */ + void saveTeacherAppraise(String token, JSONObject appraiseObj); + + /** + * 用户查询培训下授课讲师列表 + * @param token + * @param params + * @return + */ + List getTeacherAppraise(String token, Map params); + } diff --git a/src/main/java/cn/com/tenlion/service/appraise/impl/AppraiseServiceImpl.java b/src/main/java/cn/com/tenlion/service/appraise/impl/AppraiseServiceImpl.java index 3cb4592..7ce939a 100644 --- a/src/main/java/cn/com/tenlion/service/appraise/impl/AppraiseServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/appraise/impl/AppraiseServiceImpl.java @@ -1,8 +1,12 @@ package cn.com.tenlion.service.appraise.impl; import cn.com.tenlion.dao.appraise.IAppraiseDao; +import cn.com.tenlion.dao.classplan.IClassPlanDao; import cn.com.tenlion.pojo.dtos.appraise.OrgAppraiseDTO; +import cn.com.tenlion.pojo.dtos.appraise.TeacherAppraiseDTO; import cn.com.tenlion.service.appraise.IAppraiseService; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.pojo.app.AppTokenUser; import ink.wgink.util.date.DateUtil; @@ -10,6 +14,8 @@ import ink.wgink.util.map.HashMapUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; import java.util.Map; /** @@ -22,6 +28,8 @@ public class AppraiseServiceImpl extends DefaultBaseService implements IAppraise @Autowired private IAppraiseDao appraiseDao; + @Autowired + private IClassPlanDao classPlanDao; @Override public void saveOrgAppraise(String token, OrgAppraiseDTO orgAppraiseDTO) { @@ -30,6 +38,7 @@ public class AppraiseServiceImpl extends DefaultBaseService implements IAppraise orgAppraiseDTO.setBindUserAccount(appTokenUser.getId()); orgAppraiseDTO.setFullName(appTokenUser.getName()); Map params = HashMapUtil.beanToMap(orgAppraiseDTO); + appraiseDao.deleteOrgAppraise(params); appraiseDao.saveOrgAppraise(params); } @@ -40,4 +49,56 @@ public class AppraiseServiceImpl extends DefaultBaseService implements IAppraise OrgAppraiseDTO dto = appraiseDao.getOrgAppraise(params); return dto == null ? new OrgAppraiseDTO() : dto; } + + @Override + public List getTeacherAppraise(String token, Map params) { + AppTokenUser appTokenUser = getAppTokenUser(token); + String classPlanId = params.get("classPlanId").toString(); + // 查询培训计划下讲师列表 + List> teacherLessonList = classPlanDao.listClassPlanLessons(classPlanId); + if(teacherLessonList == null || teacherLessonList.size() == 0){ + return new ArrayList<>(); + } + List dto = new ArrayList<>(); + for (Map item : teacherLessonList){ + // 查询当前讲师是否评价过 + params.put("teacherId", item.get("teacherId").toString()); + params.put("classPlanId", classPlanId); + params.put("bindUserAccount",appTokenUser.getId()); + TeacherAppraiseDTO appraise = appraiseDao.getTeacherAppraise(params); + if(appraise == null){ + appraise = new TeacherAppraiseDTO(); + appraise.setTeacherId(item.get("teacherId").toString()); + appraise.setTeacherName(item.get("teacherName").toString()); + appraise.setLessonId(item.get("lessonId").toString()); + appraise.setLessonName(item.get("lessonName").toString()); + appraise.setAppraiseLevel("0"); + appraise.setClassPlanId(classPlanId); + } + dto.add(appraise); + } + return dto; + } + + @Override + public void saveTeacherAppraise(String token, JSONObject appraiseObj) { + AppTokenUser appTokenUser = getAppTokenUser(token); + JSONArray array = appraiseObj.getJSONArray("teacherAppraiseList"); + TeacherAppraiseDTO dto = new TeacherAppraiseDTO(); + for (int i = 0; i < array.size(); i++){ + JSONObject item = array.getJSONObject(i); + dto.setTeacherId(item.getString("teacherId")); + dto.setTeacherName(item.getString("teacherName")); + dto.setClassPlanId(item.getString("classPlanId")); + dto.setAppraiseLevel(item.getString("appraiseLevel")); + dto.setLessonId(item.getString("lessonId")); + dto.setLessonName(item.getString("lessonName")); + dto.setBindUserAccount(appTokenUser.getId()); + dto.setFullName(appTokenUser.getName()); + dto.setAppraiseGMT(DateUtil.getTime()); + Map params = HashMapUtil.beanToMap(dto); + appraiseDao.deleteTeacherAppraise(params); + appraiseDao.saveTeacherAppraise(params); + } + } } diff --git a/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java b/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java index bd013a6..5283ccb 100644 --- a/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java +++ b/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java @@ -278,4 +278,12 @@ public interface IClassPlanService { * @param classPlanVO */ void updateExamRecommit(String classPlanId, ClassPlanVO classPlanVO); + + /** + * 查询我的培训 + * @param token + * @param params + * @return + */ + List> listMyClassPlan(String token, Map params); } \ No newline at end of file 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 d36f6f3..9639235 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 @@ -39,6 +39,7 @@ import ink.wgink.exceptions.SaveException; import ink.wgink.module.dictionary.pojo.dtos.DataDTO; import ink.wgink.module.dictionary.service.IDataService; import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.app.AppTokenUser; import ink.wgink.pojo.result.SuccessResultList; import ink.wgink.util.UUIDUtil; import ink.wgink.util.date.DateUtil; @@ -718,4 +719,44 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl } return res; } + + @Override + public List> listMyClassPlan(String token, Map params) { + AppTokenUser appTokenUser = getAppTokenUser(token); + params.put("creator", appTokenUser.getId()); + List list = studentsService.list(params); + List> classPlanList = new ArrayList<>(); + if (list == null || list.size() == 0){ + return classPlanList; + } + for (ApplyStudentsDTO item : list){ + Map itemMap = new HashMap<>(); + params.clear(); + String classPlanId = item.getApplyClassId(); + params.put("classPlanId",classPlanId); + ClassPlanDTO classPlanDTO = classPlanDao.get(params); + itemMap.put("classPlanId",classPlanId); + String planType = "1".equals(classPlanDTO.getPlanType()) ? "初训" : "复训"; + itemMap.put("classPlanName","[" + planType + "]" + + "[" + classPlanDTO.getPlanNumber() + "]" + + classPlanDTO.getPlanName()); + itemMap.put("planStartTime",classPlanDTO.getPlanStartTime().substring(0,10)); + itemMap.put("planEndTime",classPlanDTO.getPlanEndTime().substring(0,10)); + String workTypeId = classPlanDTO.getWorkerCatalog(); + WorkTypeDTO workTypeDTO = workTypeService.get(workTypeId); + itemMap.put("workTypeId", workTypeId); + itemMap.put("workTypeName", workTypeDTO.getWorkTypeName()); + itemMap.put("chargePerson",classPlanDTO.getChargePerson()); + itemMap.put("chargePersonTel",classPlanDTO.getChargePersonTel()); + itemMap.put("planAddress",classPlanDTO.getPlanAddress()); + String orgId = classPlanDTO.getOrgId(); + InstitutionDTO orgInfo = iInstitutionService.get(orgId); + itemMap.put("orgId",orgInfo.getInstitutionId()); + itemMap.put("orgName",orgInfo.getInstitutionName()); + List userCounts = studentsService.listByClssId(classPlanId); + itemMap.put("userCounts", userCounts.size()); + classPlanList.add(itemMap); + } + return classPlanList; + } } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/myexamforapp/IMyExamForAppService.java b/src/main/java/cn/com/tenlion/service/myexamforapp/IMyExamForAppService.java index b05896b..bc440e0 100644 --- a/src/main/java/cn/com/tenlion/service/myexamforapp/IMyExamForAppService.java +++ b/src/main/java/cn/com/tenlion/service/myexamforapp/IMyExamForAppService.java @@ -1,7 +1,5 @@ package cn.com.tenlion.service.myexamforapp; -import cn.com.tenlion.pojo.dtos.myexam.MyExamDTO; - import java.util.List; import java.util.Map; @@ -18,5 +16,5 @@ public interface IMyExamForAppService { * @param token * @return */ - List listMyExam(String token, Map params); + List> listMyExam(String token, Map params); } diff --git a/src/main/java/cn/com/tenlion/service/myexamforapp/impl/MyExamForAppServiceImpl.java b/src/main/java/cn/com/tenlion/service/myexamforapp/impl/MyExamForAppServiceImpl.java index 3b83963..aa05c71 100644 --- a/src/main/java/cn/com/tenlion/service/myexamforapp/impl/MyExamForAppServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/myexamforapp/impl/MyExamForAppServiceImpl.java @@ -2,24 +2,23 @@ package cn.com.tenlion.service.myexamforapp.impl; import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO; import cn.com.tenlion.institutionmanagement.service.institution.IInstitutionService; +import cn.com.tenlion.pojo.dtos.applystudents.ApplyStudentsDTO; import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO; -import cn.com.tenlion.pojo.dtos.distributioncard.DistributionCardDTO; +import cn.com.tenlion.pojo.dtos.distribution.DistributionDTO; import cn.com.tenlion.pojo.dtos.examapply.ExamApplyDTO; -import cn.com.tenlion.pojo.dtos.myexam.MyExamDTO; -import cn.com.tenlion.pojo.dtos.worktype.WorkTypeDTO; +import cn.com.tenlion.service.applystudents.IApplyStudentsService; import cn.com.tenlion.service.classplan.IClassPlanService; import cn.com.tenlion.service.examapply.IExamApplyService; -import cn.com.tenlion.service.examination.distributioncard.IDistributionCardService; +import cn.com.tenlion.service.examination.distribution.IDistributionService; import cn.com.tenlion.service.myexamforapp.IMyExamForAppService; import cn.com.tenlion.service.worktype.IWorkTypeService; import ink.wgink.common.base.DefaultBaseService; -import ink.wgink.module.dictionary.pojo.dtos.DataDTO; -import ink.wgink.module.dictionary.service.IDataService; import ink.wgink.pojo.app.AppTokenUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -31,76 +30,56 @@ import java.util.Map; @Service public class MyExamForAppServiceImpl extends DefaultBaseService implements IMyExamForAppService { - - /** - * 准考证 - */ - @Autowired - private IDistributionCardService distributionCardService; - /** - * 培训计划 - */ @Autowired private IClassPlanService classPlanService; - /** - * 培训机构 - */ @Autowired private IInstitutionService iInstitutionService; - /** - * 数据字典 - */ - @Autowired - private IDataService dataService; - /** - * 工种 - */ @Autowired private IWorkTypeService workTypeService; - /** - * 考试申请 - */ @Autowired private IExamApplyService examApplyService; + @Autowired + private IApplyStudentsService studentsService; + @Autowired + private IDistributionService distributionService; @Override - public List listMyExam(String token, Map params) { + public List> listMyExam(String token, Map params) { AppTokenUser appTokenUser = getAppTokenUser(token); - String userId = appTokenUser.getId(); - params.put("distributionCardUserId",userId); - List cardDTOS = distributionCardService.list(params); - if(cardDTOS == null || cardDTOS.size() == 0){ - return new ArrayList<>(0); + String bindUserAccount = appTokenUser.getId(); + params.put("creator",bindUserAccount); + // 从已报名人员表中查出所有培训记录 + List list = studentsService.list(params); + if(list == null || list.size() == 0){ + return new ArrayList<>(); } - List list = new ArrayList<>(); - for(DistributionCardDTO item : cardDTOS){ - MyExamDTO myExamDTO = new MyExamDTO(); - // 查询计划信息 - ClassPlanDTO classPlanDTO = classPlanService.get(item.getClassPlanId()); - // 查询培训机构 - InstitutionDTO institutionDTO = iInstitutionService.get(classPlanDTO.getOrgId()); - // 查询培训项目 - DataDTO dataDTO = dataService.get(classPlanDTO.getProjectCatalogId()); - // 查询工种类别 - WorkTypeDTO workTypeDTO = workTypeService.get(classPlanDTO.getWorkerCatalog()); - myExamDTO.setOrgName(institutionDTO.getInstitutionName()); - myExamDTO.setPlanName(classPlanDTO.getPlanName()); - myExamDTO.setPlanNumber(classPlanDTO.getPlanNumber()); - switch (classPlanDTO.getPlanType()){ - case "1" : myExamDTO.setPlanTypeName("初训"); break; - case "2" : myExamDTO.setPlanTypeName("复训"); break; - case "3" : myExamDTO.setPlanTypeName("换证"); break; - default : myExamDTO.setPlanTypeName("-"); + List> examList = new ArrayList<>(); + for (ApplyStudentsDTO item : list){ + String classPlanId = item.getApplyClassId(); + // 查询考试信息 + params.clear(); + params.put("classPlanId",classPlanId); + ExamApplyDTO examApplyDTO = examApplyService.get(params); + int examPassType = examApplyDTO.getCheckStatus(); + int examPlaceType = examApplyDTO.getStatus(); + if( examPassType == 1 && examPlaceType == 1){ + //封装考试信息 + Map examObj = new HashMap<>(); + examObj.put("workTypeId",item.getApplyWorkTypeId()); + examObj.put("workTypeName",item.getApplyWorkTypeName()); + ClassPlanDTO classPlanDTO = classPlanService.get(classPlanId); + examObj.put("chargePerson",classPlanDTO.getChargePersonTel()); + examObj.put("chargePersonTel",classPlanDTO.getChargePerson()); + // 查询考点信息 + DistributionDTO distributionDTO = distributionService.get(classPlanId); + InstitutionDTO examPlace = iInstitutionService.get(distributionDTO.getStationId()); + examObj.put("examPlaceName",examPlace.getInstitutionName()); + examObj.put("examPlaceAddr",examPlace.getInstitutionAddress()); + examObj.put("startTime",distributionDTO.getDistributionAllotTime()); + examObj.put("endTime",distributionDTO.getDistributionAllotEndTime()); + examList.add(examObj); } - myExamDTO.setProjectCatalogName(dataDTO.getDataName()); - myExamDTO.setWorkerCatalogName(workTypeDTO.getWorkTypeName()); - Map queryMap = getHashMap(8); - queryMap.put("examId",item.getClassPlanId()); - ExamApplyDTO examApplyDTO = examApplyService.get(queryMap); - myExamDTO.setExamTimeStart(examApplyDTO.getPracticeExamStartTime()); - myExamDTO.setExamTimeEnd(examApplyDTO.getPracticeExamEndTime()); - list.add(myExamDTO); } - return list; + return examList; } } diff --git a/src/main/resources/mybatis/mapper/applystudents/apply-students-mapper.xml b/src/main/resources/mybatis/mapper/applystudents/apply-students-mapper.xml index d2f9d16..1462105 100644 --- a/src/main/resources/mybatis/mapper/applystudents/apply-students-mapper.xml +++ b/src/main/resources/mybatis/mapper/applystudents/apply-students-mapper.xml @@ -433,6 +433,9 @@ AND t1.apply_class_id = #{applyClassId} + + AND t1.creator = #{creator} + AND LEFT(t1.gmt_create, 10) = ]]> #{startTime} diff --git a/src/main/resources/mybatis/mapper/appraise/appraise-mapper.xml b/src/main/resources/mybatis/mapper/appraise/appraise-mapper.xml index 64116fe..a421c32 100644 --- a/src/main/resources/mybatis/mapper/appraise/appraise-mapper.xml +++ b/src/main/resources/mybatis/mapper/appraise/appraise-mapper.xml @@ -13,8 +13,11 @@ + + + @@ -27,6 +30,16 @@ (#{orgId}, #{appraiseLevel}, #{classPlanId}, #{fullName}, #{bindUserAccount}, #{appraiseGMT}, '0') + + UPDATE e_org_appraise SET + is_delete = '1' + WHERE + bind_user_account = #{bindUserAccount} + AND class_plan_id = #{classPlanId} + AND org_id = #{orgId} + + + + INSERT INTO e_teacher_appraise - (teacher_id, appraise_level, class_plan_id, full_name, bind_user_account, appraise_gmt, is_delete) + (teacher_id, teacher_name, appraise_level, class_plan_id, lesson_id, lesson_name, full_name, bind_user_account, appraise_gmt, is_delete) VALUES - (#{teacherId}, #{appraiseLevel}, #{classPlanId}, #{fullName}, #{bindUserAccount}, #{appraiseGMT}, '0') + (#{teacherId}, #{teacherName}, #{appraiseLevel}, #{classPlanId}, #{lessonId}, #{lessonName}, #{fullName}, #{bindUserAccount}, #{appraiseGMT}, '0') + + UPDATE e_teacher_appraise SET + is_delete = '1' + WHERE + bind_user_account = #{bindUserAccount} + AND class_plan_id = #{classPlanId} + AND teacher_id = #{teacherId} + AND lesson_id = #{lessonId} + + + \ No newline at end of file diff --git a/src/main/resources/static/route/classplan/list-report-exam.html b/src/main/resources/static/route/classplan/list-report-exam.html index 3b9e521..094a274 100644 --- a/src/main/resources/static/route/classplan/list-report-exam.html +++ b/src/main/resources/static/route/classplan/list-report-exam.html @@ -100,7 +100,6 @@ {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, {width:100, title: '操作', fixed: 'left', align:'center', templet: function(row) { - console.log(row['examStatus'] == '1'); var dom = ''; if(row['examType'] == ''){ dom += '申请考试'; @@ -292,7 +291,7 @@ area: ['80%', '80%'], shadeClose: false, anim: 2, - content: top.restAjax.path('route/examination/distribution/update-exam-commit.html?classPlanId={classPlanId}', [obj.data.classPlanId]), + content: top.restAjax.path('route/examination/distribution/show.html?planId={classPlanId}', [obj.data.classPlanId]), end: function () { } });