commit
This commit is contained in:
+47
@@ -1,12 +1,20 @@
|
|||||||
package com.budwk.app.zhgh.staffmanage.member.param.pageform;
|
package com.budwk.app.zhgh.staffmanage.member.param.pageform;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.budwk.app.base.constant.RoleConstant;
|
||||||
import com.budwk.app.base.param.PageForm;
|
import com.budwk.app.base.param.PageForm;
|
||||||
|
import com.budwk.app.base.utils.PageUtil;
|
||||||
|
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||||
|
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.nutz.dao.Cnd;
|
||||||
|
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
@@ -79,4 +87,43 @@ public class MemberInfoPageForm extends PageForm {
|
|||||||
|
|
||||||
@ApiModelProperty("工号结尾")
|
@ApiModelProperty("工号结尾")
|
||||||
private String endLoginNames;
|
private String endLoginNames;
|
||||||
|
|
||||||
|
@ApiModelProperty("导出的数据")
|
||||||
|
private List<Map<String, String>> columns;
|
||||||
|
|
||||||
|
public void buildSearch(Cnd cnd, String prefix){
|
||||||
|
if (cnd == null) {
|
||||||
|
cnd = Cnd.NEW();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isNotBlank(this.getSearchKeyword())) {
|
||||||
|
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||||
|
seg.orLike(prefix + "username", this.getSearchKeyword());
|
||||||
|
seg.orLike(prefix + "loginname", this.getSearchKeyword());
|
||||||
|
cnd.and(seg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 权限判断
|
||||||
|
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||||
|
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||||
|
seg.or(prefix + "unionId", "=", SecurityUtil.getUnionId());
|
||||||
|
seg.or(prefix + "unionId", "is", null);
|
||||||
|
seg.or(prefix + "unionId", "=", "");
|
||||||
|
cnd.and(seg);
|
||||||
|
} else {
|
||||||
|
cnd.andEX(prefix + "unionId", "=", this.getUnionId());
|
||||||
|
}
|
||||||
|
|
||||||
|
cnd.andEX(prefix + "unitId", "=", this.getUnitId());
|
||||||
|
cnd.andEX(prefix + "userState", "in", this.getUserStates());
|
||||||
|
cnd.andEX(prefix + "preparedBy", "in", this.getPreparedBys());
|
||||||
|
cnd.andEX(prefix + "personType", "in", this.getPersonTypes());
|
||||||
|
|
||||||
|
if(StrUtil.isAllBlank(this.getPageOrderName(),this.getPageOrderBy())){
|
||||||
|
cnd.asc("unionCode").asc("unitCode");
|
||||||
|
}else{
|
||||||
|
cnd.orderBy(this.getPageOrderName(), PageUtil.getOrder(this.getPageOrderBy()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user