个人中心功能对接

This commit is contained in:
wans 2021-06-23 09:50:12 +08:00
parent 36f9d2caa6
commit 2ba1dffa2f
15 changed files with 302 additions and 101 deletions

View File

@ -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.OrgAppraiseDTO;
import cn.com.tenlion.pojo.dtos.appraise.TeacherAppraiseDTO; import cn.com.tenlion.pojo.dtos.appraise.TeacherAppraiseDTO;
import cn.com.tenlion.service.appraise.IAppraiseService; import cn.com.tenlion.service.appraise.IAppraiseService;
import com.alibaba.fastjson.JSONObject;
import ink.wgink.common.base.DefaultBaseController; import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.exceptions.SaveException; import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.pojo.result.ErrorResult; import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.util.map.HashMapUtil;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -65,9 +64,8 @@ public class OrgAppraiseAppController extends DefaultBaseController {
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("save-teacher-appraise") @PostMapping("save-teacher-appraise")
public SuccessResult saveTeacherAppraise(@RequestHeader("token") String token, public SuccessResult saveTeacherAppraise(@RequestHeader("token") String token,
@RequestBody TeacherAppraiseDTO teacherAppraiseDTO) throws SaveException { @RequestBody JSONObject appraiseObj) throws SaveException {
Map<String, Object> params = HashMapUtil.beanToMap(teacherAppraiseDTO); appraiseService.saveTeacherAppraise(token, appraiseObj);
//appraiseDao.saveTeacherAppraise(params);
return new SuccessResult(); return new SuccessResult();
} }
@ -76,29 +74,11 @@ public class OrgAppraiseAppController extends DefaultBaseController {
@ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "token", value = "token", paramType = "header"),
}) })
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get-teacher-appraise") @GetMapping("list-teacher-appraise")
public TeacherAppraiseDTO getTeacherAppraise(@RequestHeader("token") String token) { public List<TeacherAppraiseDTO> getTeacherAppraise(@RequestHeader("token") String token) {
Map<String, Object> params = requestParams(); Map<String, Object> params = requestParams();
/*TeacherAppraiseDTO dto = appraiseDao.getTeacherAppraise(params); List<TeacherAppraiseDTO> dto = appraiseService.getTeacherAppraise(token,params);
return dto == null ? new TeacherAppraiseDTO() : dto;*/ return 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<Map<String, Object>> listPlanTeacher(@RequestHeader("token") String token){
Map<String, Object> params = requestParams();
if(params.get("classPlanId") == null
|| params.get("classPlanId").toString().length() == 0){
throw new SearchException("classPlanId参数缺失,查询失败");
}
String classPlanId = params.get("classPlanId").toString();
List<Map<String, Object>> list = classPlanDao.listClassPlanLessons(classPlanId);
return list;
} }
} }

View File

@ -1,8 +1,8 @@
package cn.com.tenlion.controller.app.api.basicuserinfo; package cn.com.tenlion.controller.app.api.basicuserinfo;
import cn.com.tenlion.pojo.dtos.basicuserinfo.BasicUserInfoDTO; 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.basicuserinfo.IBasicUserInfoService;
import cn.com.tenlion.service.classplan.IClassPlanService;
import cn.com.tenlion.service.myexamforapp.IMyExamForAppService; import cn.com.tenlion.service.myexamforapp.IMyExamForAppService;
import ink.wgink.common.base.DefaultBaseController; import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.exceptions.SaveException; import ink.wgink.exceptions.SaveException;
@ -33,6 +33,8 @@ public class BasicUserInfoAppController extends DefaultBaseController {
private IMyExamForAppService myExamForAppService; private IMyExamForAppService myExamForAppService;
@Autowired @Autowired
private IBasicUserInfoService basicUserInfoService; private IBasicUserInfoService basicUserInfoService;
@Autowired
private IClassPlanService classPlanService;
@ApiOperation(value = "查询个人资料信息", notes = "查询个人资料信息接口") @ApiOperation(value = "查询个人资料信息", notes = "查询个人资料信息接口")
@ApiImplicitParams({ @ApiImplicitParams({
@ -62,9 +64,21 @@ public class BasicUserInfoAppController extends DefaultBaseController {
}) })
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list-my-exam") @GetMapping("list-my-exam")
public List<MyExamDTO> listMyExam(@RequestHeader("token") String token) throws SaveException { public List<Map<String, Object>> listMyExam(@RequestHeader("token") String token) throws SaveException {
Map<String,Object> params = requestParams(); Map<String,Object> params = requestParams();
List<MyExamDTO> list = myExamForAppService.listMyExam(token,params); List<Map<String, Object>> 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<Map<String, Object>> listMyClassPlan(@RequestHeader("token") String token) throws SaveException {
Map<String,Object> params = requestParams();
List<Map<String, Object>> list = classPlanService.listMyClassPlan(token,params);
return list; return list;
} }

View File

@ -40,4 +40,16 @@ public interface IAppraiseDao {
* @return * @return
*/ */
TeacherAppraiseDTO getTeacherAppraise(Map<String, Object> params); TeacherAppraiseDTO getTeacherAppraise(Map<String, Object> params);
/**
* 删除用户机构评价
* @param params
*/
void deleteOrgAppraise(Map<String, Object> params);
/**
* 删除讲师评价
* @param params
*/
void deleteTeacherAppraise(Map<String, Object> params);
} }

View File

@ -95,6 +95,10 @@ public class ApplyDTO {
private Integer applyUserNum2; private Integer applyUserNum2;
@ApiModelProperty(name = "applyUserNum3", value = "已通过审核人数") @ApiModelProperty(name = "applyUserNum3", value = "已通过审核人数")
private Integer applyUserNum3; 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) { public void setApplyUserNum3(Integer applyUserNum3) {
this.applyUserNum3 = 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;
}
} }

View File

@ -12,12 +12,18 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel @ApiModel
public class TeacherAppraiseDTO { public class TeacherAppraiseDTO {
@ApiModelProperty(name = "teacherId", value = "机构ID") @ApiModelProperty(name = "teacherId", value = "讲师ID")
private String teacherId; private String teacherId;
@ApiModelProperty(name = "teacherName", value = "讲师姓名")
private String teacherName;
@ApiModelProperty(name = "appraiseLevel", value = "评价等级1-5默认0") @ApiModelProperty(name = "appraiseLevel", value = "评价等级1-5默认0")
private String appraiseLevel; private String appraiseLevel;
@ApiModelProperty(name = "classPlanId", value = "培训计划ID") @ApiModelProperty(name = "classPlanId", value = "培训计划ID")
private String classPlanId; private String classPlanId;
@ApiModelProperty(name = "lessonId", value = "课程ID")
private String lessonId;
@ApiModelProperty(name = "lessonName", value = "课程名称")
private String lessonName;
@ApiModelProperty(name = "fullName", value = "评价人") @ApiModelProperty(name = "fullName", value = "评价人")
private String fullName; private String fullName;
@ApiModelProperty(name = "bindUserAccount", value = "统一用户Id") @ApiModelProperty(name = "bindUserAccount", value = "统一用户Id")
@ -33,6 +39,14 @@ public class TeacherAppraiseDTO {
this.teacherId = teacherId; this.teacherId = teacherId;
} }
public String getTeacherName() {
return teacherName == null ? "" : teacherName;
}
public void setTeacherName(String teacherName) {
this.teacherName = teacherName;
}
public String getAppraiseLevel() { public String getAppraiseLevel() {
return appraiseLevel == null ? "" : appraiseLevel; return appraiseLevel == null ? "" : appraiseLevel;
} }
@ -49,6 +63,22 @@ public class TeacherAppraiseDTO {
this.classPlanId = classPlanId; 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() { public String getFullName() {
return fullName == null ? "" : fullName; return fullName == null ? "" : fullName;
} }
@ -78,10 +108,16 @@ public class TeacherAppraiseDTO {
final StringBuilder sb = new StringBuilder("{"); final StringBuilder sb = new StringBuilder("{");
sb.append("\"teacherId\":\"") sb.append("\"teacherId\":\"")
.append(teacherId).append('\"'); .append(teacherId).append('\"');
sb.append(",\"teacherName\":\"")
.append(teacherName).append('\"');
sb.append(",\"appraiseLevel\":\"") sb.append(",\"appraiseLevel\":\"")
.append(appraiseLevel).append('\"'); .append(appraiseLevel).append('\"');
sb.append(",\"classPlanId\":\"") sb.append(",\"classPlanId\":\"")
.append(classPlanId).append('\"'); .append(classPlanId).append('\"');
sb.append(",\"lessonId\":\"")
.append(lessonId).append('\"');
sb.append(",\"lessonName\":\"")
.append(lessonName).append('\"');
sb.append(",\"fullName\":\"") sb.append(",\"fullName\":\"")
.append(fullName).append('\"'); .append(fullName).append('\"');
sb.append(",\"bindUserAccount\":\"") sb.append(",\"bindUserAccount\":\"")

View File

@ -191,6 +191,9 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
PageHelper.startPage(page.getPage(), page.getRows()); PageHelper.startPage(page.getPage(), page.getRows());
List<ApplyDTO> applyDTOs = list(page.getParams()); List<ApplyDTO> applyDTOs = list(page.getParams());
for (ApplyDTO applyDTO : applyDTOs) { for (ApplyDTO applyDTO : applyDTOs) {
InstitutionDTO orgInfo = iInstitutionService.get(applyDTO.getApplyInstitutionId());
applyDTO.setOrgCharge(orgInfo.getInstitutionPrincipal());
applyDTO.setOrgTel(orgInfo.getInstitutionContact());
//统计机构报名数量 //统计机构报名数量
List<String> states = new ArrayList<>(); List<String> states = new ArrayList<>();
states.add("0"); states.add("0");

View File

@ -1,7 +1,10 @@
package cn.com.tenlion.service.appraise; package cn.com.tenlion.service.appraise;
import cn.com.tenlion.pojo.dtos.appraise.OrgAppraiseDTO; 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; import java.util.Map;
/** /**
@ -25,4 +28,20 @@ public interface IAppraiseService {
* @return * @return
*/ */
OrgAppraiseDTO getOrgAppraise(String token, Map<String, Object> params); OrgAppraiseDTO getOrgAppraise(String token, Map<String, Object> params);
/**
* 保存讲师评价
* @param token
* @param appraiseObj
*/
void saveTeacherAppraise(String token, JSONObject appraiseObj);
/**
* 用户查询培训下授课讲师列表
* @param token
* @param params
* @return
*/
List<TeacherAppraiseDTO> getTeacherAppraise(String token, Map<String, Object> params);
} }

View File

@ -1,8 +1,12 @@
package cn.com.tenlion.service.appraise.impl; package cn.com.tenlion.service.appraise.impl;
import cn.com.tenlion.dao.appraise.IAppraiseDao; 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.OrgAppraiseDTO;
import cn.com.tenlion.pojo.dtos.appraise.TeacherAppraiseDTO;
import cn.com.tenlion.service.appraise.IAppraiseService; 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.common.base.DefaultBaseService;
import ink.wgink.pojo.app.AppTokenUser; import ink.wgink.pojo.app.AppTokenUser;
import ink.wgink.util.date.DateUtil; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -22,6 +28,8 @@ public class AppraiseServiceImpl extends DefaultBaseService implements IAppraise
@Autowired @Autowired
private IAppraiseDao appraiseDao; private IAppraiseDao appraiseDao;
@Autowired
private IClassPlanDao classPlanDao;
@Override @Override
public void saveOrgAppraise(String token, OrgAppraiseDTO orgAppraiseDTO) { public void saveOrgAppraise(String token, OrgAppraiseDTO orgAppraiseDTO) {
@ -30,6 +38,7 @@ public class AppraiseServiceImpl extends DefaultBaseService implements IAppraise
orgAppraiseDTO.setBindUserAccount(appTokenUser.getId()); orgAppraiseDTO.setBindUserAccount(appTokenUser.getId());
orgAppraiseDTO.setFullName(appTokenUser.getName()); orgAppraiseDTO.setFullName(appTokenUser.getName());
Map<String, Object> params = HashMapUtil.beanToMap(orgAppraiseDTO); Map<String, Object> params = HashMapUtil.beanToMap(orgAppraiseDTO);
appraiseDao.deleteOrgAppraise(params);
appraiseDao.saveOrgAppraise(params); appraiseDao.saveOrgAppraise(params);
} }
@ -40,4 +49,56 @@ public class AppraiseServiceImpl extends DefaultBaseService implements IAppraise
OrgAppraiseDTO dto = appraiseDao.getOrgAppraise(params); OrgAppraiseDTO dto = appraiseDao.getOrgAppraise(params);
return dto == null ? new OrgAppraiseDTO() : dto; return dto == null ? new OrgAppraiseDTO() : dto;
} }
@Override
public List<TeacherAppraiseDTO> getTeacherAppraise(String token, Map<String, Object> params) {
AppTokenUser appTokenUser = getAppTokenUser(token);
String classPlanId = params.get("classPlanId").toString();
// 查询培训计划下讲师列表
List<Map<String, Object>> teacherLessonList = classPlanDao.listClassPlanLessons(classPlanId);
if(teacherLessonList == null || teacherLessonList.size() == 0){
return new ArrayList<>();
}
List<TeacherAppraiseDTO> dto = new ArrayList<>();
for (Map<String, Object> 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<String, Object> params = HashMapUtil.beanToMap(dto);
appraiseDao.deleteTeacherAppraise(params);
appraiseDao.saveTeacherAppraise(params);
}
}
} }

View File

@ -278,4 +278,12 @@ public interface IClassPlanService {
* @param classPlanVO * @param classPlanVO
*/ */
void updateExamRecommit(String classPlanId, ClassPlanVO classPlanVO); void updateExamRecommit(String classPlanId, ClassPlanVO classPlanVO);
/**
* 查询我的培训
* @param token
* @param params
* @return
*/
List<Map<String, Object>> listMyClassPlan(String token, Map<String, Object> params);
} }

View File

@ -39,6 +39,7 @@ import ink.wgink.exceptions.SaveException;
import ink.wgink.module.dictionary.pojo.dtos.DataDTO; import ink.wgink.module.dictionary.pojo.dtos.DataDTO;
import ink.wgink.module.dictionary.service.IDataService; import ink.wgink.module.dictionary.service.IDataService;
import ink.wgink.pojo.ListPage; import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.app.AppTokenUser;
import ink.wgink.pojo.result.SuccessResultList; import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.util.UUIDUtil; import ink.wgink.util.UUIDUtil;
import ink.wgink.util.date.DateUtil; import ink.wgink.util.date.DateUtil;
@ -718,4 +719,44 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
} }
return res; return res;
} }
@Override
public List<Map<String, Object>> listMyClassPlan(String token, Map<String, Object> params) {
AppTokenUser appTokenUser = getAppTokenUser(token);
params.put("creator", appTokenUser.getId());
List<ApplyStudentsDTO> list = studentsService.list(params);
List<Map<String, Object>> classPlanList = new ArrayList<>();
if (list == null || list.size() == 0){
return classPlanList;
}
for (ApplyStudentsDTO item : list){
Map<String, Object> 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<ApplyStudentsDTO> userCounts = studentsService.listByClssId(classPlanId);
itemMap.put("userCounts", userCounts.size());
classPlanList.add(itemMap);
}
return classPlanList;
}
} }

View File

@ -1,7 +1,5 @@
package cn.com.tenlion.service.myexamforapp; package cn.com.tenlion.service.myexamforapp;
import cn.com.tenlion.pojo.dtos.myexam.MyExamDTO;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -18,5 +16,5 @@ public interface IMyExamForAppService {
* @param token * @param token
* @return * @return
*/ */
List<MyExamDTO> listMyExam(String token, Map<String,Object> params); List<Map<String, Object>> listMyExam(String token, Map<String,Object> params);
} }

View File

@ -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.pojo.dtos.institution.InstitutionDTO;
import cn.com.tenlion.institutionmanagement.service.institution.IInstitutionService; 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.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.examapply.ExamApplyDTO;
import cn.com.tenlion.pojo.dtos.myexam.MyExamDTO; import cn.com.tenlion.service.applystudents.IApplyStudentsService;
import cn.com.tenlion.pojo.dtos.worktype.WorkTypeDTO;
import cn.com.tenlion.service.classplan.IClassPlanService; import cn.com.tenlion.service.classplan.IClassPlanService;
import cn.com.tenlion.service.examapply.IExamApplyService; 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.myexamforapp.IMyExamForAppService;
import cn.com.tenlion.service.worktype.IWorkTypeService; import cn.com.tenlion.service.worktype.IWorkTypeService;
import ink.wgink.common.base.DefaultBaseService; 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 ink.wgink.pojo.app.AppTokenUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -31,76 +30,56 @@ import java.util.Map;
@Service @Service
public class MyExamForAppServiceImpl extends DefaultBaseService implements IMyExamForAppService { public class MyExamForAppServiceImpl extends DefaultBaseService implements IMyExamForAppService {
/**
* 准考证
*/
@Autowired
private IDistributionCardService distributionCardService;
/**
* 培训计划
*/
@Autowired @Autowired
private IClassPlanService classPlanService; private IClassPlanService classPlanService;
/**
* 培训机构
*/
@Autowired @Autowired
private IInstitutionService iInstitutionService; private IInstitutionService iInstitutionService;
/**
* 数据字典
*/
@Autowired
private IDataService dataService;
/**
* 工种
*/
@Autowired @Autowired
private IWorkTypeService workTypeService; private IWorkTypeService workTypeService;
/**
* 考试申请
*/
@Autowired @Autowired
private IExamApplyService examApplyService; private IExamApplyService examApplyService;
@Autowired
private IApplyStudentsService studentsService;
@Autowired
private IDistributionService distributionService;
@Override @Override
public List<MyExamDTO> listMyExam(String token, Map<String, Object> params) { public List<Map<String, Object>> listMyExam(String token, Map<String, Object> params) {
AppTokenUser appTokenUser = getAppTokenUser(token); AppTokenUser appTokenUser = getAppTokenUser(token);
String userId = appTokenUser.getId(); String bindUserAccount = appTokenUser.getId();
params.put("distributionCardUserId",userId); params.put("creator",bindUserAccount);
List<DistributionCardDTO> cardDTOS = distributionCardService.list(params); // 从已报名人员表中查出所有培训记录
if(cardDTOS == null || cardDTOS.size() == 0){ List<ApplyStudentsDTO> list = studentsService.list(params);
return new ArrayList<>(0); if(list == null || list.size() == 0){
return new ArrayList<>();
} }
List<MyExamDTO> list = new ArrayList<>(); List<Map<String, Object>> examList = new ArrayList<>();
for(DistributionCardDTO item : cardDTOS){ for (ApplyStudentsDTO item : list){
MyExamDTO myExamDTO = new MyExamDTO(); String classPlanId = item.getApplyClassId();
// 查询计划信息 // 查询考试信息
ClassPlanDTO classPlanDTO = classPlanService.get(item.getClassPlanId()); params.clear();
// 查询培训机构 params.put("classPlanId",classPlanId);
InstitutionDTO institutionDTO = iInstitutionService.get(classPlanDTO.getOrgId()); ExamApplyDTO examApplyDTO = examApplyService.get(params);
// 查询培训项目 int examPassType = examApplyDTO.getCheckStatus();
DataDTO dataDTO = dataService.get(classPlanDTO.getProjectCatalogId()); int examPlaceType = examApplyDTO.getStatus();
// 查询工种类别 if( examPassType == 1 && examPlaceType == 1){
WorkTypeDTO workTypeDTO = workTypeService.get(classPlanDTO.getWorkerCatalog()); //封装考试信息
myExamDTO.setOrgName(institutionDTO.getInstitutionName()); Map<String, Object> examObj = new HashMap<>();
myExamDTO.setPlanName(classPlanDTO.getPlanName()); examObj.put("workTypeId",item.getApplyWorkTypeId());
myExamDTO.setPlanNumber(classPlanDTO.getPlanNumber()); examObj.put("workTypeName",item.getApplyWorkTypeName());
switch (classPlanDTO.getPlanType()){ ClassPlanDTO classPlanDTO = classPlanService.get(classPlanId);
case "1" : myExamDTO.setPlanTypeName("初训"); break; examObj.put("chargePerson",classPlanDTO.getChargePersonTel());
case "2" : myExamDTO.setPlanTypeName("复训"); break; examObj.put("chargePersonTel",classPlanDTO.getChargePerson());
case "3" : myExamDTO.setPlanTypeName("换证"); break; // 查询考点信息
default : myExamDTO.setPlanTypeName("-"); DistributionDTO distributionDTO = distributionService.get(classPlanId);
} InstitutionDTO examPlace = iInstitutionService.get(distributionDTO.getStationId());
myExamDTO.setProjectCatalogName(dataDTO.getDataName()); examObj.put("examPlaceName",examPlace.getInstitutionName());
myExamDTO.setWorkerCatalogName(workTypeDTO.getWorkTypeName()); examObj.put("examPlaceAddr",examPlace.getInstitutionAddress());
Map<String, Object> queryMap = getHashMap(8); examObj.put("startTime",distributionDTO.getDistributionAllotTime());
queryMap.put("examId",item.getClassPlanId()); examObj.put("endTime",distributionDTO.getDistributionAllotEndTime());
ExamApplyDTO examApplyDTO = examApplyService.get(queryMap); examList.add(examObj);
myExamDTO.setExamTimeStart(examApplyDTO.getPracticeExamStartTime()); }
myExamDTO.setExamTimeEnd(examApplyDTO.getPracticeExamEndTime()); }
list.add(myExamDTO); return examList;
}
return list;
} }
} }

View File

@ -433,6 +433,9 @@
<if test="applyClassId != null and applyClassId != ''"> <if test="applyClassId != null and applyClassId != ''">
AND t1.apply_class_id = #{applyClassId} AND t1.apply_class_id = #{applyClassId}
</if> </if>
<if test="creator != null and creator != ''">
AND t1.creator = #{creator}
</if>
<if test="startTime != null and startTime != ''"> <if test="startTime != null and startTime != ''">
AND AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime} LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}

View File

@ -13,8 +13,11 @@
<resultMap id="teacherAppraiseDTO" type="cn.com.tenlion.pojo.dtos.appraise.TeacherAppraiseDTO"> <resultMap id="teacherAppraiseDTO" type="cn.com.tenlion.pojo.dtos.appraise.TeacherAppraiseDTO">
<result column="teacher_id" property="teacherId"/> <result column="teacher_id" property="teacherId"/>
<result column="teacher_name" property="teacherName"/>
<result column="appraise_level" property="appraiseLevel"/> <result column="appraise_level" property="appraiseLevel"/>
<result column="class_plan_id" property="classPlanId"/> <result column="class_plan_id" property="classPlanId"/>
<result column="lesson_id" property="lessonId"/>
<result column="lesson_name" property="lessonName"/>
<result column="full_name" property="fullName"/> <result column="full_name" property="fullName"/>
<result column="bind_user_account" property="bindUserAccount"/> <result column="bind_user_account" property="bindUserAccount"/>
<result column="appraise_gmt" property="appraiseGMT"/> <result column="appraise_gmt" property="appraiseGMT"/>
@ -27,6 +30,16 @@
(#{orgId}, #{appraiseLevel}, #{classPlanId}, #{fullName}, #{bindUserAccount}, #{appraiseGMT}, '0') (#{orgId}, #{appraiseLevel}, #{classPlanId}, #{fullName}, #{bindUserAccount}, #{appraiseGMT}, '0')
</insert> </insert>
<update id="deleteOrgAppraise" parameterType="map">
UPDATE e_org_appraise SET
is_delete = '1'
WHERE
bind_user_account = #{bindUserAccount}
AND class_plan_id = #{classPlanId}
AND org_id = #{orgId}
</update>
<select id="getOrgAppraise" parameterType="map" resultMap="orgAppraiseDTO"> <select id="getOrgAppraise" parameterType="map" resultMap="orgAppraiseDTO">
SELECT SELECT
t1.org_id, t1.org_id,
@ -51,18 +64,22 @@
limit 1 limit 1
</select> </select>
<!--==========授课讲师评价=============-->
<insert id="saveTeacherAppraise" parameterType="map"> <insert id="saveTeacherAppraise" parameterType="map">
INSERT INTO e_teacher_appraise 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 VALUES
(#{teacherId}, #{appraiseLevel}, #{classPlanId}, #{fullName}, #{bindUserAccount}, #{appraiseGMT}, '0') (#{teacherId}, #{teacherName}, #{appraiseLevel}, #{classPlanId}, #{lessonId}, #{lessonName}, #{fullName}, #{bindUserAccount}, #{appraiseGMT}, '0')
</insert> </insert>
<select id="getTeacherAppraise" parameterType="map" resultMap="teacherAppraiseDTO"> <select id="getTeacherAppraise" parameterType="map" resultMap="teacherAppraiseDTO">
SELECT SELECT
t1.teacher_id, t1.teacher_id,
t1.teacher_name,
t1.appraise_level, t1.appraise_level,
t1.class_plan_id, t1.class_plan_id,
t1.lesson_id,
t1.lesson_name,
t1.full_name, t1.full_name,
t1.bind_user_account, t1.bind_user_account,
t1.appraise_gmt t1.appraise_gmt
@ -82,4 +99,15 @@
limit 1 limit 1
</select> </select>
<update id="deleteTeacherAppraise" parameterType="map">
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}
</update>
</mapper> </mapper>

View File

@ -100,7 +100,6 @@
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{width:100, title: '操作', fixed: 'left', align:'center', {width:100, title: '操作', fixed: 'left', align:'center',
templet: function(row) { templet: function(row) {
console.log(row['examStatus'] == '1');
var dom = ''; var dom = '';
if(row['examType'] == ''){ if(row['examType'] == ''){
dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs" lay-event="examEvent">申请考试</a>'; dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs" lay-event="examEvent">申请考试</a>';
@ -292,7 +291,7 @@
area: ['80%', '80%'], area: ['80%', '80%'],
shadeClose: false, shadeClose: false,
anim: 2, 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 () { end: function () {
} }
}); });