From e8993f8306116187ac62d7a6a5b5e079cc72679e Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Sun, 20 Jun 2021 16:34:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=B2=E5=B8=88?= =?UTF-8?q?=E8=AF=84=E4=BB=B7=E6=9C=BA=E6=9E=84=E8=AF=84=E4=BB=B7=E7=9A=84?= =?UTF-8?q?APP=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appraise/OrgAppraiseAppController.java | 82 ++++++++++++++++ .../tenlion/dao/appraise/IAppraiseDao.java | 43 +++++++++ .../tenlion/dao/classplan/IClassPlanDao.java | 13 ++- .../pojo/dtos/appraise/OrgAppraiseDTO.java | 94 +++++++++++++++++++ .../dtos/appraise/TeacherAppraiseDTO.java | 94 +++++++++++++++++++ .../classplan/impl/ClassPlanServiceImpl.java | 20 ++-- .../mapper/appraise/appraise-mapper.xml | 85 +++++++++++++++++ .../mapper/classplan/class-plan-mapper.xml | 13 +++ 8 files changed, 431 insertions(+), 13 deletions(-) create mode 100644 src/main/java/cn/com/tenlion/controller/app/api/appraise/OrgAppraiseAppController.java create mode 100644 src/main/java/cn/com/tenlion/dao/appraise/IAppraiseDao.java create mode 100644 src/main/java/cn/com/tenlion/pojo/dtos/appraise/OrgAppraiseDTO.java create mode 100644 src/main/java/cn/com/tenlion/pojo/dtos/appraise/TeacherAppraiseDTO.java create mode 100644 src/main/resources/mybatis/mapper/appraise/appraise-mapper.xml 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 new file mode 100644 index 0000000..4677e32 --- /dev/null +++ b/src/main/java/cn/com/tenlion/controller/app/api/appraise/OrgAppraiseAppController.java @@ -0,0 +1,82 @@ +package cn.com.tenlion.controller.app.api.appraise; + +import cn.com.tenlion.dao.appraise.IAppraiseDao; +import cn.com.tenlion.pojo.dtos.appraise.OrgAppraiseDTO; +import cn.com.tenlion.pojo.dtos.appraise.TeacherAppraiseDTO; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.exceptions.SaveException; +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.*; + +import java.util.Map; + +/** + * 培训机构评价 + * @author xwangs + * @create 2021-06-20 14:34 + * @description + */ +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "培训机构评价") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/org-appraise") +public class OrgAppraiseAppController extends DefaultBaseController { + + @Autowired + private IAppraiseDao appraiseDao; + + @ApiOperation(value = "保存培训机构评价", notes = "保存培训机构评价") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save-org-appraise") + public SuccessResult saveOrgAppraise(@RequestHeader("token") String token, + @RequestBody OrgAppraiseDTO orgAppraiseDTO) throws SaveException { + Map params = HashMapUtil.beanToMap(orgAppraiseDTO); + appraiseDao.saveOrgAppraise(params); + return new SuccessResult(); + } + + @ApiOperation(value = "用户查询培训机构评价结果", notes = "查询个人资料信息接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get-org-appraise") + public OrgAppraiseDTO getOrgAppraise(@RequestHeader("token") String token) { + Map params = requestParams(); + OrgAppraiseDTO dto = appraiseDao.getOrgAppraise(params); + return dto == null ? new OrgAppraiseDTO() : dto; + } + + @ApiOperation(value = "保存讲师评价", notes = "保存讲师评价") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @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); + return new SuccessResult(); + } + + @ApiOperation(value = "用户查询讲师评价结果", notes = "查询个人资料信息接口") + @ApiImplicitParams({ + @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) { + Map params = requestParams(); + TeacherAppraiseDTO dto = appraiseDao.getTeacherAppraise(params); + return dto == null ? new TeacherAppraiseDTO() : dto; + } + +} diff --git a/src/main/java/cn/com/tenlion/dao/appraise/IAppraiseDao.java b/src/main/java/cn/com/tenlion/dao/appraise/IAppraiseDao.java new file mode 100644 index 0000000..53e5bb5 --- /dev/null +++ b/src/main/java/cn/com/tenlion/dao/appraise/IAppraiseDao.java @@ -0,0 +1,43 @@ +package cn.com.tenlion.dao.appraise; + +import cn.com.tenlion.pojo.dtos.appraise.OrgAppraiseDTO; +import cn.com.tenlion.pojo.dtos.appraise.TeacherAppraiseDTO; +import org.springframework.stereotype.Repository; + +import java.util.Map; + +/** + * 机构评价讲师评价Dao + * @author xwangs + * @create 2021-06-20 14:58 + * @description + */ +@Repository +public interface IAppraiseDao { + + /** + * 保存机构评价 + * @param params + */ + void saveOrgAppraise(Map params); + + /** + * 用户查询培训机构评价 + * @param params + * @return + */ + OrgAppraiseDTO getOrgAppraise(Map params); + + /** + * 保存讲师评价 + * @param params + */ + void saveTeacherAppraise(Map params); + + /** + * 用户查询讲师评价 + * @param params + * @return + */ + TeacherAppraiseDTO getTeacherAppraise(Map params); +} diff --git a/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java b/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java index 078fb9d..3afcffb 100644 --- a/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java +++ b/src/main/java/cn/com/tenlion/dao/classplan/IClassPlanDao.java @@ -1,13 +1,12 @@ package cn.com.tenlion.dao.classplan; -import cn.com.tenlion.pojo.dtos.applystudentsnew.ApplyStudentsNewDTO; +import cn.com.tenlion.pojo.bos.classplan.ClassPlanBO; +import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO; +import cn.com.tenlion.pojo.pos.classplan.ClassPlanPO; import ink.wgink.exceptions.RemoveException; import ink.wgink.exceptions.SaveException; import ink.wgink.exceptions.SearchException; import ink.wgink.exceptions.UpdateException; -import cn.com.tenlion.pojo.bos.classplan.ClassPlanBO; -import cn.com.tenlion.pojo.pos.classplan.ClassPlanPO; -import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO; import org.springframework.stereotype.Repository; import java.util.List; @@ -169,4 +168,10 @@ public interface IClassPlanDao { */ void updateExamFile(Map params); + /** + * 查询开设工种的所有培训机构 + * @param params + * @return + */ + List> listOrgSignInfo(Map params); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/appraise/OrgAppraiseDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/appraise/OrgAppraiseDTO.java new file mode 100644 index 0000000..9de52da --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/dtos/appraise/OrgAppraiseDTO.java @@ -0,0 +1,94 @@ +package cn.com.tenlion.pojo.dtos.appraise; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 机构评价实体类 + * @author xwangs + * @create 2021-06-20 14:46 + * @description + */ +@ApiModel +public class OrgAppraiseDTO { + + @ApiModelProperty(name = "orgId", value = "机构ID") + private String orgId; + @ApiModelProperty(name = "appraiseLevel", value = "评价等级1-5默认0") + private String appraiseLevel; + @ApiModelProperty(name = "classPlanId", value = "培训计划ID") + private String classPlanId; + @ApiModelProperty(name = "fullName", value = "评价人") + private String fullName; + @ApiModelProperty(name = "bindUserAccount", value = "统一用户Id") + private String bindUserAccount; + @ApiModelProperty(name = "appraiseGMT", value = "评价时间") + private String appraiseGMT; + + public String getOrgId() { + return orgId == null ? "" : orgId; + } + + public void setOrgId(String orgId) { + this.orgId = orgId; + } + + public String getAppraiseLevel() { + return appraiseLevel == null ? "" : appraiseLevel; + } + + public void setAppraiseLevel(String appraiseLevel) { + this.appraiseLevel = appraiseLevel; + } + + public String getClassPlanId() { + return classPlanId == null ? "" : classPlanId; + } + + public void setClassPlanId(String classPlanId) { + this.classPlanId = classPlanId; + } + + public String getFullName() { + return fullName == null ? "" : fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public String getBindUserAccount() { + return bindUserAccount == null ? "" : bindUserAccount; + } + + public void setBindUserAccount(String bindUserAccount) { + this.bindUserAccount = bindUserAccount; + } + + public String getAppraiseGMT() { + return appraiseGMT == null ? "" : appraiseGMT; + } + + public void setAppraiseGMT(String appraiseGMT) { + this.appraiseGMT = appraiseGMT; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"orgId\":\"") + .append(orgId).append('\"'); + sb.append(",\"appraiseLevel\":\"") + .append(appraiseLevel).append('\"'); + sb.append(",\"classPlanId\":\"") + .append(classPlanId).append('\"'); + sb.append(",\"fullName\":\"") + .append(fullName).append('\"'); + sb.append(",\"bindUserAccount\":\"") + .append(bindUserAccount).append('\"'); + sb.append(",\"appraiseGMT\":\"") + .append(appraiseGMT).append('\"'); + sb.append('}'); + return sb.toString(); + } +} 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 new file mode 100644 index 0000000..51d9629 --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/dtos/appraise/TeacherAppraiseDTO.java @@ -0,0 +1,94 @@ +package cn.com.tenlion.pojo.dtos.appraise; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 讲师评价实体类 + * @author xwangs + * @create 2021-06-20 14:46 + * @description + */ +@ApiModel +public class TeacherAppraiseDTO { + + @ApiModelProperty(name = "teacherId", value = "机构ID") + private String teacherId; + @ApiModelProperty(name = "appraiseLevel", value = "评价等级1-5默认0") + private String appraiseLevel; + @ApiModelProperty(name = "classPlanId", value = "培训计划ID") + private String classPlanId; + @ApiModelProperty(name = "fullName", value = "评价人") + private String fullName; + @ApiModelProperty(name = "bindUserAccount", value = "统一用户Id") + private String bindUserAccount; + @ApiModelProperty(name = "appraiseGMT", value = "评价时间") + private String appraiseGMT; + + public String getTeacherId() { + return teacherId == null ? "" : teacherId; + } + + public void setTeacherId(String teacherId) { + this.teacherId = teacherId; + } + + public String getAppraiseLevel() { + return appraiseLevel == null ? "" : appraiseLevel; + } + + public void setAppraiseLevel(String appraiseLevel) { + this.appraiseLevel = appraiseLevel; + } + + public String getClassPlanId() { + return classPlanId == null ? "" : classPlanId; + } + + public void setClassPlanId(String classPlanId) { + this.classPlanId = classPlanId; + } + + public String getFullName() { + return fullName == null ? "" : fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public String getBindUserAccount() { + return bindUserAccount == null ? "" : bindUserAccount; + } + + public void setBindUserAccount(String bindUserAccount) { + this.bindUserAccount = bindUserAccount; + } + + public String getAppraiseGMT() { + return appraiseGMT == null ? "" : appraiseGMT; + } + + public void setAppraiseGMT(String appraiseGMT) { + this.appraiseGMT = appraiseGMT; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"teacherId\":\"") + .append(teacherId).append('\"'); + sb.append(",\"appraiseLevel\":\"") + .append(appraiseLevel).append('\"'); + sb.append(",\"classPlanId\":\"") + .append(classPlanId).append('\"'); + sb.append(",\"fullName\":\"") + .append(fullName).append('\"'); + sb.append(",\"bindUserAccount\":\"") + .append(bindUserAccount).append('\"'); + sb.append(",\"appraiseGMT\":\"") + .append(appraiseGMT).append('\"'); + sb.append('}'); + return sb.toString(); + } +} 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 8186131..9fcd605 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 @@ -633,26 +633,28 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl if("0".equals(workerCatalog)){ return new SuccessResultList<>(new ArrayList<>(),0,0L); } + // 查询开设当前工种的所有培训机构 Map query = new HashMap<>(); - query.put("institutionType","training"); - List list = iInstitutionService.list(query); + query.put("workTypeId",workerCatalog); + List> orgList = classPlanDao.listOrgSignInfo(query); List> res = new ArrayList<>(); - if(list != null && list.size() > 0){ - for (InstitutionDTO item :list){ + if(orgList != null && orgList.size() > 0){ + for (Map item :orgList){ // 查询开班情况 - query.put("workTypeId", workerCatalog); - query.put("orgId", item.getInstitutionId()); + query.put("orgId", item.get("orgId")); + InstitutionDTO institutionDTO = iInstitutionService.get(item.get("orgId").toString()); ExamCheckDTO examCheck = examCheckDao.getExamCheck(query); if(null == examCheck){ //查不到 Map itemMap = new HashMap<>(); - itemMap.put("orgId",item.getInstitutionId()); - itemMap.put("orgName",item.getInstitutionName()); + itemMap.put("orgId",institutionDTO.getInstitutionId()); + itemMap.put("orgName",institutionDTO.getInstitutionName()); //当前报名多少人 query.clear(); - query.put("applyInstitutionId",item.getInstitutionId()); + query.put("applyInstitutionId",institutionDTO.getInstitutionId()); query.put("applyWorkTypeId",workerCatalog); List applyAuditStates = new ArrayList<>(); + applyAuditStates.add("0"); applyAuditStates.add("2"); query.put("applyAuditStates",applyAuditStates); List passUserList = applyService.list(query); diff --git a/src/main/resources/mybatis/mapper/appraise/appraise-mapper.xml b/src/main/resources/mybatis/mapper/appraise/appraise-mapper.xml new file mode 100644 index 0000000..64116fe --- /dev/null +++ b/src/main/resources/mybatis/mapper/appraise/appraise-mapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO e_org_appraise + (org_id, appraise_level, class_plan_id, full_name, bind_user_account, appraise_gmt, is_delete) + VALUES + (#{orgId}, #{appraiseLevel}, #{classPlanId}, #{fullName}, #{bindUserAccount}, #{appraiseGMT}, '0') + + + + + + INSERT INTO e_teacher_appraise + (teacher_id, appraise_level, class_plan_id, full_name, bind_user_account, appraise_gmt, is_delete) + VALUES + (#{teacherId}, #{appraiseLevel}, #{classPlanId}, #{fullName}, #{bindUserAccount}, #{appraiseGMT}, '0') + + + + + \ No newline at end of file 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 cc8958d..47475f7 100644 --- a/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml +++ b/src/main/resources/mybatis/mapper/classplan/class-plan-mapper.xml @@ -525,4 +525,17 @@ class_plan_id = #{classPlanId} + + + \ No newline at end of file From 4cac5876dda4a77a8ab36001dc70f3f70cf2e24c Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Mon, 21 Jun 2021 17:27:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BC=80=E7=8F=AD=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=96=9D=E8=80=83=E8=AF=95=E7=94=B3=E8=AF=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=A1=E6=A0=B8=E4=BA=BA=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/route/examapply/list-check.html | 45 +++++++++++-------- .../static/route/examcheck/list.html | 45 +++++++++++-------- 2 files changed, 54 insertions(+), 36 deletions(-) diff --git a/src/main/resources/static/route/examapply/list-check.html b/src/main/resources/static/route/examapply/list-check.html index 2ab26d9..14dc9c3 100644 --- a/src/main/resources/static/route/examapply/list-check.html +++ b/src/main/resources/static/route/examapply/list-check.html @@ -213,6 +213,33 @@ [ {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, + {field: 'point', width: 180, title: '审核人角色', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + return rowData; + } + }, + {field: 'checkStatus', width: 150, title: '审批状态', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData === null || rowData === '') { + return '-'; + } + if(rowData == '0') { + rowData = '待审批'; + } + if(rowData == '1') { + rowData = '审批通过'; + } + if(rowData == '2') { + rowData = '审批驳回'; + } + return rowData; + } + }, {field: 'planName', width: 180, title: '计划名称', align:'center', templet: function(row) { point = row['point']; @@ -285,24 +312,6 @@ return rowData; } }, - {field: 'checkStatus', width: 150, title: '审批状态', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData === null || rowData === '') { - return '-'; - } - if(rowData == '0') { - rowData = '待审批'; - } - if(rowData == '1') { - rowData = '审批通过'; - } - if(rowData == '2') { - rowData = '审批驳回'; - } - return rowData; - } - }, {field: 'reason', width: 150, title: '审核原因', align:'center', templet: function(row) { var rowData = row[this.field]; diff --git a/src/main/resources/static/route/examcheck/list.html b/src/main/resources/static/route/examcheck/list.html index b6e3e65..7ca4eac 100644 --- a/src/main/resources/static/route/examcheck/list.html +++ b/src/main/resources/static/route/examcheck/list.html @@ -198,6 +198,33 @@ [ {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, + {field: 'point', width: 180, title: '审核人角色', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + return rowData; + } + }, + {field: 'checkStatus', width: 180, title: '审核状态', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData === null || rowData === '') { + return '-'; + } + if('0' == rowData) { + rowData = '待审核'; + } + if('1' == rowData) { + rowData = '审核通过'; + } + if('-1' == rowData) { + rowData = '审核驳回'; + } + return rowData; + } + }, {field: 'planName', width: 180, title: '计划名称', align:'center', templet: function(row) { var rowData = row.classPlanDTO[this.field]; @@ -268,24 +295,6 @@ return rowData; } }, - {field: 'checkStatus', width: 180, title: '审核状态', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData === null || rowData === '') { - return '-'; - } - if('0' == rowData) { - rowData = '待审核'; - } - if('1' == rowData) { - rowData = '审核通过'; - } - if('-1' == rowData) { - rowData = '审核驳回'; - } - return rowData; - } - }, {field: 'reason', width: 180, title: '审核原因', align:'center', templet: function(row) { var rowData = row[this.field];