Commit cae017db authored by zhangqingle's avatar zhangqingle

修改接口

parent 83a1b71d
......@@ -18,8 +18,11 @@ public class AddOrUpdateDTO {
@ApiModelProperty(value = "外部URL",required = true, dataType = "varchar")
private String externalUrl;
@ApiModelProperty(value = "图标",required = true, dataType = "varchar")
private String logo;
@ApiModelProperty(value = "移动端图标",required = false, dataType = "varchar")
private String mobileLogo;
@ApiModelProperty(value = "客户端图标",required = false, dataType = "varchar")
private String computerLogo;
@ApiModelProperty(value = "备注",required = false, dataType = "varchar")
private String remarks;
......
......@@ -30,9 +30,13 @@ public class BExternalLink extends IdEntity<BExternalLink> {
@ApiModelProperty(value = "标题")
private String title;
@Length(min = 1,max = 64,message = "长度最小为1,最大为64")
@ApiModelProperty(value = "图标")
private String logo;
@ApiModelProperty(value = "移动端图标",required = false, dataType = "varchar")
private String mobileLogo;
@ApiModelProperty(value = "客户端图标",required = false, dataType = "varchar")
private String computerLogo;
@Length(min = 1,max = 64,message = "长度最小为1,最大为64")
@ApiModelProperty(value = "外部URL")
......
......@@ -67,8 +67,9 @@ public class BExternalLinkServiceImpl implements BExternalLinkService {
throw new ServiceException(ResultServiceEnums.ILLEGAL_URL);
}
}
//TODO
if (bExternalLink.getBusinessId() != null) {
//按ID查询Banner个数
//按ID查询外链个数
if (bExternalLinkRepository.selectCountById(bExternalLink.getBusinessId()) == 0){
throw new ServiceException(ResultServiceEnums.NO_DATA);
}
......@@ -76,12 +77,12 @@ public class BExternalLinkServiceImpl implements BExternalLinkService {
line = bExternalLinkRepository.updateByPrimaryKeySelective(bExternalLink);
} else {
UserUtil.setCurrentPersistOperation(bExternalLink);
//查询Banner是否大于等于10个,大于等于十个不允许添加
//查询外链是否大于等于10个,大于等于十个不允许添加
int countBanner = bExternalLinkRepository.selectCountExternalLink(bExternalLink.getCorpId());
if(countBanner >= 10){
throw new ServiceException(ResultServiceEnums.NOT_MORE_COUNT);
}
//查询最大排序值+1后放入Banner
//查询最大排序值+1后放入外链
int sort = bExternalLinkRepository.selectMaxSort();
bExternalLink.setSort(sort);
line = bExternalLinkRepository.insertSelective(bExternalLink);
......
......@@ -231,6 +231,8 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
return new PersistModel(line);
}
if (bLessonPersons == null || bLessonPersons.size() < 1){ //未指派
//TODO 判断用户是否有足够积分
//查询是否已有已删除
List<BLessonPerson> bLessonPersonReals = bLessonPersonRepository.selectRealByPersonAndLesson(addMyLearnLessonDTO);
if (bLessonPersonReals != null && bLessonPersonReals.size()>0){
......@@ -252,7 +254,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
bLessonPerson.setLessonId(addMyLearnLessonDTO.getLessonId());
bLessonPerson.setPersonId(addMyLearnLessonDTO.getUserId());
line = bLessonPersonRepository.insertBLessonPerson(bLessonPerson);
//扣除对应积分
//TODO 扣除对应积分 添加用户积分详情 更新用户积分
//重新统计在学人数
......
......@@ -526,6 +526,8 @@ public class BLessonServiceImpl implements BLessonService {
bLesson.setReleaseDate(new Date());
UserUtil.setCurrentMergeOperation(bLesson);
int line = bLessonRepository.releaseLesson(bLesson);
//TODO:查询该讲师发布课程获得积分数并
//TODO:增加用户积分详情,更新用户积分表,重新统计用户积分
//int line = bLessonRepository.deleteByPrimaryKey(id);
return new PersistModel(line, MessageConstant.MESSAGE_ALERT_SUCCESS);
}
......@@ -1072,7 +1074,9 @@ public class BLessonServiceImpl implements BLessonService {
person.setTrainIsSign("0");
person.setApplyDate(new Date());
person.setIsApply("1");
//TODO 判断积分是否够用
int line = bLessonPersonRepository.updateLessonPersonByUserId(person);
//TODO 更新用户积分明细表 重进计算积分
bLessonRepository.personNumberReCount(lessonId,"1");
return line;
}
......@@ -1081,7 +1085,9 @@ public class BLessonServiceImpl implements BLessonService {
person.setDelFlag("0");
person.setIsApply("1");
person.setApplyDate(new Date());
//TODO 判断积分是否够用
int line = bLessonPersonRepository.updateByPrimaryKeySelective(person);
//TODO 更新用户积分明细表 重进计算积分
bLessonRepository.personNumberReCount(lessonId,"1");
return line;
}
......@@ -1097,7 +1103,9 @@ public class BLessonServiceImpl implements BLessonService {
bLessonPersons.add(bLessonPerson);
//插入 用户id 、培训id、指派状态、报名状态、培训状态、报名时间 、通用字段
// int line = bLessonPersonRepository.insert(bLessonPerson);
//TODO 判断积分是否够用
int line = this.trainInsert("0",bLesson,bLessonPersons);
//TODO 更新用户积分明细表 重进计算积分
bLessonRepository.personNumberReCount(lessonId,"1");
return line;
......
......@@ -54,10 +54,10 @@ public interface BMaterialRepository extends BaseMapper<BMaterial> {
" and bm.create_by = #{param.userId} "+
"<if test= \" param.typeSort !=null and param.typeSort !='' and param.typeSort =='0'.toString()\"> ORDER BY bm.type DESC </if> "+
"<if test= \" param.typeSort !=null and param.typeSort !='' and param.typeSort =='1'.toString()\"> ORDER BY bm.type ASC </if> "+
"<if test= \" param.sizeSort !=null and param.sizeSort !='' and param.sizeSort =='0'.toString()\"> ORDER BY bm.file_size DESC </if> "+
"<if test= \" param.sizeSort !=null and param.sizeSort !='' and param.sizeSort =='1'.toString()\"> ORDER BY bm.file_size ASC </if> "+
"<if test= \" param.sourceSort !=null and param.sourceSort !='' and param.sourceSort =='0'.toString()\"> ORDER BY source DESC </if> "+
"<if test= \" param.sourceSort !=null and param.sourceSort !='' and param.sourceSort =='1'.toString()\"> ORDER BY source ASC </if> "+
"<if test= \" param.sizeSort !=null and param.sizeSort !='' and param.sizeSort =='0'.toString()\"> ORDER BY CAST(bm.file_size AS UNSIGNED) DESC </if> "+
"<if test= \" param.sizeSort !=null and param.sizeSort !='' and param.sizeSort =='1'.toString()\"> ORDER BY CAST(bm.file_size AS UNSIGNED) ASC </if> "+
"<if test= \" param.sourceSort !=null and param.sourceSort !='' and param.sourceSort =='0'.toString()\"> ORDER BY CAST(bl.lesson_type AS UNSIGNED) DESC </if> "+
"<if test= \" param.sourceSort !=null and param.sourceSort !='' and param.sourceSort =='1'.toString()\"> ORDER BY CAST(bl.lesson_type AS UNSIGNED) ASC </if> "+
"<if test= \" param.dateSort !=null and param.dateSort !='' and param.dateSort =='0'.toString()\"> ORDER BY bm.create_date DESC </if> "+
"<if test= \" param.dateSort !=null and param.dateSort !='' and param.dateSort =='1'.toString()\"> ORDER BY bm.create_date ASC </if> "+
"</script>")
......
......@@ -11,8 +11,9 @@
<result column="flag" jdbcType="VARCHAR" property="flag"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="logo" jdbcType="VARCHAR" property="logo"/>
<result column="external_url" jdbcType="VARCHAR" property="externalUrl"/>
<result column="mobile_logo" jdbcType="VARCHAR" property="mobileLogo"/>
<result column="computer_logo" jdbcType="VARCHAR" property="computerLogo"/>
<result column="external_url" jdbcType="VARCHAR" property="computerLogo"/>
<result column="type" jdbcType="VARCHAR" property="type"/>
<result column="sort" jdbcType="INTEGER" property="sort"/>
<result column="corp_id" jdbcType="VARCHAR" property="corpId"/>
......
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