fix:图库分类及共享查询等.

develop
wangyi 2 weeks ago
parent bf86bf69b1
commit 9b0bbfe01f

@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.bs.common.utils.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@ -177,6 +178,11 @@ public class CtGalleryCataController extends BaseController {
queryWrapper.eq(CtGalleryCata::getType,ctGalleryCata.getType());
}
// 查询私人目录
if ("private".equals(ctGalleryCata.getType())) {
queryWrapper.eq(CtGalleryCata::getCreateBy, SecurityUtils.getUserId());
}
//备注
if(Validator.isNotEmpty(ctGalleryCata.getRemarks())){
queryWrapper.eq(CtGalleryCata::getRemarks,ctGalleryCata.getRemarks());

@ -236,9 +236,11 @@ public class CtGalleryCataShareController extends BaseController {
private void condition (LambdaQueryWrapper<CtGalleryCataShare> queryWrapper,CtGalleryCataShare ctGalleryCataShare){
queryWrapper.orderByAsc(CtGalleryCataShare::getType);
if ("mine".equals(ctGalleryCataShare.getQueryType())) {
// 查询自己共享给别人的数据
queryWrapper.eq(CtGalleryCataShare::getCreateBy, SecurityUtils.getUserId());
} else if ("other".equals(ctGalleryCataShare.getQueryType())) {
queryWrapper.inSql(CtGalleryCataShare::getId, "select share_id from ct_gallery_share_user where del_flag = 0 and ( (user_type = 'user' and user_id = " + SecurityUtils.getUserId() +") or (user_type = 'dept' and user_id = " + SecurityUtils.getDeptId() + "))");
// 查询他人共享给本用户的数据
queryWrapper.inSql(CtGalleryCataShare::getId, "select share_id from ct_gallery_share_user where del_flag = 0 and ( (user_type = 'user' and user_id = " + SecurityUtils.getUserId() +") or (user_type = 'dept' and user_id = " + SecurityUtils.getDeptId() + ") and ifnull(end_date,date(sysdate())) >= date(sysdate()) )");
}
//id

Loading…
Cancel
Save