Commit c9d18907 authored by root's avatar root

修改接口

parent 479754df
...@@ -308,13 +308,23 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -308,13 +308,23 @@ public class BLessonController extends PaginationController<BLesson> {
} }
// @ApiOperation(value="622 推荐课程", notes="根据ID推荐课程") @ApiOperation(value="622 推荐课程", notes="根据ID推荐课程")
// @PostMapping(value = "/recommend") @PostMapping(value = "/recommend")
// public Result recommend(CurUser curUser,@Valid RecommendLessonDTO recommendLessonDTO,BindingResult bindingResult) { public Result recommend(CurUser curUser,@Valid RecommendLessonDTO recommendLessonDTO,BindingResult bindingResult) {
// PersistModel data = bLessonService.recommendBLesson(curUser,recommendLessonDTO); PersistModel data = bLessonService.recommendBLesson(recommendLessonDTO);
// return Result.builder(data, return Result.builder(data,
// MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
// MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
// recommendLessonDTO); recommendLessonDTO);
// } }
@ApiOperation(value="623 指派课程", notes="根据ID指派课程")
@PostMapping(value = "/appointLessonToPerson")
public Result appointLessonToPerson(CurUser curUser,@Valid AppointLessonDTO appointLessonDTO,BindingResult bindingResult) {
PersistModel data = bLessonService.appointLessonToPerson(appointLessonDTO);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
appointLessonDTO);
}
} }
...@@ -79,12 +79,12 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -79,12 +79,12 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
" blp.finish_date finishDate " + " blp.finish_date finishDate " +
"from b_lesson_person blp left join b_lesson bl on blp.lesson_id = bl.business_id " + "from b_lesson_person blp left join b_lesson bl on blp.lesson_id = bl.business_id " +
"left join s_user su on blp.person_id = su.business_id " + "left join s_user su on blp.person_id = su.business_id " +
// "left join b_appoint ba on ba.business_id = ifnull(blp.appoint_id,'null') " + "left join b_appoint ba on ba.business_id = blp.appoint_id " +
"left join b_appoint ba on ba.lesson_id = bl.business_id " + "and ba.del_flag != 1 and ba.flag = 1 " +
// "left join b_appoint ba on ba.lesson_id = bl.business_id " +
"where blp.del_flag != 1 and blp.flag = 1 " + "where blp.del_flag != 1 and blp.flag = 1 " +
"and bl.del_flag != 1 and bl.flag = 1 " + "and bl.del_flag != 1 and bl.flag = 1 " +
"and su.del_flag != 1 and su.flag = 1 " + "and su.del_flag != 1 and su.flag = 1 " +
"and ba.del_flag != 1 and ba.flag = 1 " +
"and bl.corp_id = #{param.corpId} "+ "and bl.corp_id = #{param.corpId} "+
// "and blp.corp_id = #{param.corpId} "+ // "and blp.corp_id = #{param.corpId} "+
......
package org.rcisoft.business.blesson.dao; package org.rcisoft.business.blesson.dao;
import org.apache.ibatis.annotations.*;
import org.rcisoft.business.blesson.entity.BRecommend; import org.rcisoft.business.blesson.entity.BRecommend;
import org.rcisoft.business.blesson.entity.BRecommendSon;
import org.rcisoft.core.base.BaseMapper; import org.rcisoft.core.base.BaseMapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -15,15 +15,45 @@ import java.util.List; ...@@ -15,15 +15,45 @@ import java.util.List;
@Repository @Repository
public interface BRecommendRepository extends BaseMapper<BRecommend> { public interface BRecommendRepository extends BaseMapper<BRecommend> {
// /** /**
// * 分页查询 bRecommend * 分页查询 bRecommend
// * *
// */ */
// @Select("<script>select * from b_recommend where 1=1 " @Select("<script>select * from b_recommend where 1=1 "
// + "<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> " + "<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
// + "<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> " + "<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
// + "</script>") + "</script>")
// @ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
// List<BRecommend> queryBRecommends(BRecommend bRecommend); List<BRecommend> queryBRecommends(BRecommend bRecommend);
@Update({"<script>",
" update b_recommend",
" <set>",
" <if test='updateBy != null'>update_by=#{updateBy},</if> ",
" <if test='updateDate != null'>update_date=#{updateDate},</if> ",
" <if test='delFlag != null'>del_flag=#{delFlag},</if> ",
" <if test='flag != null'>flag=#{flag},</if> ",
" <if test='remarks != null'>remarks=#{remarks},</if> ",
" <if test='recommend_person != null'>recommend_person=#{recommendPerson},</if> ",
" <if test='lesson_id != null'>lesson_id=#{lessonId},</if> ",
" <if test='type != null'>type=#{type},</if> ",
" <if test='corp_id != null'>corp_id=#{corp_id},</if> ",
" </set>",
" where lesson_id=#{lessonId} ",
"</script>"})
int updateByLessonId(BRecommend bRecommend);
@Delete("<script>DELETE from b_recommend_son where recommend_id=#{businessId}</script>")
int deleteRecommendSon(BRecommend bRecommend);
@Select("<script>select business_id from b_recommend where lesson_id = #{lessonId}</script>")
List<String> selectIdByLessonId(String lessonId);
@Insert("<script>INSERT INTO b_recommend_son" +
"(business_id,recommend_id,type,target_id)VALUES" +
"<foreach collection=\"list\" item=\"item\" separator=\",\">" +
"(#{item.businessId},#{item.recommendId},#{item.type},#{item.targetId})" +
"</foreach></script>")
int insertBRecommendSons(List<BRecommendSon> bRecommendSons);
} }
...@@ -27,14 +27,16 @@ public interface BViewrangeRepository extends BaseMapper<BViewrange> { ...@@ -27,14 +27,16 @@ public interface BViewrangeRepository extends BaseMapper<BViewrange> {
List<BViewrange> queryBViewranges(BViewrange bViewrange); List<BViewrange> queryBViewranges(BViewrange bViewrange);
@Update({"<script>", @Update({"<script>",
"update b_banner", "update b_viewrange",
" <set>", " <set>",
" <if test='updateBy != null'>update_by=#{updateBy},</if>", " <if test='updateBy != null'>update_by=#{updateBy},</if> ",
" <if test='updateDate != null'>update_date=#{updateDate},</if>", " <if test='updateDate != null'>update_date=#{updateDate},</if> ",
" <if test='delFlag != null'>del_flag=#{delFlag},</if>", " <if test='delFlag != null'>del_flag=#{delFlag},</if> ",
" <if test='flag != null'>flag=#{flag},</if>", " <if test='flag != null'>flag=#{flag},</if> ",
" <if test='remarks != null'>remarks=#{remarks},</if>", " <if test='remarks != null'>remarks=#{remarks},</if> ",
" <if test='type != null'>title=#{type},</if>", " <if test='lesson_id != null'>lesson_id=#{lessonId},</if> ",
" <if test='type != null'>type=#{type},</if> ",
" <if test='corp_id != null'>corp_id=#{corp_id},</if> ",
" </set>", " </set>",
"where lesson_id=#{lessonId}", "where lesson_id=#{lessonId}",
"</script>"}) "</script>"})
......
package org.rcisoft.business.blesson.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class AppointLessonDTO {
@ApiModelProperty(value = "课程Id",required = true)
private String lessonId;
@ApiModelProperty(value = "推荐范围(人)多人之间用','隔开" ,required = true)
private String appointPerson;
private String userId;
private String corpId;
}
...@@ -6,7 +6,7 @@ import lombok.Data; ...@@ -6,7 +6,7 @@ import lombok.Data;
@Data @Data
public class RecommendLessonDTO { public class RecommendLessonDTO {
@ApiModelProperty(value = "课程Id") @ApiModelProperty(value = "课程Id",required = true)
private String lessonId; private String lessonId;
@ApiModelProperty(value = "推荐范围(人)多人之间用','隔开") @ApiModelProperty(value = "推荐范围(人)多人之间用','隔开")
...@@ -14,4 +14,8 @@ public class RecommendLessonDTO { ...@@ -14,4 +14,8 @@ public class RecommendLessonDTO {
@ApiModelProperty(value = "推荐范围(部门)多人之间用','隔开") @ApiModelProperty(value = "推荐范围(部门)多人之间用','隔开")
private String recommendDepart; private String recommendDepart;
private String userId;
private String corpId;
} }
...@@ -47,7 +47,7 @@ public class BLesson extends IdEntity<BLesson> { ...@@ -47,7 +47,7 @@ public class BLesson extends IdEntity<BLesson> {
private String defaultUrl; private String defaultUrl;
@ApiModelProperty(value = "课时") @ApiModelProperty(value = "课时")
@Length(min = 1,max = 8,message = "长度最小为1,最大为5") // @Length(min = 1,max = 8,message = "长度最小为1,最大为5")
private String classHour; private String classHour;
@ApiModelProperty(value = "讲师id") @ApiModelProperty(value = "讲师id")
......
...@@ -116,7 +116,14 @@ public interface BLessonService{ ...@@ -116,7 +116,14 @@ public interface BLessonService{
* @param recommendLessonDTO * @param recommendLessonDTO
* @return * @return
*/ */
PersistModel recommendBLesson(CurUser curUser,RecommendLessonDTO recommendLessonDTO); PersistModel recommendBLesson(RecommendLessonDTO recommendLessonDTO);
/**
* 指派课程
* @param appointLessonDTO
* @return
*/
PersistModel appointLessonToPerson(AppointLessonDTO appointLessonDTO);
/** /**
* 课程培训条件查询 * 课程培训条件查询
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<result column="collect_number" jdbcType="VARCHAR" property="collectNumber"/> <result column="collect_number" jdbcType="VARCHAR" property="collectNumber"/>
<result column="hot_number" jdbcType="VARCHAR" property="hotNumber"/> <result column="hot_number" jdbcType="VARCHAR" property="hotNumber"/>
<result column="value" jdbcType="VARCHAR" property="value"/> <result column="value" jdbcType="VARCHAR" property="value"/>
<collection property="labelList" ofType="org.rcisoft.business.blesson.entity.BLesson" <collection property="labelList" ofType="org.rcisoft.business.blabel.dto.QueryLabelResDTO"
javaType="java.util.ArrayList" select="org.rcisoft.business.blesson.dao.BLessonRepository.queryLabelByLessonId" javaType="java.util.ArrayList" select="org.rcisoft.business.blesson.dao.BLessonRepository.queryLabelByLessonId"
column="business_id"> column="business_id">
</collection> </collection>
......
<?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.blesson.dao.BRecommendRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.blesson.entity.BRecommend">
<id column="business_id" jdbcType="VARCHAR" property="businessId"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="del_flag" jdbcType="VARCHAR" property="delFlag"/>
<result column="flag" jdbcType="VARCHAR" property="flag"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="recommend_person" jdbcType="VARCHAR" property="recommendPerson"/>
<result column="lesson_id" jdbcType="VARCHAR" property="lessonId"/>
<result column="type" jdbcType="VARCHAR" property="type"/>
<result column="corp_id" jdbcType="VARCHAR" property="corpId"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<result column="remarks" jdbcType="VARCHAR" property="remarks"/> <result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="lesson_id" jdbcType="VARCHAR" property="lessonId"/> <result column="lesson_id" jdbcType="VARCHAR" property="lessonId"/>
<result column="type" jdbcType="VARCHAR" property="type"/> <result column="type" jdbcType="VARCHAR" property="type"/>
<result column="corp_id" jdbcType="VARCHAR" property="corpId"/>
</resultMap> </resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
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