Commit 11efd28a authored by YangZhaoJun1's avatar YangZhaoJun1

2.0版本所需接口已经完成,可能有bug,有待测试

parent e0e7c1d7
......@@ -20,6 +20,7 @@ import java.util.Date;
@AllArgsConstructor
public class BCarousel extends IdEntity<BCarousel> {
private static final long serialVersionUID = -4024897937254829705L;
/*轮播描述*/
private String carouselDes;
/*轮播图片*/
......
......@@ -69,6 +69,7 @@ public class BChapterController extends PaginationController<BChapter> {
@ApiImplicitParam(name = "pid", value = "上一级", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "chapterUrl", value = "课程url", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "mdFile", value = "任务书", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "classHour", value = "课时", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "isTest", value = "1:实验 2:视频 3:PPT'", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "remarks", value = "备注", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "lessonOrSl", value = "课程或开课;0:开课 1:课程", required = true, dataType = "varchar"),
......
......@@ -27,7 +27,12 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
*/
@Select("<script>select * from b_chapter " +
"where del_flag = 0 and flag = 1 and chapter_level = 1 " +
"and sl_id = #{slId} " +
"<if test=\"slId!=null and slId != ''\">\n" +
" and sl_id = #{slId}\n" +
"</if>" +
"<if test=\"lessonId!=null and lessonId != ''\">\n" +
" and lesson_id = #{lessonId}\n" +
"</if>" +
"and lesson_or_sl = #{lessonOrSl} " +
"order by create_date</script>")
@ResultMap(value = "SupperChildListResultMap" )
......@@ -187,5 +192,6 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
@Update("<script>update b_chapter set state = #{state} where sl_id = #{slId}</script>")
int updateAllStateBySlId(@Param("slId") String slId, @Param("state") String state);
}
......@@ -15,6 +15,7 @@ import org.rcisoft.business.blesson.dao.BLessonRepository;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.brslstudent.dao.BRSlStudentRepository;
import org.rcisoft.business.bsl.dao.BSlRepository;
import org.rcisoft.business.bsl.enums.AuditStatusEnum;
import org.rcisoft.business.bstudent.dao.BStudentRepository;
import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.exception.ServiceException;
......@@ -74,7 +75,12 @@ public class BChapterServiceImpl implements BChapterService {
@Override
public List<BChapter> queryBChapters(BChapter model) {
Map param = new HashMap<String,Object>();
param.put("slId",model.getSlId());
if(model.getSlId()!=null&&!"".equals(model.getSlId())){
param.put("slId",model.getSlId());
}
if(model.getLessonId()!=null&&!"".equals(model.getLessonId())){
param.put("lessonId",model.getLessonId());
}
param.put("lessonOrSl",model.getLessonOrSl());
return bChapterRepository.queryBChapters(param);
}
......@@ -89,9 +95,14 @@ public class BChapterServiceImpl implements BChapterService {
throw new ServiceException(ResultServiceEnums.SL_INFO_NOT_EXISTS);*/
UserUtil.setCurrentPersistOperation(model);
line = bChapterRepository.insertSelective(model);
}else
}else {
String state = bSlRepository.queryStateById(model.getSlId());
if(state.equals(AuditStatusEnum.PUBLISHED.getCode())){
throw new ServiceException(ResultServiceEnums.CHAPTER_IS_USED);
}
UserUtil.setCurrentMergeOperation(model);
line = bChapterRepository.updateByPrimaryKeySelective(model);
}
//FamilyLogger.sysInfo(UserUtils.getUser().getBusinessId(),UserUtils.getUser().getLoginName()+"新增了ID为"+user.getBusinessId()+"的用户");
return new PersistModel(line);
}
......@@ -114,6 +125,11 @@ public class BChapterServiceImpl implements BChapterService {
boolean isChapter = bChapter.getChapterLevel()== ChapterLevelEnum.CHAPTER.getCode();
if(isChapter&&hasChild)
throw new ServiceException(ResultServiceEnums.CHAPTER_HAS_CHILD);
String state = bSlRepository.queryStateById(id);
if(state.equals(AuditStatusEnum.PUBLISHED.getCode())){
throw new ServiceException(ResultServiceEnums.CHAPTER_IS_USED);
}
bChapterRepository.deleteStudentChapter(id);
bChapterRepository.deleteByPrimaryKey(id);
UserUtil.setCurrentMergeOperation(bChapter);
......@@ -227,6 +243,13 @@ public class BChapterServiceImpl implements BChapterService {
int result = bChapterRepository.updateStateById(bChapter);
if(bChapter.getPid().equals("-1")){
result=bChapterRepository.updateStateByPid(bChapter);
}else{
String fatherState = bChapterRepository.selectStateById(bChapter.getPid());
if(fatherState.equals(StateEnum.CLOSE.getCode())&&state.equals(StateEnum.CLOSE.getCode())){
bChapter.setBusinessId(bChapter.getPid());
bChapter.setState(StateEnum.OPEN.getCode());
bChapterRepository.updateStateById(bChapter);
}
}
return result;
}
......
......@@ -12,6 +12,7 @@ import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.converter.MultipartFile2HSSFWorkbookConverter;
import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.model.SelectModel;
import org.rcisoft.core.result.Result;
import org.rcisoft.core.result.ResultCode;
import org.rcisoft.core.result.ResultServiceEnums;
......@@ -24,6 +25,8 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
/**
* Created by CodeGenerator on 2017/07/12.
......@@ -124,4 +127,14 @@ public class BClassController extends PaginationController<BClass> {
MessageConstant.MESSAGE_ALERT_ERROR,
bClassService.queryBClasss(param));
}
@ApiOperation(value="查询班级列表", notes="查询班级列表赋值在下拉框中")
@GetMapping(value = "/queryBClassList")
public Result queryBClassList() {
List<SelectModel> bClass = bClassService.queryBClassList();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bClass);
}
}
package org.rcisoft.business.bclass.dao;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.bclass.entity.BClass;
import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository;
......@@ -40,5 +42,9 @@ public interface BClassRepository extends BaseMapper<BClass> {
"( #{item.createDate},#{item.updateDate},#{item.delFlag},#{item.flag},#{item.businessId},#{item.code},#{item.className})" +
"</foreach></script>")
int insertList(List<BClass> bClasses);
@Select("select * from b_class where del_flag != 1 and flag = 1")
@ResultMap(value = "BaseResultMap" )
List<BClass> queryBClassList();
}
......@@ -5,6 +5,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.rcisoft.business.bclass.entity.BClass;
import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.model.SelectModel;
import java.io.IOException;
import java.util.List;
......@@ -55,4 +56,6 @@ public interface BClassService{
* @return
*/
PersistModel importExcel(HSSFWorkbook hwb, String token) throws IOException;
List<SelectModel> queryBClassList();
}
......@@ -10,6 +10,7 @@ import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.model.SelectModel;
import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.core.util.ExcelUtil;
import org.rcisoft.core.util.UserUtil;
......@@ -120,6 +121,19 @@ public class BClassServiceImpl implements BClassService {
return new PersistModel(line,result);
}
@Override
public List<SelectModel> queryBClassList() {
List<BClass> bClass = bClassRepository.queryBClassList();
ArrayList<SelectModel> comBoxModel = new ArrayList<SelectModel>();
for(BClass c : bClass){
SelectModel selectModel = new SelectModel();
selectModel.setId(c.getCode());
selectModel.setText(c.getClassName());
comBoxModel.add(selectModel);
}
return comBoxModel;
}
private Map<String,Object> queryParamHandler(BClass model){
Map param = new HashMap<String, Object>();
if(!model.getClassName().equals("")&&model.getClassName()!="")
......
......@@ -9,6 +9,7 @@ import org.rcisoft.common.controller.PaginationController;
import org.rcisoft.common.model.GridModel;
import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.model.SelectModel;
import org.rcisoft.core.result.Result;
import org.rcisoft.core.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Created by on 2017-12-19 13:45:42.
......@@ -91,4 +94,15 @@ public class BDirectionController extends PaginationController<BDirection> {
MessageConstant.MESSAGE_ALERT_ERROR,
bDirectionService.queryDirections(param));
}
@ApiOperation(value="查询方向列表", notes="查询方向列表赋值在下拉框中")
@GetMapping(value = "/queryDirectionsList")
public Result queryDirectionsList() {
List<SelectModel> directions = bDirectionService.queryDirectionsList();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
directions);
}
}
......@@ -33,5 +33,9 @@ public interface BDirectionRepository extends BaseMapper<BDirection> {
@Select("<script>select count(*) from b_lesson_direction where direction_id = #{id}</script>")
int selectslNumById(String id);
@Select("<script>select * from b_direction where del_flag != 1 and flag = 1</script>")
@ResultMap(value = "BaseResultMap")
List<BDirection> queryDirectionsList();
}
......@@ -4,6 +4,7 @@ package org.rcisoft.business.bdirection.service;
import org.rcisoft.business.bdirection.entity.BDirection;
import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.model.SelectModel;
import java.util.List;
......@@ -44,4 +45,6 @@ public interface BDirectionService {
* @return
*/
PersistModel removeDirection(String id);
List<SelectModel> queryDirectionsList();
}
package org.rcisoft.business.bdirection.service.impl;
import org.rcisoft.business.bclass.entity.BClass;
import org.rcisoft.business.bdirection.dao.BDirectionRepository;
import org.rcisoft.business.bdirection.entity.BDirection;
import org.rcisoft.business.bdirection.service.BDirectionService;
import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.model.SelectModel;
import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.core.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -14,6 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -65,4 +68,17 @@ public class BDirectionServiceImpl implements BDirectionService {
int line = bDirectionRepository.deleteByPrimaryKey(id);
return new PersistModel(line);
}
@Override
public List<SelectModel> queryDirectionsList() {
List<BDirection> bDirection = bDirectionRepository.queryDirectionsList();
ArrayList<SelectModel> comBoxModel = new ArrayList<SelectModel>();
for(BDirection c : bDirection){
SelectModel selectModel = new SelectModel();
selectModel.setId(c.getBusinessId());
selectModel.setText(c.getName());
comBoxModel.add(selectModel);
}
return comBoxModel;
}
}
......@@ -48,6 +48,9 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiImplicitParam(name = "code", value = "课程编号", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "lessonName", value = "课程名称", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "defaultUrl", value = "默认封面图片url", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "classHour", value = "课时", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "credits", value = "学分", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "directionId", value = "课程方向ID", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "remarks", value = "备注", required = false, dataType = "varchar")})
@PostMapping(value = "/add")
@PreAuthorize("hasRole('ROLE_1001')")
......@@ -171,6 +174,8 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiImplicitParam(name = "code", value = "课程编号", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "lessonName", value = "课程名称", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "defaultUrl", value = "默认封面图片url", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "classHour", value = "课时", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "credits", value = "学分", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "delFlag", value = "删除标记(0:正常;1:删除;2:审核)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "flag", value = "启用标记(0:停用;1:启用)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "remarks", value = "备注", required = false, dataType = "varchar")})
......@@ -186,6 +191,8 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "code", value = "课程编号", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "lessonName", value = "课程名称", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "classHour", value = "课时", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "credits", value = "学分", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "defaultUrl", value = "默认封面图片url", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "delFlag", value = "删除标记(0:正常;1:删除;2:审核)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "flag", value = "启用标记(0:停用;1:启用)", required = false, dataType = "varchar"),
......
package org.rcisoft.business.bopinion.controller;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.rcisoft.business.bopinion.entity.BOpinion;
import org.rcisoft.business.bopinion.service.BOpinionService;
import org.rcisoft.common.controller.PaginationController;
import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Created by Administrator on 2017/12/21.
*/
@RestController
@RequestMapping("/BOpinion")
public class BOpinionController extends PaginationController<BOpinion> {
@Autowired
private BOpinionService bOpinionService;
@ApiOperation(value="查询历史审批意见", notes="根据开课ID查询历史审批意见")
@ApiImplicitParam(name = "slId", value = "开课ID", required = true, dataType = "varchar")
@GetMapping(value = "/queryOpinionBySlId")
private Result queryOpinionBySlId(String slId){
List<BOpinion> data = bOpinionService.queryOpinionBySlId(slId);
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
data);
}
}
package org.rcisoft.business.bopinion.dao;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.bopinion.entity.BOpinion;
import org.rcisoft.core.base.BaseMapper;
import java.util.List;
/**
* Created by Administrator on 2017/12/21.
*/
public interface BOpinionRepository extends BaseMapper<BOpinion> {
@Select("select * from b_opinion where sl_id = #{slId}")
@ResultMap(value = "BaseResultMap")
List<BOpinion> queryOpinionBySlId(String slId);
}
package org.rcisoft.business.bopinion.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* Created by Administrator on 2017/12/21.
*/
@Entity
@Table(name = "b_opinion")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BOpinion {
private String businessId;
private String opinion;
private Date createDate;
private String slId;
}
package org.rcisoft.business.bopinion.service;
import org.rcisoft.business.bopinion.entity.BOpinion;
import java.util.List;
/**
* Created by Administrator on 2017/12/21.
*/
public interface BOpinionService {
List<BOpinion> queryOpinionBySlId(String slId);
}
package org.rcisoft.business.bopinion.service.impl;
import org.rcisoft.business.bopinion.dao.BOpinionRepository;
import org.rcisoft.business.bopinion.entity.BOpinion;
import org.rcisoft.business.bopinion.service.BOpinionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Created by Administrator on 2017/12/21.
*/
@Service
@Transactional(readOnly = true,propagation = Propagation.NOT_SUPPORTED)
public class BOpinionServiceImpl implements BOpinionService{
@Autowired
private BOpinionRepository bOpinionRepository;
@Override
public List<BOpinion> queryOpinionBySlId(String slId) {
return bOpinionRepository.queryOpinionBySlId(slId);
}
}
......@@ -57,6 +57,10 @@ public class BSlController extends PaginationController<BSl> {
@ApiImplicitParam(name = "recommendCourse", value = "推荐原因", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "gitLabProjectId", value = "gitlab项目id", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "gitLabProjectName", value = "gitlab项目名", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "classHour", value = "课时", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "credits", value = "学分", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "directionId", value = "课程方向ID", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "delFlag", value = "删除标记(0:正常;1:删除;2:审核,3已驳回)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "delFlag", value = "删除标记(0:正常;1:删除;2:审核)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "flag", value = "启用标记(0:停用;1:启用)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "remarks", value = "备注", required = false, dataType = "varchar")})
......@@ -132,6 +136,7 @@ public class BSlController extends PaginationController<BSl> {
@ApiImplicitParam(name = "teacherName", value = "教师姓名", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "lessonName", value = "课程名称", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "termName", value = "学期名称", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "auditStatus", value = "审核状态 0:待发布,1审核中,2已发布,3已驳回", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "delFlag", value = "删除标记(0:正常;1:删除;2:审核)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "flag", value = "启用标记(0:停用;1:启用)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "remarks", value = "备注", required = false, dataType = "varchar")})
......@@ -161,7 +166,6 @@ public class BSlController extends PaginationController<BSl> {
@ApiImplicitParam(name = "teacherName", value = "教师姓名", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "lessonName", value = "课程名称", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "termName", value = "学期名称", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "delFlag", value = "删除标记(0:正常;1:删除;2:审核)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "flag", value = "启用标记(0:停用;1:启用)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "remarks", value = "备注", required = false, dataType = "varchar")})
@GetMapping(value = "/queryBSls")
......@@ -234,21 +238,24 @@ public class BSlController extends PaginationController<BSl> {
}
@ApiOperation(value="根据学号获取学习课程", notes="根据学号获取学习课程")
@ApiImplicitParam(name = "lessonName", value = "课程名称关键字", required = true, dataType = "varchar")
@ApiImplicitParams({@ApiImplicitParam(name = "lessonName", value = "课程名称关键字", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "termCode", value = "学期编号", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "studentCode", value = "学生编号", required = true, dataType = "varchar")})
@GetMapping(value = "/mySlByStudentCode")
public GridModel mySlByStudentCode(@RequestParam(value = "lessonName", defaultValue = "") String lessonName) {
String code = "0108150216";//UserUtil.getUser().getLoginName();
bSlService.queryStudentSLByCodeByPagination(getPaginationUtility(), code, lessonName);
public GridModel mySlByStudentCode(String studentCode, String lessonName, String termCode) {
bSlService.queryStudentSLByCodeByPagination(getPaginationUtility(), studentCode, lessonName,termCode);
GridModel gridModel = getGridModelResponse();
return gridModel;
}
@ApiOperation(value="在教课程", notes="分页查询在教课程")
@ApiImplicitParam(name = "lessonName", value = "课程名称关键字", required = true, dataType = "varchar")
@ApiImplicitParams({@ApiImplicitParam(name = "lessonName", value = "课程名称关键字", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "auditStatus", value = "发布状态", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "teacherCode", value = "教师编号", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "termCode", value = "学期编号", required = false, dataType = "varchar")})
@GetMapping(value = "/mySlByTeacherCode")
public GridModel mySlByTeacherCode(@RequestParam(value = "lessonName", defaultValue = "") String lessonName) {
String code = "0108150216";//UserUtil.getUser().getLoginName();
bSlService.queryTeacherSLByCodeByPagination(getPaginationUtility(), code, lessonName);
public GridModel mySlByTeacherCode(String teacherCode, String lessonName, String auditStatus, String termCode) {
bSlService.queryTeacherSLByCodeByPagination(getPaginationUtility(), teacherCode, lessonName,auditStatus,termCode);
GridModel gridModel = getGridModelResponse();
return gridModel;
}
......@@ -328,5 +335,19 @@ public class BSlController extends PaginationController<BSl> {
}
@ApiOperation(value="开课审核", notes="开课审核")
@ApiImplicitParams({@ApiImplicitParam(name = "slId", value = "开课ID", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "status", value = "要变成的状态0:待发布,1审核中,2已发布,3已驳回", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "opinion", value = "驳回意见(通过不用写意见)", required = false, dataType = "varchar")})
@PostMapping("/auditBsl")
public Result auditBsl(String slId, String status, String opinion){
int data = bSlService.auditBsl(slId,status,opinion);
return Result.builder(new PersistModel(data),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
slId);
}
}
......@@ -32,6 +32,7 @@ public interface BSlRepository extends BaseMapper<BSl> {
" <if test=\"teacherName !=null and teacherName !=''\">AND u.name like CONCAT('%',#{teacherName},'%')</if>" +
" <if test=\"lessonName !=null and lessonName !=''\">AND lesson.lesson_name like CONCAT('%',#{lessonName},'%')</if>" +
" <if test=\"termCode !=null and termCode !=''\">AND sl.term_code like CONCAT('%',#{termCode},'%')</if>" +
" <if test=\"auditStatus !=null and auditStatus !=''\">AND sl.audit_status = #{auditStatus}</if>" +
" </where></script>")
@ResultMap(value = "BaseResultMap" )
List<BSl> queryBSls(Map<String, Object> param);
......@@ -94,8 +95,11 @@ public interface BSlRepository extends BaseMapper<BSl> {
"AND t3.del_flag = 0\n" +
"AND t3.flag = 1\n" +
"AND t2.is_online = '1' "+
"AND t3.lesson_name like #{lessonName}</script>")
List<SlDTO> selectStudentSLByCode(@Param("studentCode") String studentCode, @Param("lessonName") String lessonName);
"<if test=\"lessonName !=null and lessonName !=''\">AND t3.lesson_name like CONCAT('%',#{lessonName},'%') </if>" +
"<if test=\"termCode !=null and termCode !=''\">AND t2.term_code like CONCAT('%',#{termCode},'%') </if></script>")
List<SlDTO> selectStudentSLByCode(@Param("studentCode") String studentCode,
@Param("lessonName") String lessonName,
@Param("termCode") String termCode);
/**
* 根据工号获取在教课程
......@@ -119,8 +123,13 @@ public interface BSlRepository extends BaseMapper<BSl> {
"AND t3.del_flag = 0\n" +
"AND t3.flag = 1\n"+
"AND t2.is_online != 2 "+
"AND t3.lesson_name like #{lessonName}</script>")
List<SlDTO> selectTeacherSLByCode(@Param("teacherCode") String teacherCode, @Param("lessonName") String lessonName);
"<if test=\"lessonName !=null and lessonName !=''\">AND t3.lesson_name like CONCAT('%',#{lessonName},'%') </if>" +
"<if test=\"auditStatus !=null and auditStatus !=''\">AND t2.audit_status = #{auditStatus} </if>" +
" <if test=\"termCode !=null and termCode !=''\">AND t2.term_code like CONCAT('%',#{termCode},'%') </if></script>")
List<SlDTO> selectTeacherSLByCode(@Param("teacherCode") String teacherCode,
@Param("lessonName") String lessonName,
@Param("auditStatus") String auditStatus,
@Param("termCode") String termCode);
/**
* 根据课程id获取开课详情
......@@ -234,5 +243,11 @@ public interface BSlRepository extends BaseMapper<BSl> {
@Param("term") String term,
@Param("studentCode")String studentCode,
@Param("teacherCode")String teacherCode);
@Update("<script>update b_sl set audit_status=#{code} where business_id=#{code}</script>")
int updateAuditStatus(@Param("slId") String slId, @Param("code") String code);
@Select("select audit_status from b_sl where business_id = #{slId}")
String queryStateById(String slId);
}
......@@ -57,6 +57,8 @@ public class BSl extends IdEntity<BSl> {
private String credits;//学分
private String auditStatus;//审核状态 0:待发布,1审核中,2已发布,3已驳回
@Transient
private String teacherName;// 教师姓名
......
package org.rcisoft.business.bsl.enums;
import lombok.Getter;
/**
* Created by Administrator on 2017/12/21.
*/
@Getter
public enum AuditStatusEnum {
WAIT_RELEASE("0"), //待发布
AUDITING("1"), //审核中
PUBLISHED("2"), //已发布
DISMISSAL("3") //已驳回
;
private String code;
AuditStatusEnum(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}
......@@ -75,14 +75,14 @@ public interface BSlService{
* 根据学号查找学生学习课程
* @return
*/
List<SlDTO> queryStudentSLByCodeByPagination(PageUtil pageUtil, String code, String lessonName);
List<SlDTO> queryStudentSLByCodeByPagination(PageUtil pageUtil, String studentCode, String lessonName, String termCode);
/**
* 根据教师工号查找在教课程
* @param code
* @return
*/
List<SlDTO> queryTeacherSLByCodeByPagination(PageUtil pageUtil, String code, String lessonName);
List<SlDTO> queryTeacherSLByCodeByPagination(PageUtil pageUtil, String code, String lessonName, String auditStatus, String termCode);
/**
* 获取精品课程
......@@ -119,4 +119,6 @@ public interface BSlService{
int queryBslTeacher(String teacherCode, String businessId);
List<BSl> historySlByCodeByPagination(PageUtil pageUtil, String lessonName, String term, String studentCode, String teacherCode);
int auditBsl(String slId, String status, String opinion);
}
......@@ -8,12 +8,15 @@ import org.rcisoft.business.bchapter.service.BChapterService;
import org.rcisoft.business.blesson.dao.BLessonRepository;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.entity.BLessonDirection;
import org.rcisoft.business.bopinion.dao.BOpinionRepository;
import org.rcisoft.business.bopinion.entity.BOpinion;
import org.rcisoft.business.brslstudent.dao.BRSlStudentRepository;
import org.rcisoft.business.brslstudent.entity.BRSlStudent;
import org.rcisoft.business.bsl.dao.BSlRepository;
import org.rcisoft.business.bsl.dto.SlDTO;
import org.rcisoft.business.bsl.dto.SlDetailDTO;
import org.rcisoft.business.bsl.entity.BSl;
import org.rcisoft.business.bsl.enums.AuditStatusEnum;
import org.rcisoft.business.bsl.enums.BSlEnum;
import org.rcisoft.business.bsl.enums.RecommendEnum;
import org.rcisoft.business.bsl.service.BSlService;
......@@ -36,10 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
......@@ -60,6 +60,9 @@ public class BSlServiceImpl implements BSlService {
private BRSlStudentRepository brSlStudentRepository;
@Autowired
private BChapterService bChapterService;
@Autowired
private BOpinionRepository bOpinionRepository;
/*@Autowired
private UserRepository userRepository;
@Autowired
......@@ -125,6 +128,7 @@ public class BSlServiceImpl implements BSlService {
model.setGitLabProjectId(project.getId());*/
String pName = global.getGIT_LAB_PROJECT_PREFIX()+model.getCode();
model.setGitLabProjectName(pName);
model.setAuditStatus("0");
UserUtil.setCurrentPersistOperation(model);
int data = bSlRepository.insertSelective(model);
int result = bChapterService.addBslFormLesson(bLesson.getBusinessId(),model.getLessonCode(), model.getBusinessId());
......@@ -301,13 +305,13 @@ public class BSlServiceImpl implements BSlService {
}
@Override
public List<SlDTO> queryStudentSLByCodeByPagination(PageUtil pageUtil, String code, String lessonName) {
return bSlRepository.selectStudentSLByCode(code,paramHandler(lessonName));
public List<SlDTO> queryStudentSLByCodeByPagination(PageUtil pageUtil, String studentCode, String lessonName, String termCode) {
return bSlRepository.selectStudentSLByCode(studentCode,lessonName,termCode);
}
@Override
public List<SlDTO> queryTeacherSLByCodeByPagination(PageUtil pageUtil, String code, String lessonName) {
return bSlRepository.selectTeacherSLByCode(code,paramHandler(lessonName));
public List<SlDTO> queryTeacherSLByCodeByPagination(PageUtil pageUtil, String code, String lessonName, String auditStatus, String termCode) {
return bSlRepository.selectTeacherSLByCode(code,lessonName, auditStatus, termCode);
}
@Override
......@@ -351,6 +355,27 @@ public class BSlServiceImpl implements BSlService {
return bSlRepository.historySlByCodeByPagination(lessonName,term,studentCode,teacherCode);
}
@Override
public int auditBsl(String slId, String status, String opinion) {
int result = 0;
if(status.equals(AuditStatusEnum.AUDITING.getCode())) {//提交审核
result = bSlRepository.updateAuditStatus(slId,AuditStatusEnum.AUDITING.getCode());
}else if(status.equals(AuditStatusEnum.PUBLISHED.getCode())) {//通过
result = bSlRepository.updateAuditStatus(slId, AuditStatusEnum.PUBLISHED.getCode());
}else if(status.equals(AuditStatusEnum.DISMISSAL.getCode())) {//驳回 记录驳回意见
BOpinion bOpinion = new BOpinion();
bOpinion.setBusinessId(IdGen.uuid());
bOpinion.setCreateDate(new Date());
bOpinion.setOpinion(opinion);
bOpinion.setSlId(slId);
bOpinionRepository.insert(bOpinion);
result = bSlRepository.updateAuditStatus(slId, AuditStatusEnum.DISMISSAL.getCode());
}else{//待发布
result = bSlRepository.updateAuditStatus(slId, AuditStatusEnum.WAIT_RELEASE.getCode());
}
return result;
}
private Map<String,Object> getParames(BSl model){
Map param = new HashMap<String,Object>();
......@@ -358,6 +383,7 @@ public class BSlServiceImpl implements BSlService {
param.put("teacherName",model.getTeacherName());
param.put("isOnline", model.getIsOnline());
param.put("termCode", model.getTermCode());
param.put("auditStatus", model.getAuditStatus());
return param;
}
......
......@@ -112,10 +112,10 @@ public class BStudentController extends PaginationController<BStudent> {
@ApiOperation(value="根据条件分页查询", notes="根据开课编号分页查询学生信息")
@ApiImplicitParams({@ApiImplicitParam(name = "slCode", value = "开课编号", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "className", value = "班级名称", required = false, dataType = "varchar")})
@ApiImplicitParam(name = "classCode", value = "班级编号", required = false, dataType = "varchar")})
@GetMapping(value = "/queryStudentBySlCode")
public GridModel queryStudentBySlCode(String slCode, String className) {
List<BStudent> bStudents = bStudentService.queryStudentBySlByPagination(getPaginationUtility(),slCode,className);
public GridModel queryStudentBySlCode(String slCode, String classCode) {
List<BStudent> bStudents = bStudentService.queryStudentBySlByPagination(getPaginationUtility(),slCode,classCode);
GridModel gridModel = getGridModelResponse();
return gridModel;
}
......
......@@ -71,12 +71,12 @@ public interface BStudentRepository extends BaseMapper<BStudent> {
"LEFT JOIN b_class t6 on t6.code = t5.class_code " +
"WHERE\n" +
"\tt2.sl_code = #{slCode}" +
"<if test=\"className!=null and className != ''\">\n" +
" AND t6.class_name LIKE CONCAT('%',#{className},'%')\n" +
"<if test=\"classCode!=null and classCode != ''\">\n" +
" AND t6.code = #{classCode}\n" +
"</if>" +
"order by className asc,code asc</script>")
@ResultMap(value = "BaseResultMap" )
List<BStudent> queryStudentBySlCode(@Param("slCode") String slCode, @Param("className") String className);
List<BStudent> queryStudentBySlCode(@Param("slCode") String slCode, @Param("classCode") String classCode);
@Insert("<script>INSERT INTO b_student" +
"(create_date,update_date,create_by,update_by,remarks,del_flag,flag,business_id,code)VALUES" +
......
......@@ -70,7 +70,7 @@ public interface BStudentService{
* @param code
* @return
*/
List<BStudent> queryStudentBySlByPagination(PageUtil pageUtil, String code, String className);
List<BStudent> queryStudentBySlByPagination(PageUtil pageUtil, String code, String classCode);
/**
* 获取推荐学生
......
......@@ -266,8 +266,8 @@ public class BStudentServiceImpl implements BStudentService {
}
@Override
public List<BStudent> queryStudentBySlByPagination(PageUtil pageUtil, String code, String className) {
return bStudentRepository.queryStudentBySlCode(code,className);
public List<BStudent> queryStudentBySlByPagination(PageUtil pageUtil, String code, String classCode) {
return bStudentRepository.queryStudentBySlCode(code,classCode);
}
@Override
......
......@@ -14,6 +14,7 @@ import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.converter.BTermDTO2BTermConverter;
import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.model.SelectModel;
import org.rcisoft.core.result.Result;
import org.rcisoft.core.result.ResultCode;
import org.rcisoft.core.result.ResultServiceEnums;
......@@ -25,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import javax.validation.Valid;
import java.util.List;
/**
* Created by CodeGenerator on 2017/07/12.
......@@ -133,4 +135,15 @@ public class BTermController extends PaginationController<BTerm> {
MessageConstant.MESSAGE_ALERT_ERROR,
code);
}
@ApiOperation(value="查询班级列表", notes="查询班级列表赋值在下拉框中")
@GetMapping(value = "/queryBTermList")
public Result queryBTermList() {
List<SelectModel> bTerm = bTermService.queryBTermList();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bTerm);
}
}
......@@ -34,6 +34,10 @@ public interface BTermRepository extends BaseMapper<BTerm> {
@ResultMap(value = "BaseResultMap" )
List<BTerm> queryBtermByCode(String code);
@Select("<script>select * from b_term where del_flag != 1 and flag = 1</script>")
@ResultMap(value = "BaseResultMap" )
List<BTerm> queryBTermList();
/*
这里可以不写,因为这个写的是 导入excel文件格式的时候的 插入,不是正常单个插入
......
......@@ -4,6 +4,7 @@ package org.rcisoft.business.bterm.service;
import org.rcisoft.business.bterm.entity.BTerm;
import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.model.SelectModel;
import java.util.List;
......@@ -54,4 +55,5 @@ public interface BTermService{
*/
PersistModel changeIS(String code, String token);
List<SelectModel> queryBTermList();
}
package org.rcisoft.business.bterm.service.impl;
import org.rcisoft.business.bclass.entity.BClass;
import org.rcisoft.business.bsl.dao.BSlRepository;
import org.rcisoft.business.bterm.dao.BTermRepository;
import org.rcisoft.business.bterm.entity.BTerm;
......@@ -9,6 +10,7 @@ import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.model.SelectModel;
import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.core.util.UserUtil;
import org.springframework.stereotype.Service;
......@@ -16,6 +18,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -107,4 +110,17 @@ public class BTermServiceImpl implements BTermService {
}
}
@Override
public List<SelectModel> queryBTermList() {
List<BTerm> bTerm = bTermRepository.queryBTermList();
ArrayList<SelectModel> comBoxModel = new ArrayList<SelectModel>();
for(BTerm c : bTerm){
SelectModel selectModel = new SelectModel();
selectModel.setId(c.getCode());
selectModel.setText(c.getName());
comBoxModel.add(selectModel);
}
return comBoxModel;
}
}
......@@ -79,7 +79,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/auth/**").permitAll() //登录注册等请求过滤
.antMatchers("/code/**").permitAll() //登录注册等请求过滤
.antMatchers("/excelUtil/**").permitAll()//excel类
.antMatchers("/**WithoutAuth").permitAll()
.antMatchers("/**/**WithoutAuth").permitAll()
.antMatchers(
"/",
"/*.html",
......
package org.rcisoft.core.model;
import lombok.Data;
/**
* Created by Administrator on 2017/12/21.
*/
@Data
public class SelectModel {
private String id;
private String text;
}
......@@ -125,6 +125,8 @@ public enum ResultServiceEnums {
STUDENT_HAS_NOT_SL(69,"该学生并未选择这门课程,不能开始实验"),
DIRECTION_IS_USED(70,"该方向已被课程关联,删除失败"),
CHAPTER_IS_USED(71,"该课程已发布,不能编辑或删除"),
;
private Integer code;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.rcisoft.business.bopinion.dao.BOpinionRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.bopinion.entity.BOpinion">
<id column="business_id" jdbcType="VARCHAR" property="businessId"/>
<result column="opinion" jdbcType="VARCHAR" property="opinion"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="sl_id" jdbcType="VARCHAR" property="slId"/>
</resultMap>
</mapper>
\ No newline at end of file
......@@ -25,5 +25,6 @@
<result column="sl_notes" jdbcType="LONGVARCHAR" property="slNotes"/>
<result column="class_hour" jdbcType="VARCHAR" property="classHour"/>
<result column="credits" jdbcType="VARCHAR" property="credits"/>
<result column="audit_status" jdbcType="VARCHAR" property="auditStatus"/>
</resultMap>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment