Browse Source

APP开发

anderx 8 years ago
parent
commit
d39d625bb4

+ 12 - 0
src/main/java/com/goafanti/achievement/bo/AchievementUserOwnerDetailBo.java

@@ -15,6 +15,8 @@ public class AchievementUserOwnerDetailBo extends AchievementOrgOwnerDetailBo {
 	
 	private String field2;
 	
+	private String cityName;
+	
 	public String getField1() {
 		return field1;
 	}
@@ -73,6 +75,16 @@ public class AchievementUserOwnerDetailBo extends AchievementOrgOwnerDetailBo {
 		CountInterest = countInterest;
 	}
 
+	public String getCityName() {
+		return cityName;
+	}
+
+	public void setCityName(String cityName) {
+		this.cityName = cityName;
+	}
+
+	
+
 	
 
 

+ 1 - 1
src/main/java/com/goafanti/achievement/service/AchievementService.java

@@ -86,7 +86,7 @@ public interface AchievementService {
     /**查询智者的科技成果**/
     public List<AchievementPartnerListBo> findPartnerAchievementList(String uid);
 
-	Pagination<AchievementPartnerListBo> listAppUserAchievement(Integer auditStatus, Integer serialNumber, String name, String keyword,
+	Pagination<AchievementPartnerListBo> listAppUserAchievement(Integer auditStatus, Integer serialNumber, String name, String keyword,Integer dataCategory,
 			Integer category, Integer ownerType, Integer status, String releaseDateStartDate, String releaseDateEndDate,
 			Integer releaseStatus,String ownerId,Integer fieldA, Integer pNo, Integer pSize);
 	

+ 20 - 7
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -30,6 +30,7 @@ import com.goafanti.common.dao.AchievementDemandMapper;
 import com.goafanti.common.dao.AchievementKeywordMapper;
 import com.goafanti.common.dao.AchievementMapper;
 import com.goafanti.common.dao.DemandKeywordMapper;
+import com.goafanti.common.dao.DistrictGlossoryMapper;
 import com.goafanti.common.dao.FieldGlossoryMapper;
 import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
@@ -88,6 +89,8 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 	private OrganizationIdentityMapper		organizationIdentityMapper;
 	@Autowired
 	private FieldGlossoryMapper 			fieldGlossoryMapper;
+	@Autowired
+	private DistrictGlossoryMapper	districtGlossoryMapper;
 
 	private static final Logger				logger	= LoggerFactory.getLogger(AchievementServiceImpl.class);
 
@@ -410,6 +413,9 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		if(null!=a.getFieldC()){
 			a.setField3(fieldGlossoryMapper.selectByPrimaryKey(Integer.valueOf(a.getFieldC())).getName());
 		}
+		if(null!=a.getCity()){
+			a.setCityName(districtGlossoryMapper.selectByPrimaryKey(a.getCity()).getName());
+		}
 		int i=achievementMapper.countInterest(a.getId());
 		a.setCountInterest(i);
 		return a;
@@ -713,7 +719,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<AchievementPartnerListBo> listAppUserAchievement(Integer auditStatus, Integer serialNumber,
-			String name, String keyword, Integer category, Integer ownerType, Integer status,
+			String name, String keyword,Integer dataCategory, Integer category, Integer ownerType, Integer status,
 			String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus,String ownerId,Integer fieldA, Integer pNo, Integer pSize) {
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
@@ -722,13 +728,20 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		if (pSize == null || pSize < 0 || pSize > 10) {
 			pSize = 10;
 		}
-		
+		Map<String, Object> params=disposeParams(null, null, ownerId, auditStatus, serialNumber, name, keyword, category,
+				status, releaseDateStartDate, releaseDateEndDate,null, null,  releaseStatus, null, null,null, null);
+		if (null!=fieldA) {
+			params.put("fieldA", fieldA);
+		}
+		if (null != dataCategory) {
+			System.out.println("dataCategory:"+dataCategory);
+			params.put("dataCategory", dataCategory);
+		}
+		System.out.println(params);
+
 		Pagination<AchievementPartnerListBo> p=(Pagination<AchievementPartnerListBo>) findPage("findAchievementListByPage", "findAchievementCount",
-				disposeParams(null, null, ownerId, auditStatus, serialNumber, name, keyword, category,
-						status, releaseDateStartDate, releaseDateEndDate,null, null,  releaseStatus, null, null,null, null),
-				pNo, pSize);
+				params,pNo, pSize);
 		List<AchievementListBo> list=(List<AchievementListBo>) p.getList();
-		System.out.println(list);
 		for (AchievementListBo ap : list) {
 			if (null!=ap.getFieldA()) {
 				ap.setField(fieldGlossoryMapper.selectByPrimaryKey(ap.getFieldA()).getName());
@@ -737,7 +750,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 				ap.setFieldB(fieldGlossoryMapper.selectByPrimaryKey(Integer.valueOf(ap.getFieldB())).getName());
 			}
 			if(StringUtils.isNotBlank(ap.getFieldC())){
-				ap.setFieldC(fieldGlossoryMapper.selectByPrimaryKey(Integer.valueOf(ap.getFieldC())).getName());
+				ap.setFieldC(districtGlossoryMapper.selectByPrimaryKey(Integer.valueOf(ap.getFieldC())).getName());
 			}
 			int i=achievementMapper.countInterest(ap.getId());
 			ap.setCountInterest(String.valueOf(i));

+ 14 - 4
src/main/java/com/goafanti/app/controller/AppAchievementDemandController.java

@@ -44,7 +44,7 @@ public class AppAchievementDemandController extends BaseApiController {
 	 * 成果列表
 	 */
 	@RequestMapping(value = "/achievementList", method = RequestMethod.GET)
-	private Result achievementList(Integer auditStatus, Integer serialNumber, String name, String keyword, Integer category,
+	private Result achievementList(Integer auditStatus, Integer serialNumber, String name, String keyword,Integer dataCategory,Integer category,
 			Integer ownerType,Integer fieldA, Integer status, String releaseDateStartDate, String releaseDateEndDate,
 			Integer releaseStatus,String ownerId,String pageNo, String pageSize) {
 		Result res = new Result();
@@ -57,7 +57,7 @@ public class AppAchievementDemandController extends BaseApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		res.setData(achievementService.listAppUserAchievement(auditStatus, serialNumber, name, keyword, category,
+		res.setData(achievementService.listAppUserAchievement(auditStatus, serialNumber, name, keyword,  dataCategory,category,
 				ownerType,  status, releaseDateStartDate, releaseDateEndDate, releaseStatus,ownerId, fieldA, pNo, pSize));
 		return res;
 	}
@@ -80,7 +80,7 @@ public class AppAchievementDemandController extends BaseApiController {
 	 * 需求列表
 	 */
 	@RequestMapping(value = "/demandList", method = RequestMethod.GET)
-	public Result demandList(Integer auditStatus, Integer serialNumber, String name, String keyword, Integer demandType,
+	public Result demandList(Integer auditStatus, Integer serialNumber, String name, String keyword, Integer demandType,Integer industryCategoryA,
 			String validityPeriodStartDate, String validityPeriodEndDate, Integer status, Integer releaseStatus,
 			String releaseDateStartDate, String releaseDateEndDate, String pageNo, String pageSize) {
 		Result res = new Result();
@@ -93,7 +93,7 @@ public class AppAchievementDemandController extends BaseApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		res.setData(demandService.listAppDemand(auditStatus, serialNumber, name, keyword, demandType,
+		res.setData(demandService.listAppDemand(auditStatus, serialNumber, name, keyword, demandType, industryCategoryA,
 				validityPeriodStartDate, validityPeriodEndDate, status, releaseStatus, releaseDateStartDate,
 				releaseDateEndDate, pNo, pSize));
 		return res;
@@ -142,5 +142,15 @@ public class AppAchievementDemandController extends BaseApiController {
 		res.setData(userIdentityService.expertsDetail(uid));
 		return res;
 	}
+	/**
+	 * 行业分类列表
+	 * 
+	 */
+	@RequestMapping(value = "/industryList", method = RequestMethod.GET)
+	public Result industryList() {
+		Result res = new Result();
+		res.setData(userIdentityService.industryList());
+		return res;
+	}
 	
 }

+ 4 - 0
src/main/java/com/goafanti/common/dao/IndustryCategoryMapper.java

@@ -2,6 +2,7 @@ package com.goafanti.common.dao;
 
 import java.util.List;
 
+import com.goafanti.common.bo.fieldGlossoryBo;
 import com.goafanti.common.model.IndustryCategory;
 
 public interface IndustryCategoryMapper {
@@ -18,4 +19,7 @@ public interface IndustryCategoryMapper {
     int updateByPrimaryKey(IndustryCategory record);
     
     List<IndustryCategory> listByPid(Integer pid);
+
+	List<fieldGlossoryBo> selectindustryList();
+    
 }

+ 19 - 8
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -1047,12 +1047,18 @@
 	<if test="keyword != null">
 		and  keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
 	</if>
-	<if test="category != null">
-		and  category = #{category,jdbcType=INTEGER}
-	</if>
+	<if test="dataCategory != null and dataCategory != ''">
+  		and data_category = #{dataCategory,jdbcType=INTEGER}
+  	</if>
+  	<if test="category != null">
+  		and category = #{category,jdbcType=INTEGER}
+  	</if>
 	<if test="ownerType != null">
 		and  owner_type = #{ownerType,jdbcType=INTEGER}
 	</if>
+	<if test="fieldA != null">
+		and field_a  = #{fieldA,jdbcType=VARCHAR}
+	</if>
 	<if test="status != null">
 		and  status = #{status,jdbcType=INTEGER}
 	</if>
@@ -1080,6 +1086,9 @@
   	  	<if test="ownerId != null">
   	and owner_id = #{ownerId,jdbcType=VARCHAR}
   	</if>
+  	<if test="fieldA != null">
+		and field_a  = #{fieldA,jdbcType=VARCHAR}
+	</if>
   	<if test="serialNumber != null">
 		and  serial_number = #{serialNumber,jdbcType=INTEGER}
 	</if>
@@ -1092,9 +1101,12 @@
 	<if test="keyword != null">
 		and  keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
 	</if>
-	<if test="category != null">
-		and  category = #{category,jdbcType=INTEGER}
-	</if>
+	<if test="dataCategory != null and dataCategory != ''">
+  		and data_category = #{dataCategory,jdbcType=INTEGER}
+  	</if>
+  	<if test="category != null">
+  		and category = #{category,jdbcType=INTEGER}
+  	</if>
 	<if test="ownerType != null">
 		and  owner_type = #{ownerType,jdbcType=INTEGER}
 	</if>
@@ -1110,8 +1122,7 @@
 	<if test="releaseStatus != null">
 	   and  release_status = #{releaseStatus,jdbcType=INTEGER}
 	</if>
-	
-  </select>
+	</select>
   
   <select id="selectUserOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementUserOwnerDetailBo">
   	select  

+ 9 - 2
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -56,7 +56,7 @@
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
     select 
     <include refid="Base_Column_List" />
-    from demand
+    from demand 
     where id = #{id,jdbcType=VARCHAR}
     
   </select>
@@ -1433,9 +1433,10 @@
 	  d.id, d.serial_number as serialNumber, d.data_category as dataCategory, 
 	  d.name, d.keyword, d.demand_type as demandType, d.industry_category_a as industryCategoryA, d.industry_category_b as industryCategoryB, d.industry_category_c as industryCategoryC,
 	  d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus, 
-	  d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus,
+	  d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus,t.city as cityname,
 	  d.urgent_money as urgentMoney,d.urgent_days as  urgentDays,d.employer_address as employerAddress,d.problem_des as problemDes
 	from  demand d 
+	left join  user_identity t on d.employer_id=t.uid
 	where d.deleted_sign = 0 
 	<if test="employerId != null">
 	and d.employer_id = #{employerId, jdbcType=VARCHAR}
@@ -1455,6 +1456,9 @@
 	<if test="demandType != null">
 		and  d.demand_type = #{demandType,jdbcType=INTEGER}
 	</if>
+	<if test="industryCategoryA != null">
+		and  d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
+	</if>
 	<if test="status != null">
 		and  d.status = #{status,jdbcType=VARCHAR}
 	</if>
@@ -1492,6 +1496,9 @@
 	<if test="auditStatus != null">
 		and  d.audit_status = #{auditStatus,jdbcType=INTEGER}
 	</if>
+	<if test="industryCategoryA != null">
+		and  d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
+	</if>
 	<if test="name != null">
 		and  d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
 	</if>

+ 5 - 0
src/main/java/com/goafanti/common/mapper/IndustryCategoryMapper.xml

@@ -86,4 +86,9 @@
     from industry_category
     where pid = #{pid,jdbcType=INTEGER}
   </select>
+  <select id="selectindustryList" resultType="com.goafanti.common.bo.fieldGlossoryBo">
+  	SELECT id, name, pid, `level`
+	FROM aft.field_glossory
+	WHERE level=1;
+  </select>
 </mapper>

+ 10 - 0
src/main/java/com/goafanti/demand/bo/DemandListBo.java

@@ -62,6 +62,8 @@ public class DemandListBo {
 	
 	private String		IndustryCategory2;
 	
+	private String 		cityname;
+	
 	public String getIndustryCategory1() {
 		return IndustryCategory1;
 	}
@@ -354,6 +356,14 @@ public class DemandListBo {
 
 	}
 
+	public String getCityname() {
+		return cityname;
+	}
+
+	public void setCityname(String cityname) {
+		this.cityname = cityname;
+	}
+
 	
 	
 	

+ 1 - 1
src/main/java/com/goafanti/demand/service/DemandService.java

@@ -85,7 +85,7 @@ public interface DemandService {
 	/**猜你喜欢**/
 	List<DemandListBo> selectCsutomerLike();
 
-	Pagination<DemandSearchListBo> listAppDemand(Integer auditStatus, Integer serialNumber, String name, String keyword, Integer demandType,
+	Pagination<DemandSearchListBo> listAppDemand(Integer auditStatus, Integer serialNumber, String name, String keyword, Integer demandType,Integer industryCategoryA,
 			String validityPeriodStartDate, String validityPeriodEndDate, Integer status, Integer releaseStatus,
 			String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize);
 

+ 17 - 5
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -4,7 +4,7 @@ import java.math.BigDecimal;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Calendar;
-import java.util.Collection;
+
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -25,8 +25,9 @@ import com.goafanti.common.dao.AchievementKeywordMapper;
 import com.goafanti.common.dao.AchievementMapper;
 import com.goafanti.common.dao.DemandKeywordMapper;
 import com.goafanti.common.dao.DemandMapper;
+import com.goafanti.common.dao.DistrictGlossoryMapper;
 import com.goafanti.common.dao.FieldGlossoryMapper;
-import com.goafanti.common.dao.IndustryCategoryMapper;
+
 import com.goafanti.common.dao.NewsMapper;
 import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
@@ -99,6 +100,8 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 	AchievementMapper					 	achievementMapper;
 	@Autowired
 	FieldGlossoryMapper 					fieldGlossoryMapper;
+	@Autowired
+	DistrictGlossoryMapper					districtGlossoryMapper;
 
 	@SuppressWarnings("unchecked")
 	@Override
@@ -513,7 +516,6 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		return demandMapper.selectDemandSearchDetail(uid, id);
 	}
 
-	@SuppressWarnings("unused")
 	private Map<String, Object> disposeParams(Integer auditStatus, Integer province, Integer serialNumber, String name,
 			String keyword, Integer infoSources, Integer demandType, String validityPeriodStartDate,
 			String validityPeriodEndDate, String username, Integer status, Integer releaseStatus,
@@ -788,6 +790,10 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		if (null!=d.getIndustryCategoryC()) {
 			d.setIndustryCategory3(String.valueOf(fieldGlossoryMapper.selectByPrimaryKey(d.getIndustryCategoryB()).getName()));
 		}
+		if (null!=d.getEmployerId()) {
+			System.out.println(userMapper.selectByPrimaryKey(d.getEmployerId()));
+			d.setCityname(districtGlossoryMapper.selectNameById(userIdentityMapper.selectAuditorUserIdentityByUserId(d.getEmployerId()).getCity()));
+		}
 		return d;
 	}
 
@@ -813,13 +819,15 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<DemandSearchListBo> listAppDemand(Integer auditStatus, Integer serialNumber, String name,
-			String keyword, Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate,
+			String keyword, Integer demandType,Integer industryCategoryA, String validityPeriodStartDate, String validityPeriodEndDate,
 			Integer status, Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo,
 			Integer pSize) {
 		Map<String, Object> params = disposeParams(auditStatus, null, serialNumber, name, keyword, null, demandType,
 				validityPeriodStartDate, validityPeriodEndDate, null, status, releaseStatus, releaseDateStartDate,
 				releaseDateEndDate,null,null, null, null);
-
+		if (null!=industryCategoryA) {
+			params.put("industryCategoryA",  industryCategoryA);
+		}
 		params.put("employerId", TokenManager.getUserId());
 
 		if (pNo == null || pNo < 0) {
@@ -842,6 +850,10 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 				if (null!=d.getIndustryCategoryC()) {
 					d.setIndustryCategory3(String.valueOf(fieldGlossoryMapper.selectByPrimaryKey(d.getIndustryCategoryB()).getName()));
 				}
+				if (null!=d.getCityname()) {
+					d.setCityname(districtGlossoryMapper.selectNameById(Integer.valueOf(d.getCityname())));
+				}
+				
 				int i=demandMapper.countInterest(d.getId());
 				d.setCountInterest(String.valueOf(i));
 			}

+ 10 - 0
src/main/java/com/goafanti/portal/bo/DemandSearchListBo.java

@@ -85,6 +85,8 @@ public class DemandSearchListBo {
 	
 	private Integer urgentMoney;
 	
+	private String 		cityname;
+	
 	public String getEmployerName() {
 		return employerName;
 	}
@@ -237,5 +239,13 @@ public class DemandSearchListBo {
 		this.urgentMoney = urgentMoney;
 	}
 
+	public String getCityname() {
+		return cityname;
+	}
+
+	public void setCityname(String cityname) {
+		this.cityname = cityname;
+	}
+
 	
 }

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

@@ -2,10 +2,11 @@ package com.goafanti.user.service;
 
 import java.util.List;
 
+
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.bo.fieldGlossoryBo;
 import com.goafanti.common.model.UserIdentity;
 import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.portal.bo.InternationalListBo;
 import com.goafanti.portal.bo.UserSubscriberListBo;
 import com.goafanti.user.bo.AuditorUserIdentityDetailBo;
 import com.goafanti.user.bo.UserIdentityBo;
@@ -41,4 +42,6 @@ public interface UserIdentityService {
 	UserIdentityBo expertsDetail(String id);
 
 	Pagination<UserIdentityBo> expertsList(String industry, Integer pNo, Integer pSize);
+
+	List<fieldGlossoryBo> industryList();
 }

+ 7 - 0
src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

@@ -16,6 +16,7 @@ import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.bo.fieldGlossoryBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.DistrictGlossoryMapper;
 import com.goafanti.common.dao.IndustryCategoryMapper;
@@ -355,4 +356,10 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		return p;
 	}
 
+	@Override
+	public List<fieldGlossoryBo> industryList() {
+		List<fieldGlossoryBo> list=industryCategoryMapper.selectindustryList();
+		return list;
+	}
+
 }