Commit 970c5753 authored by zhangqingle's avatar zhangqingle

增加手机组织架构回显account 增加修改保存文件失败BUG

parent ced07f9e
......@@ -67,7 +67,7 @@ public interface BViewrangeRepository extends BaseMapper<BViewrange> {
List<BViewRangeSonDTO> selectDepartByLessonId(@Param("corpId") String corpId,@Param("lessonId")String lessonId);
@Select("<script>select bvs.viewrange_id viewrangeId,bvs.type type,bvs.target_id targetId,su.name targetName from b_viewrange_son bvs " +
@Select("<script>select bvs.viewrange_id viewrangeId,bvs.type type,bvs.target_id targetId,su.name targetName,su.account_id targetAccountId from b_viewrange_son bvs " +
" left join b_viewrange bv on bvs.viewrange_id = bv.business_id " +
" left join s_user su on bvs.target_id = su.business_id " +
......
......@@ -22,6 +22,9 @@ public class BViewRangeSonDTO {
@ApiModelProperty(value = "人/部门名")
private String targetName;
@ApiModelProperty(value = "人accountId")
private String targetAccountId;
private String sort;
......
......@@ -169,10 +169,10 @@ public class BLessonServiceImpl implements BLessonService {
List<FindDepartByNameDTO> departs = cotactApiRequestClient.deptListDeptInfoByName(curUser.getCorpId(), "");
//查询该课程推荐的所有人
//查询该课程可见范围的所有人
List<BViewRangeSonDTO> selectPersonByLessonIds = bViewrangeRepository.selectPersonByLessonId(curUser.getCorpId(), lessonId);
bLesson.setViewRangePersonList(selectPersonByLessonIds);
//查询该课程推荐的所有部门
//查询该课程可见范围的所有部门
List<BViewRangeSonDTO> selectDepartByLessonIds = bViewrangeRepository.selectDepartByLessonId(curUser.getCorpId(), lessonId);
if (selectDepartByLessonIds != null && selectDepartByLessonIds.size() > 0) {
for (FindDepartByNameDTO depart : departs) {
......@@ -195,12 +195,6 @@ public class BLessonServiceImpl implements BLessonService {
return bLesson;
}
// @Override
// @Transactional(propagation = Propagation.REQUIRED,readOnly = false)
// public BLesson selectOne(BLesson bLesson) {
// return bLessonRepository.selectOne(bLesson);
// }
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
@Override
public int updateByPrimaryKeySelective(BLesson bLesson) {
......
......@@ -39,7 +39,7 @@ public class BMaterialController extends PaginationController<BMaterial> {
@ApiOperation(value="1301 添加保存资料", notes="保存资料")
@PostMapping(value = "/add")
public Result add(CurUser curUser, @Valid BMaterial bMaterial, BindingResult bindingResult) {
PersistModel data = bMaterialServiceImpl.save(bMaterial);
PersistModel data = bMaterialServiceImpl.save(bMaterial,curUser);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
......
......@@ -114,12 +114,13 @@ public interface BMaterialRepository extends BaseMapper<BMaterial> {
@Select("<script>select * from b_material " +
" where 1=1 " +
" and del_flag != 1 and flag = 1 " +
" and create_by = #{curUser.userId} " +
" <if test=\"uploadType!=null and uploadType != ''\">and upload_type = #{uploadType}</if>" +
" and file_url in "+
"<foreach item='item' collection='urls' open='(' separator=',' close=')'> #{item} </foreach> " +
"</script>")
@ResultMap(value = "BaseResultMap" )
List<BMaterial> selectByUrl(@Param("urls") List<String> urls, @Param("uploadType") String uploadType);
List<BMaterial> selectByUrl(@Param("urls") List<String> urls, @Param("uploadType") String uploadType,@Param("curUser") CurUser curUser);
}
......@@ -18,7 +18,7 @@ public interface BMaterialService {
* @param bMaterial
* @return
*/
PersistModel save(BMaterial bMaterial);
PersistModel save(BMaterial bMaterial,CurUser curUser);
/**
* 逻辑删除
......
......@@ -47,13 +47,13 @@ public class BMaterialServiceImpl implements BMaterialService {
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public PersistModel save(BMaterial bMaterial){
public PersistModel save(BMaterial bMaterial,CurUser curUser){
if ( "0".equals(bMaterial.getFileSize())){
throw new ServiceException(ResultServiceEnums.FILE_NOT_NULL);
}
List<String> urls = new ArrayList<>();
urls.add(bMaterial.getFileUrl());
List<BMaterial> bMaterialList = bMaterialRepository.selectByUrl(urls,"0");
List<BMaterial> bMaterialList = bMaterialRepository.selectByUrl(urls,"0",curUser);
if (bMaterialList != null && bMaterialList.size() > 0){
throw new ServiceException(ResultServiceEnums.SAVED_THIS_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