Commit abe8ed99 authored by luzhuang's avatar luzhuang

Merge remote-tracking branch 'origin/meiteng' into meiteng

parents 4d06918d 47382c66
......@@ -270,7 +270,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")
@PostMapping(value = "/release")
public Result release(CurUser curUser,String businessId,BindingResult bindingResult) {
PersistModel data = bLessonService.closeBLesson(businessId);
PersistModel data = bLessonService.releaseBLesson(businessId);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
......
......@@ -351,6 +351,15 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
"where business_id=#{businessId}",
"</script>"})
int closeLesson(BLesson model);
/**
* 查询课程状态
* @param id
* @return
*/
@Select(" <script> select release_state from b_lesson where business_id = #{id} </script>")
int findLessonReleaseState(String id);
/**
* 根据课程id发布课程
*
......@@ -373,7 +382,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
* @param param
* @return
*/
@Select(" <script> select distinct bl.* " +
@Select(" <script> select bl.* " +
// " ,su.name lecturerName " +
// " ,suc.name createByName " +
" from b_lesson bl " +
......@@ -515,18 +524,18 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
"b_lesson les " +
"LEFT JOIN b_course b1 ON b1.business_id = les.course_id " +
"AND b1.corp_id = #{corpId} " +
"and b1.del_flag != 1 and b1.flag = 1 "+
"LEFT JOIN b_course b2 ON b2.business_id = b1.pid " +
"AND b2.corp_id = #{corpId} " +
"and b2.del_flag != 1 and b2.flag = 1 "+
"LEFT JOIN b_course b3 ON b3.business_id = b2.pid " +
"AND b3.corp_id = #{corpId} " +
"and b3.del_flag != 1 and b3.flag = 1 "+
"LEFT JOIN s_user u1 ON u1.business_id = les.lecturer_id " +
"AND u1.corp_id = #{corpId}" +
"and u1.del_flag != 1 and u1.flag = 1 "+
"WHERE 1=1 " +
"and les.del_flag != 1 and les.flag = 1 "+
"and b1.del_flag != 1 and b1.flag = 1 "+
"and b2.del_flag != 1 and b2.flag = 1 "+
"and b3.del_flag != 1 and b3.flag = 1 "+
"and u1.del_flag != 1 and u1.flag = 1 "+
"AND les.corp_id = #{corpId}" +
"<if test='!isAdmin'>" +
"AND les.lecturer_id IN" +
......
......@@ -17,7 +17,9 @@ import org.rcisoft.business.blesson.entity.BViewrange;
import org.rcisoft.business.blesson.entity.BViewrangeSon;
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.result.ResultExceptionEnum;
import org.rcisoft.core.util.IdGen;
import org.rcisoft.core.util.UserUtil;
import org.rcisoft.sys.user.bean.CurUser;
......@@ -240,6 +242,12 @@ public class BLessonServiceImpl implements BLessonService {
@Override
public PersistModel releaseBLesson(String id) {
int state = bLessonRepository.findLessonReleaseState(id);
if (state != 0){
throw new ServiceException(ResultExceptionEnum.STATE_NOT_RELEASE);
}
BLesson bLesson = new BLesson();
bLesson.setBusinessId(id);
UserUtil.setCurrentMergeOperation(bLesson);
......
......@@ -27,7 +27,8 @@ public enum ResultExceptionEnum {
NO_DATA(4011,"该数据不存在"),
MUST_NOT_FILLED(4012,"必填未填写"),
NOT_MORE_COUNT(4013,"添加超过规定个数"),
APPOINT_NOT_CLOSE(4014,"必修不能退出")
APPOINT_NOT_CLOSE(4014,"必修不能退出"),
STATE_NOT_RELEASE(4015,"该课程状态不能发布")
;
private Integer code;
......
......@@ -13,7 +13,7 @@ server:
# org.springframework.web: DEBUG
druid:
# url: jdbc:mysql://127.0.0.1:3306/new_edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
# url: jdbc:mysql://127.0.0.1:3306/edu_db2?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
url: jdbc:mysql://10.96.131.16:55558/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
#url: jdbc:mysql://120.52.179.75:13318/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
username: root
......
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