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 4677e32..0eab5a2 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 @@ -1,10 +1,12 @@ package cn.com.tenlion.controller.app.api.appraise; -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 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; @@ -13,6 +15,7 @@ import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; import java.util.Map; /** @@ -27,7 +30,9 @@ import java.util.Map; public class OrgAppraiseAppController extends DefaultBaseController { @Autowired - private IAppraiseDao appraiseDao; + private IAppraiseService appraiseService; + @Autowired + private IClassPlanDao classPlanDao; @ApiOperation(value = "保存培训机构评价", notes = "保存培训机构评价") @ApiImplicitParams({ @@ -37,8 +42,7 @@ public class OrgAppraiseAppController extends DefaultBaseController { @PostMapping("save-org-appraise") public SuccessResult saveOrgAppraise(@RequestHeader("token") String token, @RequestBody OrgAppraiseDTO orgAppraiseDTO) throws SaveException { - Map params = HashMapUtil.beanToMap(orgAppraiseDTO); - appraiseDao.saveOrgAppraise(params); + appraiseService.saveOrgAppraise(token,orgAppraiseDTO); return new SuccessResult(); } @@ -50,7 +54,7 @@ public class OrgAppraiseAppController extends DefaultBaseController { @GetMapping("get-org-appraise") public OrgAppraiseDTO getOrgAppraise(@RequestHeader("token") String token) { Map params = requestParams(); - OrgAppraiseDTO dto = appraiseDao.getOrgAppraise(params); + OrgAppraiseDTO dto = appraiseService.getOrgAppraise(token, params); return dto == null ? new OrgAppraiseDTO() : dto; } @@ -63,7 +67,7 @@ public class OrgAppraiseAppController extends DefaultBaseController { public SuccessResult saveTeacherAppraise(@RequestHeader("token") String token, @RequestBody TeacherAppraiseDTO teacherAppraiseDTO) throws SaveException { Map params = HashMapUtil.beanToMap(teacherAppraiseDTO); - appraiseDao.saveTeacherAppraise(params); + //appraiseDao.saveTeacherAppraise(params); return new SuccessResult(); } @@ -75,8 +79,26 @@ public class OrgAppraiseAppController extends DefaultBaseController { @GetMapping("get-teacher-appraise") public TeacherAppraiseDTO getTeacherAppraise(@RequestHeader("token") String token) { Map params = requestParams(); - TeacherAppraiseDTO dto = appraiseDao.getTeacherAppraise(params); - return dto == null ? new TeacherAppraiseDTO() : dto; + /*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; } } diff --git a/src/main/java/cn/com/tenlion/service/appraise/IAppraiseService.java b/src/main/java/cn/com/tenlion/service/appraise/IAppraiseService.java new file mode 100644 index 0000000..ebb7cd2 --- /dev/null +++ b/src/main/java/cn/com/tenlion/service/appraise/IAppraiseService.java @@ -0,0 +1,28 @@ +package cn.com.tenlion.service.appraise; + +import cn.com.tenlion.pojo.dtos.appraise.OrgAppraiseDTO; + +import java.util.Map; + +/** + * @author xwangs + * @create 2021-06-21 14:09 + * @description + */ +public interface IAppraiseService { + + /** + * 保存培训机构评价 + * @param token + * @param orgAppraiseDTO + */ + void saveOrgAppraise(String token, OrgAppraiseDTO orgAppraiseDTO); + + /** + * 用户查询培训机构评价结果 + * @param token + * @param params + * @return + */ + OrgAppraiseDTO getOrgAppraise(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 new file mode 100644 index 0000000..3cb4592 --- /dev/null +++ b/src/main/java/cn/com/tenlion/service/appraise/impl/AppraiseServiceImpl.java @@ -0,0 +1,43 @@ +package cn.com.tenlion.service.appraise.impl; + +import cn.com.tenlion.dao.appraise.IAppraiseDao; +import cn.com.tenlion.pojo.dtos.appraise.OrgAppraiseDTO; +import cn.com.tenlion.service.appraise.IAppraiseService; +import ink.wgink.common.base.DefaultBaseService; +import ink.wgink.pojo.app.AppTokenUser; +import ink.wgink.util.date.DateUtil; +import ink.wgink.util.map.HashMapUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * @author xwangs + * @create 2021-06-21 14:10 + * @description + */ +@Service +public class AppraiseServiceImpl extends DefaultBaseService implements IAppraiseService { + + @Autowired + private IAppraiseDao appraiseDao; + + @Override + public void saveOrgAppraise(String token, OrgAppraiseDTO orgAppraiseDTO) { + AppTokenUser appTokenUser = getAppTokenUser(token); + orgAppraiseDTO.setAppraiseGMT(DateUtil.getTime()); + orgAppraiseDTO.setBindUserAccount(appTokenUser.getId()); + orgAppraiseDTO.setFullName(appTokenUser.getName()); + Map params = HashMapUtil.beanToMap(orgAppraiseDTO); + appraiseDao.saveOrgAppraise(params); + } + + @Override + public OrgAppraiseDTO getOrgAppraise(String token, Map params) { + AppTokenUser appTokenUser = getAppTokenUser(token); + params.put("bindUserAccount",appTokenUser.getId()); + OrgAppraiseDTO dto = appraiseDao.getOrgAppraise(params); + return dto == null ? new OrgAppraiseDTO() : dto; + } +} 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 6c90fbd..3b9e521 100644 --- a/src/main/resources/static/route/classplan/list-report-exam.html +++ b/src/main/resources/static/route/classplan/list-report-exam.html @@ -100,20 +100,21 @@ {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'] === ''){ + if(row['examType'] == ''){ dom += '申请考试'; return dom; } - if(row['examType'] === '0'){ - dom += '查看申请'; + if(row['examType'] == '0' && row['examStatus'] == '0'){ + dom += '查看'; return dom; } - if(row['examType'] === '1'){ - dom += '查看申请'; + if(row['examStatus'] == '1'){ + dom += '查看考试'; return dom; } - if(row['examType'] === '-1'){ + if(row['examType'] == '-1'){ dom += '修改重申'; return dom; } @@ -125,10 +126,10 @@ if(row['examType'] === ''){ return '待申请'; } - if(row['examType'] === '0'){ + if(row['examType'] === '0' && row['examStatus'] == '0'){ return '申请中'; } - if(row['examType'] === '1'){ + if(row['examStatus'] == '1'){ dom += '申请通过'; return dom; } @@ -283,6 +284,19 @@ } }); } + if(layEvent == 'showExamEvent'){ + layer.open({ + type: 2, + title: '查看考试', + closeBtn: 1, + area: ['80%', '80%'], + shadeClose: false, + anim: 2, + content: top.restAjax.path('route/examination/distribution/update-exam-commit.html?classPlanId={classPlanId}', [obj.data.classPlanId]), + end: function () { + } + }); + } if(layEvent == 'updateEvent'){ layer.open({ type: 2, diff --git a/src/main/resources/static/route/classplan/list.html b/src/main/resources/static/route/classplan/list.html index 9289ad1..733b62f 100644 --- a/src/main/resources/static/route/classplan/list.html +++ b/src/main/resources/static/route/classplan/list.html @@ -99,7 +99,7 @@ } if(row['reportType'] === '1'){ dom += '参培人员'; - dom += '申请通过'; + dom += '详情'; return dom; } if(row['reportType'] === '-1'){