Antiloveg 8 years ago
parent
commit
a789aa20c4

+ 16 - 4
src/main/java/com/goafanti/common/mapper/OrganizationIdentityMapper.xml

@@ -1175,10 +1175,16 @@
 				AND u.lvl = 0
 			</if>
 			<if test="province != null">
-				AND ui.licence_province = #{province,jdbcType=INTEGER}
+				AND oi.licence_province = #{province,jdbcType=INTEGER}
+			</if>
+			<if test="city != null">
+				AND oi.licence_city = #{city,jdbcType=INTEGER}
+			</if>
+			<if test="area != null">
+				AND oi.licence_area = #{area,jdbcType=INTEGER}
 			</if>
 			<if test="field != null">
-				AND ui.field like CONCAT(#{field,jdbcType=VARCHAR}, '%')
+				AND oi.field like CONCAT(#{field,jdbcType=VARCHAR}, '%')
 			</if>
 		) x
 		LEFT JOIN achievement a ON a.owner_id = x.uid AND a.release_status = 1
@@ -1213,10 +1219,16 @@
 				AND u.lvl = 0
 			</if>
 			<if test="province != null">
-				AND ui.licence_province = #{province,jdbcType=INTEGER}
+				AND oi.licence_province = #{province,jdbcType=INTEGER}
+			</if>
+			<if test="city != null">
+				AND oi.licence_city = #{city,jdbcType=INTEGER}
+			</if>
+			<if test="area != null">
+				AND oi.licence_area = #{area,jdbcType=INTEGER}
 			</if>
 			<if test="field != null">
-				AND ui.field like CONCAT(#{field,jdbcType=VARCHAR}, '%')
+				AND oi.field like CONCAT(#{field,jdbcType=VARCHAR}, '%')
 			</if>
 		) x
 		LEFT JOIN achievement a ON a.owner_id = x.uid AND a.release_status = 1

+ 12 - 0
src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml

@@ -419,6 +419,12 @@
 		<if test="province != null">
 			AND ui.province = #{province,jdbcType=INTEGER}
 		</if>
+		<if test="city != null">
+			AND ui.city = #{city,jdbcType=INTEGER}
+		</if>
+		<if test="area != null">
+			AND ui.area = #{area,jdbcType=INTEGER}
+		</if>
 		<if test="field != null">
 			AND uc.engaged_field like CONCAT(#{field,jdbcType=VARCHAR}, '%')
 		</if>
@@ -457,6 +463,12 @@
 			<if test="province != null">
 				AND ui.province = #{province,jdbcType=INTEGER}
 			</if>
+			<if test="city != null">
+				AND ui.city = #{city,jdbcType=INTEGER}
+			</if>
+			<if test="area != null">
+				AND ui.area = #{area,jdbcType=INTEGER}
+			</if>
 			<if test="field != null">
 				AND uc.engaged_field like CONCAT(#{field,jdbcType=VARCHAR}, '%')
 			</if>

+ 15 - 13
src/main/java/com/goafanti/portal/controller/PortalSearchApiController.java

@@ -23,13 +23,13 @@ import com.goafanti.user.service.UserIdentityService;
 @RequestMapping(value = "/portal/search")
 public class PortalSearchApiController extends BaseApiController {
 	@Resource
-	private AchievementService	achievementService;
+	private AchievementService			achievementService;
 	@Resource
-	private DemandService		demandService;
+	private DemandService				demandService;
 	@Resource
-	private UserIdentityService	userIdentityService;
+	private UserIdentityService			userIdentityService;
 	@Resource
-	private OrganizationIdentityService organizationIdentityService;
+	private OrganizationIdentityService	organizationIdentityService;
 
 	/**
 	 * 科技成果搜索
@@ -77,19 +77,21 @@ public class PortalSearchApiController extends BaseApiController {
 	 * 用户搜索
 	 */
 	@RequestMapping(value = "/subscriberList", method = RequestMethod.GET)
-	public Result subscriberSearchList(Integer level, Integer type, String field, Integer province,String pageNo, String pageSize) {
+	public Result subscriberSearchList(Integer level, Integer type, String field, Integer province, Integer city,
+			Integer area, String pageNo, String pageSize) {
 		Result res = new Result();
-		if (null == type){
+		if (null == type) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "用户类型"));
 			return res;
 		}
-		
-		if (!UserType.PERSONAL.getCode().equals(type) && !UserType.ORGANIZATION.getCode().equals(type)){
+
+		if (!UserType.PERSONAL.getCode().equals(type) && !UserType.ORGANIZATION.getCode().equals(type)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户类型"));
 			return res;
 		}
-		
-		if (null != level && !UserLevel.GENERAL.getCode().equals(level) && !UserLevel.CERTIFIED.getCode().equals(level)){
+
+		if (null != level && !UserLevel.GENERAL.getCode().equals(level)
+				&& !UserLevel.CERTIFIED.getCode().equals(level)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户认证标记"));
 			return res;
 		}
@@ -101,10 +103,10 @@ public class PortalSearchApiController extends BaseApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		if (UserType.PERSONAL.getCode().equals(type)){
-			res.setData(userIdentityService.listSubscriber(level, field, province, pNo, pSize));
+		if (UserType.PERSONAL.getCode().equals(type)) {
+			res.setData(userIdentityService.listSubscriber(level, field, province, city, area, pNo, pSize));
 		} else {
-			res.setData(organizationIdentityService.listSubscriber(level, field, province, pNo, pSize));
+			res.setData(organizationIdentityService.listSubscriber(level, field, province, city, area, pNo, pSize));
 		}
 		return res;
 	}

+ 2 - 5
src/main/java/com/goafanti/user/service/OrganizationIdentityService.java

@@ -44,10 +44,7 @@ public interface OrganizationIdentityService {
 
 	int updateOrgDetailByAuditAdmin(OrganizationIdentity oi, String aid, String mid, Integer level);
 
-	Pagination<OrgSubscriberListBo> listSubscriber(Integer level, String field, Integer province, Integer pNo, Integer pSize);
-
-
-
-	
+	Pagination<OrgSubscriberListBo> listSubscriber(Integer level, String field, Integer province, Integer city,
+			Integer area, Integer pNo, Integer pSize);
 
 }

+ 3 - 4
src/main/java/com/goafanti/user/service/UserIdentityService.java

@@ -19,7 +19,7 @@ public interface UserIdentityService {
 
 	int updateByPrimaryKey(UserIdentity u);
 
-	int  saveUserIdentityProcess(Result res, UserIdentity u, String uid);
+	int saveUserIdentityProcess(Result res, UserIdentity u, String uid);
 
 	int updateUserDetail(UserIdentity userIdentity, String saveSign, Integer level);
 
@@ -29,8 +29,7 @@ public interface UserIdentityService {
 
 	int updateUserDetailByAuditAdmin(UserIdentity ui, String aid, String mid, Integer level);
 
-	Pagination<UserSubscriberListBo> listSubscriber(Integer level, String field, Integer province, Integer pNo, Integer pSize);
-
-
+	Pagination<UserSubscriberListBo> listSubscriber(Integer level, String field, Integer province, Integer city,
+			Integer area, Integer pNo, Integer pSize);
 
 }

+ 16 - 11
src/main/java/com/goafanti/user/service/impl/OrganizationIdentityServiceImpl.java

@@ -166,7 +166,7 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 		userMapper.updateByPrimaryKeySelective(user);
 		if (CertifySubmitType.SUBMIT.getCode().equals(saveSign)) {
 			createAuditorNotice(user);
-		} 
+		}
 		return organizationIdentityMapper.updateByPrimaryKeySelective(orgIdentity);
 
 	}
@@ -226,10 +226,11 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 	public AuditorOrgIdentityDetailBo selectAuditorOrgIdentityDetailByUserId(String uid) {
 		return organizationIdentityMapper.selectAuditorOrgIdentityDetailByUserId(uid);
 	}
-	
+
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<OrgSubscriberListBo> listSubscriber(Integer level, String field, Integer province, Integer pNo, Integer pSize) {
+	public Pagination<OrgSubscriberListBo> listSubscriber(Integer level, String field, Integer province, Integer city,
+			Integer area, Integer pNo, Integer pSize) {
 		Map<String, Object> params = new HashMap<>();
 
 		if (null != level) {
@@ -243,6 +244,16 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 		if (null != province) {
 			params.put("province", province);
 		}
+		
+		if (null != city) {
+			params.put("city", city);
+		}
+		
+		if (null != area) {
+			params.put("area", area);
+		}
+		
+		
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
 		}
@@ -250,13 +261,9 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 		if (pSize == null || pSize < 0 || pSize > 10) {
 			pSize = 10;
 		}
-		return (Pagination<OrgSubscriberListBo>) findPage("findSearchSubscriberListByPage",
-				"findSearchSubscriberCount", params, pNo, pSize);
+		return (Pagination<OrgSubscriberListBo>) findPage("findSearchSubscriberListByPage", "findSearchSubscriberCount",
+				params, pNo, pSize);
 	}
-	
-	
-	
-	
 
 	// 给业务员及客户经理发送通知
 	private void createNotice(User u, Integer status) {
@@ -332,6 +339,4 @@ public class OrganizationIdentityServiceImpl extends BaseMybatisDao<Organization
 		noticeMapper.insert(n);
 	}
 
-	
-
 }

+ 11 - 2
src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

@@ -139,8 +139,8 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<UserSubscriberListBo> listSubscriber(Integer level, String field, Integer province, Integer pNo,
-			Integer pSize) {
+	public Pagination<UserSubscriberListBo> listSubscriber(Integer level, String field, Integer province, Integer city,
+			Integer area, Integer pNo, Integer pSize) {
 		Map<String, Object> params = new HashMap<>();
 
 		if (null != level) {
@@ -154,6 +154,15 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		if (null != province) {
 			params.put("province", province);
 		}
+		
+		if (null != city) {
+			params.put("city", city);
+		}
+		
+		if (null != area) {
+			params.put("area", area);
+		}
+		
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
 		}