Commit 5c2a5eb7 authored by 王淑君's avatar 王淑君

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

parents 124d4ccb 719b5c94
......@@ -43,7 +43,6 @@ public class BBanner extends IdEntity<BBanner> {
@ApiModelProperty(value = "是否为外部链接(0:否,1:是)")
private String isExternalLink;
@Length(min = 1,max = 256,message = "长度最小为1,最大为256")
@ApiModelProperty(value = "外部URL")
private String externalUrl;
......
......@@ -51,7 +51,7 @@ public class BBannerServiceImpl implements BBannerService {
if ("1".equals(model.getIsExternalLink()) && StringUtils.isEmpty(model.getExternalUrl()))
throw new ServiceException(ResultServiceEnums.JUMP_ADDRESS_NULL);
else if ("1".equals(model.getIsExternalLink()) && StringUtils.isNotBlank(model.getExternalUrl())){
String regex = "^([hH][tT]{2}[pP]:/*|[hH][tT]{2}[pP][sS]:/*|[fF][tT][pP]:/*)(([A-Za-z0-9-~]+).)+([A-Za-z0-9-~\\/])"; // +(\?{0,1}(([A-Za-z0-9-~]+\={0,1})([A-Za-z0-9-~]*)\&{0,1})*)$
String regex = "^([hH][tT]{2}[pP]:/*|[hH][tT]{2}[pP][sS]:/*|[fF][tT][pP]:/*)(([A-Za-z0-9-~]+).)+([A-Za-z0-9-~\\/])+(\\?{0,1}(([A-Za-z0-9-~]+\\={0,1})([A-Za-z0-9-~]*)\\&{0,1})*)$"; // +(\?{0,1}(([A-Za-z0-9-~]+\={0,1})([A-Za-z0-9-~]*)\&{0,1})*)$
Pattern pattern = Pattern.compile(regex);
if (!pattern.matcher(model.getExternalUrl()).matches()) {
......
......@@ -517,6 +517,9 @@ public class BChapterServiceImpl implements BChapterService {
@Override
public String changeFileToPdf(String chapterId) {
if (StringUtils.isEmpty(chapterId)){
return null;
}
//1. 获取文件信息
BFile bFile = bFileRepository.selectInfoByChapterId(chapterId);
return changeFile(bFile);
......@@ -524,11 +527,19 @@ public class BChapterServiceImpl implements BChapterService {
@Override
public String changeFileToPdfAtView(BFile bFile) {
if (StringUtils.isEmpty(bFile.getVideoUrl()) || StringUtils.isEmpty(bFile.getLessonId()) || StringUtils.isEmpty(bFile.getType())){
return null;
// throw new ServiceException(ResultServiceEnums.PARAM_NOT_NULL);
}
return changeFile(bFile);
}
@Override
public String getDownLoadUrl(BFile bFile) {
if (StringUtils.isEmpty(bFile.getVideoUrl()) || StringUtils.isEmpty(bFile.getLessonId())){
return null;
// throw new ServiceException(ResultServiceEnums.PARAM_NOT_NULL);
}
String name = bFile.getVideoUrl().substring(bFile.getVideoUrl().lastIndexOf("/") + 1);
String filePath = global.getBASE_UPLOAD_SERVER_LOCATION() + global.getCOURSE_LOCATION() + File.separator + bFile.getLessonId();
String returnBasePath = global.getRETURN_UPLOAD_SERVER_LOCATION() + global.getCOURSE_LOCATION() + File.separator + bFile.getLessonId();
......
......@@ -92,7 +92,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
Set<String> deptIds = new HashSet<>();
deptIds.add(studentTrackingDTO.getDepartId());
Set<String> deptSets = new HashSet<String>(deptIds);
Set<String> deptSets = new HashSet<>(deptIds);
List<String> datas = mtCotactApiRequestClient.getSubUserIdsByDeptIds(studentTrackingDTO.getCorpId(), deptSets);
// List<UserGetStudentTrackingRspDTO> datas = mtCotactApiRequestClient.allUserListByDeptAtStuTrack(studentTrackingDTO.getCorpId(),studentTrackingDTO.getDepartId());
if (datas != null && datas.size()>0){
......
......@@ -236,6 +236,7 @@ public enum ResultServiceEnums {
LESSON_NO_CHAPTER(136,"当前课程暂无章节,不能被发布"),
ROLE_IS_NULL(137,"当前未勾选角色,请勾选角色"),
ILLEGAL_URL(138,"网址不合法(http(s)://xxxx.xx)"),
PARAM_NOT_NULL(139,"参数不能为空"),
;
private Integer code;
......
......@@ -25,12 +25,13 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
"LEFT JOIN s_r_user_role AS ru ON su.business_id = ru.user_id " +
"LEFT JOIN tm_admin_role AS sr ON sr.r_id = ru.role_id " +
"WHERE su.del_flag = 0 " +
"and su.corp_id = #{corpId} " +
"<if test=\"name!=null and name != ''\"> and su.name like CONCAT('%',#{name},'%') </if>" +
"<if test=\"roleName!=null and roleName != ''\"> and sr.r_name = #{roleName}</if>" +
"<if test=\"dept!=null and dept != ''\"> and su.business_id in ( ${dept} )</if>" +
"<if test=\"userIds!=null and userIds.size() > 0 \"> " +
" and su.business_id in <foreach item='item' index='index' collection='userIds' open='(' separator=',' close=')'> #{item} </foreach>" +
"</if>" +
"<if test=\"flag!=null and flag != ''\"> and su.flag = #{flag}</if></script>")
@ResultMap(value = "BaseResultMap")
List<SysUser> queryUsers(QuerySysUserDTO dto);
......@@ -230,17 +231,17 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
" b_lesson_person blp left join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 AND blp.flag = 1 " +
" and bl.del_flag != 1 AND bl.flag = 1 " +
" and blp.is_finish = 2 " +
" and bl.release_state = 2 " +
// " and blp.is_finish = 2 " +
// " and bl.release_state = 2 " +
" and bl.lesson_type = 0 " +
" and blp.person_id = #{userId}) lessonCount, " +
" and bl.corp_id = #{corpId} " +
" and blp.person_id = #{userId} and blp.is_finish is not null) lessonCount, " +
" (select count(1) from " +
" b_lesson_person blp left join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 AND blp.flag = 1 " +
" and bl.del_flag != 1 AND bl.flag = 1 " +
" and bl.release_state = 2 " +
// " and bl.release_state = 2 " +
" and blp.train_is_sign = 0" +
" and blp.person_id = #{userId}) trainCount, " +
......
......@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.util.List;
@Data
public class QuerySysUserDTO {
......@@ -19,7 +21,10 @@ public class QuerySysUserDTO {
@ApiModelProperty(value = "企业id")
private String corpId;
@ApiModelProperty(value = "部门(暂时不用)")
@ApiModelProperty(value = "部门")
private String dept;
@ApiModelProperty(value = "部门下的人")
private List<String> userIds;
}
......@@ -81,15 +81,7 @@ public class SysUserServiceImpl implements SysUserService {
deptIds.add(dto.getDept());
Set<String> deptSets = new HashSet<String>(deptIds);
List<String> data = mtCotactApiRequestClient.getSubUserIdsByDeptIds(dto.getCorpId(), deptSets);
if(data != null ){
for (String uid : data) {
stringBuffer.append(uid+",");
}
if (!stringBuffer.toString().equals("")) {
ids = stringBuffer.toString().substring(0, stringBuffer.toString().length() - 1);
}
dto.setDept(ids);
}
dto.setUserIds(data);
}
//step2:先查出符合条件的所有人
List<SysUser> users = sysUserMapper.queryUsers(dto);
......
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