Procházet zdrojové kódy

查询用户接口修改

szjbdgzl před 2 roky
rodič
revize
e37d69017e

+ 8 - 0
ibps-common-root/modules/org-biz/src/main/java/com/lc/ibps/org/party/repository/PartyEmployeeRepository.java

@@ -23,6 +23,14 @@ public interface PartyEmployeeRepository extends IRepository<String, PartyEmploy
 	public void setQueryOrgPath();
 	
 	public void removeQueryOrgPath();
+
+
+	/**
+	 * 获取员工信息  根据岗位信息过滤 模糊查询
+	 * @param position
+	 * @return
+	 */
+	public List<PartyEmployeePo> getEmployeeByPosition(QueryFilter queryFilter);
 	
 	/**
 	 * 获取员工信息附带组织名称

+ 7 - 1
ibps-common-root/modules/org-biz/src/main/java/com/lc/ibps/org/party/repository/impl/PartyEmployeeRepositoryImpl.java

@@ -211,7 +211,13 @@ public class PartyEmployeeRepositoryImpl extends AbstractRepository<String, Part
         return findByKey("findByPosId", "findIdsByPosId", 
         		b().a("posId", "%" + posId + "%").p());
     }
-    
+
+	@Override
+	public List<PartyEmployeePo> getEmployeeByPosition(QueryFilter queryFilter) {
+		//return findByKey("findByPosition", "findIdsByPositionId", b().a("position", "%" + position + "%").p());
+		return queryByKey("findByPosition", "findIdsByPositionId", queryFilter);
+	}
+
     @Override
     public List<PartyEmployeeVo> loadEmployees(String sourceTenantId, List<String> accounts) {
     	List<PartyEmployeeVo> employees = new ArrayList<>();

+ 13 - 0
ibps-model-root/modules/org-model/src/main/java/com/lc/ibps/org/party/persistence/entity/PartyEmployeeTbl.java

@@ -74,6 +74,19 @@ public class PartyEmployeeTbl extends PartyEntityTbl{
 	@ApiModelProperty(value = "附件")
 	protected String fujIan;
 
+	@ApiModelProperty(value = "路径树")
+	protected String path;
+
+	@Override
+	public String getPath() {
+		return path;
+	}
+
+	@Override
+	public void setPath(String path) {
+		this.path = path;
+	}
+
 	public String getJob() {
 		return job;
 	}

+ 31 - 0
ibps-model-root/modules/org-model/src/main/resources/com/lc/ibps/org/party/persistence/mapping/PartyEmployee.map.xml

@@ -27,6 +27,7 @@
 		<result property="orgName" column="ORG_NAME_" jdbcType="VARCHAR"/>
 		<result property="account" column="ACCOUNT_" jdbcType="VARCHAR"/>
 		<result property="isSuper" column="IS_SUPER_" jdbcType="VARCHAR"/>
+		<result property="path" column="PATH_" jdbcType="VARCHAR"/>
 	</resultMap>
 
     <sql id="columns">
@@ -377,6 +378,36 @@
         (<include refid="queryUnderSql"/>) T
     </select>
 
+	<select id="findByPosition"  parameterType="java.util.Map" resultMap="PartyEmployee">
+		select <include refid="columns"/> from IBPS_PARTY_EMPLOYEE b
+	    where b.POSITIONS_ in
+		(
+		select id_ from ibps_party_entity
+		<where>
+			<if test="@o.Ognl@isNotEmpty(whereSql)">
+				AND ${whereSql}
+			</if>
+		</where>
+		<!--where PATH_ like #{position}-->
+		)
+		ORDER BY CREATE_TIME_ DESC
+	</select>
+
+	<select id="findIdsByPositionId"  parameterType="java.util.Map" resultMap="PartyEmployee">
+		select ID_ from IBPS_PARTY_EMPLOYEE b
+		where b.POSITIONS_ in
+		(
+		select id_ from ibps_party_entity
+		<where>
+			<if test="@o.Ognl@isNotEmpty(whereSql)">
+				AND ${whereSql}
+			</if>
+		</where>
+		<!--where PATH_ like #{position}-->
+		)
+		ORDER BY CREATE_TIME_ DESC
+	</select>
+
 	<select id="findByPosId"  parameterType="java.util.Map" resultMap="PartyEmployee">
 		SELECT <include refid="columns"/> FROM IBPS_PARTY_EMPLOYEE
 		left join

+ 2 - 1
ibps-provider-base-root/modules/provider-platform-api/src/main/java/com/lc/ibps/org/api/IPartyEmployeeService.java

@@ -59,7 +59,8 @@ public interface IPartyEmployeeService {
 	 */
 	@RequestMapping(value = "/query", method = RequestMethod.POST)
 	public APIResult<APIPageList<PartyEmployeePo>> query(
-			@RequestBody(required = true) APIRequest request);
+			@RequestBody(required = true) APIRequest request,
+			@RequestParam(name = "position", required = false) String position);
 	
 	/**
 	 * 

+ 1 - 1
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/wx/services/impl/wxServicesImpl.java

@@ -189,7 +189,7 @@ public class wxServicesImpl implements wxServices {
         request.addParameters("Q^NAME_^SL",map.get("name").toString());
         request.addParameters("Q^MOBILE_^SL",map.get("mobile").toString());
 
-        APIResult<APIPageList<PartyEmployeePo>> query = employeeServiceClient.query(request);
+        APIResult<APIPageList<PartyEmployeePo>> query = employeeServiceClient.query(request,"");
 
         List<PartyEmployeePo> result = query.getData().getDataResult();
         if (result==null || result.size()==0){ //未查询到数据

+ 14 - 10
ibps-provider-root/modules/provider-platform-default/src/main/java/com/lc/ibps/org/provider/PartyEmployeeProvider.java

@@ -9,6 +9,7 @@ import java.util.Map.Entry;
 
 import javax.annotation.Resource;
 
+import com.lc.ibps.cloud.entity.*;
 import com.lc.ibps.org.party.persistence.entity.*;
 import org.apache.bcel.generic.I2F;
 import org.apache.commons.lang3.StringUtils;
@@ -37,10 +38,6 @@ import com.lc.ibps.base.core.util.JacksonUtil;
 import com.lc.ibps.base.core.util.string.StringUtil;
 import com.lc.ibps.base.framework.id.UniqueIdUtil;
 import com.lc.ibps.base.framework.request.signature.annotation.Signature;
-import com.lc.ibps.cloud.entity.APIPageList;
-import com.lc.ibps.cloud.entity.APIRequest;
-import com.lc.ibps.cloud.entity.APIRequestParameter;
-import com.lc.ibps.cloud.entity.APIResult;
 import com.lc.ibps.cloud.oauth.constants.RedisKey;
 import com.lc.ibps.cloud.provider.GenericProvider;
 import com.lc.ibps.cloud.redis.config.AppConfig;
@@ -146,15 +143,22 @@ public class PartyEmployeeProvider extends GenericProvider implements IPartyEmpl
 	@ApiOperation(value = "员工列表", notes = "根据传入参数查询,并返回员工列表")
 	@Override
 	public APIResult<APIPageList<PartyEmployeePo>> query(
-			@ApiParam(name = "request", value = "传入查询请求json字符串", required = true) 
-			@RequestBody(required = true) APIRequest request) {
+			@ApiParam(name = "request", value = "传入查询请求json字符串", required = true)
+			@RequestBody(required = true) APIRequest request,
+			@RequestParam(name = "position", required = false) String position) {
 		APIResult<APIPageList<PartyEmployeePo>> result = new APIResult<>();
 		try {
+			List<PartyEmployeePo> list;
 			QueryFilter queryFilter = getQueryFilter(request);
-			handleParams("query", request, queryFilter);
-			partyEmployeeRepository.setQueryOrgPath();
-			List<PartyEmployeePo> list = partyEmployeeRepository.query(queryFilter);
-			partyEmployeeRepository.removeQueryOrgPath();
+			if (StringUtil.isNotEmpty(position)){
+				queryFilter.addFilter("PATH_", "%" + position + "%" , QueryOP.LIKE);
+				list = partyEmployeeRepository.getEmployeeByPosition(queryFilter);
+			}else {
+				handleParams("query", request, queryFilter);
+				partyEmployeeRepository.setQueryOrgPath();
+				list = partyEmployeeRepository.query(queryFilter);
+				partyEmployeeRepository.removeQueryOrgPath();
+			}
 			//List<PartyEmployeePo> data = partyEmployeeRepository.transferPoList(list);
 			//fillOrgName(data);
 			APIPageList<PartyEmployeePo> apiPageData = getAPIPageList(list);