添加机构评价

This commit is contained in:
wans 2021-06-21 18:04:22 +08:00
parent 14a249e42d
commit 9ea163add8
5 changed files with 124 additions and 17 deletions

View File

@ -1,10 +1,12 @@
package cn.com.tenlion.controller.app.api.appraise; 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.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 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;
@ -13,6 +15,7 @@ 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.*;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -27,7 +30,9 @@ import java.util.Map;
public class OrgAppraiseAppController extends DefaultBaseController { public class OrgAppraiseAppController extends DefaultBaseController {
@Autowired @Autowired
private IAppraiseDao appraiseDao; private IAppraiseService appraiseService;
@Autowired
private IClassPlanDao classPlanDao;
@ApiOperation(value = "保存培训机构评价", notes = "保存培训机构评价") @ApiOperation(value = "保存培训机构评价", notes = "保存培训机构评价")
@ApiImplicitParams({ @ApiImplicitParams({
@ -37,8 +42,7 @@ public class OrgAppraiseAppController extends DefaultBaseController {
@PostMapping("save-org-appraise") @PostMapping("save-org-appraise")
public SuccessResult saveOrgAppraise(@RequestHeader("token") String token, public SuccessResult saveOrgAppraise(@RequestHeader("token") String token,
@RequestBody OrgAppraiseDTO orgAppraiseDTO) throws SaveException { @RequestBody OrgAppraiseDTO orgAppraiseDTO) throws SaveException {
Map<String, Object> params = HashMapUtil.beanToMap(orgAppraiseDTO); appraiseService.saveOrgAppraise(token,orgAppraiseDTO);
appraiseDao.saveOrgAppraise(params);
return new SuccessResult(); return new SuccessResult();
} }
@ -50,7 +54,7 @@ public class OrgAppraiseAppController extends DefaultBaseController {
@GetMapping("get-org-appraise") @GetMapping("get-org-appraise")
public OrgAppraiseDTO getOrgAppraise(@RequestHeader("token") String token) { public OrgAppraiseDTO getOrgAppraise(@RequestHeader("token") String token) {
Map<String, Object> params = requestParams(); Map<String, Object> params = requestParams();
OrgAppraiseDTO dto = appraiseDao.getOrgAppraise(params); OrgAppraiseDTO dto = appraiseService.getOrgAppraise(token, params);
return dto == null ? new OrgAppraiseDTO() : dto; return dto == null ? new OrgAppraiseDTO() : dto;
} }
@ -63,7 +67,7 @@ public class OrgAppraiseAppController extends DefaultBaseController {
public SuccessResult saveTeacherAppraise(@RequestHeader("token") String token, public SuccessResult saveTeacherAppraise(@RequestHeader("token") String token,
@RequestBody TeacherAppraiseDTO teacherAppraiseDTO) throws SaveException { @RequestBody TeacherAppraiseDTO teacherAppraiseDTO) throws SaveException {
Map<String, Object> params = HashMapUtil.beanToMap(teacherAppraiseDTO); Map<String, Object> params = HashMapUtil.beanToMap(teacherAppraiseDTO);
appraiseDao.saveTeacherAppraise(params); //appraiseDao.saveTeacherAppraise(params);
return new SuccessResult(); return new SuccessResult();
} }
@ -75,8 +79,26 @@ public class OrgAppraiseAppController extends DefaultBaseController {
@GetMapping("get-teacher-appraise") @GetMapping("get-teacher-appraise")
public TeacherAppraiseDTO getTeacherAppraise(@RequestHeader("token") String token) { public TeacherAppraiseDTO getTeacherAppraise(@RequestHeader("token") String token) {
Map<String, Object> params = requestParams(); Map<String, Object> params = requestParams();
TeacherAppraiseDTO dto = appraiseDao.getTeacherAppraise(params); /*TeacherAppraiseDTO dto = appraiseDao.getTeacherAppraise(params);
return dto == null ? new TeacherAppraiseDTO() : dto; 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<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

@ -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<String, Object> params);
}

View File

@ -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<String, Object> params = HashMapUtil.beanToMap(orgAppraiseDTO);
appraiseDao.saveOrgAppraise(params);
}
@Override
public OrgAppraiseDTO getOrgAppraise(String token, Map<String, Object> params) {
AppTokenUser appTokenUser = getAppTokenUser(token);
params.put("bindUserAccount",appTokenUser.getId());
OrgAppraiseDTO dto = appraiseDao.getOrgAppraise(params);
return dto == null ? new OrgAppraiseDTO() : dto;
}
}

View File

@ -100,20 +100,21 @@
{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>';
return dom; return dom;
} }
if(row['examType'] === '0'){ if(row['examType'] == '0' && row['examStatus'] == '0'){
dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="showEvent">查看申请</a>'; dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="showEvent">查看</a>';
return dom; return dom;
} }
if(row['examType'] === '1'){ if(row['examStatus'] == '1'){
dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="showEvent">查看申请</a>'; dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="showExamEvent">查看考试</a>';
return dom; return dom;
} }
if(row['examType'] === '-1'){ if(row['examType'] == '-1'){
dom += '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="updateEvent">修改重申</a>'; dom += '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="updateEvent">修改重申</a>';
return dom; return dom;
} }
@ -125,10 +126,10 @@
if(row['examType'] === ''){ if(row['examType'] === ''){
return '<a type="button" class="layui-btn layui-btn-warm layui-btn-xs">待申请</a>'; return '<a type="button" class="layui-btn layui-btn-warm layui-btn-xs">待申请</a>';
} }
if(row['examType'] === '0'){ if(row['examType'] === '0' && row['examStatus'] == '0'){
return '<a type="button" class="layui-btn layui-btn-warm layui-btn-xs">申请中</a>'; return '<a type="button" class="layui-btn layui-btn-warm layui-btn-xs">申请中</a>';
} }
if(row['examType'] === '1'){ if(row['examStatus'] == '1'){
dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs">申请通过</a>'; dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs">申请通过</a>';
return 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'){ if(layEvent == 'updateEvent'){
layer.open({ layer.open({
type: 2, type: 2,

View File

@ -99,7 +99,7 @@
} }
if(row['reportType'] === '1'){ if(row['reportType'] === '1'){
dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="signUpUserEvent">参培人员</a>'; dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="signUpUserEvent">参培人员</a>';
dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="showEvent">申请通过</a>'; dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="showEvent">详情</a>';
return dom; return dom;
} }
if(row['reportType'] === '-1'){ if(row['reportType'] === '-1'){