Antiloveg лет назад: 8
Родитель
Сommit
594223cb99

+ 54 - 0
src/main/java/com/goafanti/common/enums/DemandPortalSearchSignType.java

@@ -0,0 +1,54 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum DemandPortalSearchSignType {
+	ALL(0, "查询全部"),
+	NEGOATION(1,"交付意向金"),
+	OTHER(2, "其他");
+
+	private DemandPortalSearchSignType(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, DemandPortalSearchSignType> status = new HashMap<Integer, DemandPortalSearchSignType>();
+
+	static {
+		for (DemandPortalSearchSignType value : DemandPortalSearchSignType.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static DemandPortalSearchSignType getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static DemandPortalSearchSignType getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

+ 6 - 0
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -931,6 +931,9 @@
   		<if test="demandType != null">
   			and d.demand_type = #{demandType,jdbcType=INTEGER}
   		</if>
+  		<if test="sign == 1">
+  			and d.budget_cost is null
+  		</if>
   		and d.deleted_sign = 0 
   		and d.release_status = 1
   		and d.audit_status = 3
@@ -963,6 +966,9 @@
   		<if test="demandType != null">
   			and d.demand_type = #{demandType,jdbcType=INTEGER}
   		</if>
+  		<if test="sign == 1">
+  			and d.budget_cost is null
+  		</if>
   		and d.deleted_sign = 0 
   		and d.release_status = 1
   		and d.audit_status = 3

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

@@ -54,7 +54,7 @@ public interface DemandService {
 
 	void insertImport(List<DemandImportBo> data);
 
-	Pagination<DemandSearchListBo> listDemandSearchList(String keyword, Integer industryCategoryA,
+	Pagination<DemandSearchListBo> listDemandSearchList(Integer sign, String keyword, Integer industryCategoryA,
 			Integer industryCategoryB, Integer demandType, BigDecimal budgetCostLower, BigDecimal budgetCostUpper,
 			Integer pNo, Integer pSize);
 

+ 8 - 3
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -28,6 +28,7 @@ import com.goafanti.common.dao.UserRoleMapper;
 import com.goafanti.common.enums.DeleteStatus;
 import com.goafanti.common.enums.DemandAuditStatus;
 import com.goafanti.common.enums.DemandInfoSourceStatus;
+import com.goafanti.common.enums.DemandPortalSearchSignType;
 import com.goafanti.common.enums.DemandReleaseStatus;
 import com.goafanti.common.enums.DemandStatus;
 import com.goafanti.common.enums.NoticeReadStatus;
@@ -375,7 +376,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<DemandSearchListBo> listDemandSearchList(String keyword, Integer industryCategoryA,
+	public Pagination<DemandSearchListBo> listDemandSearchList(Integer sign, String keyword, Integer industryCategoryA,
 			Integer industryCategoryB, Integer demandType, BigDecimal budgetCostLower, BigDecimal budgetCostUpper,
 			Integer pNo, Integer pSize) {
 		Map<String, Object> params = new HashMap<>();
@@ -383,11 +384,11 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			params.put("keyword", keyword);
 		}
 
-		if (null != industryCategoryA) {
+		if (null != industryCategoryA && DemandPortalSearchSignType.ALL.getCode().equals(sign)) {
 			params.put("industryCategoryA", industryCategoryA);
 		}
 
-		if (null != industryCategoryB) {
+		if (null != industryCategoryB && DemandPortalSearchSignType.ALL.getCode().equals(sign)) {
 			params.put("industryCategoryB", industryCategoryB);
 		}
 
@@ -403,6 +404,10 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			params.put("budgetCostUpper", budgetCostUpper);
 		}
 
+		if (null != sign) {
+			params.put("sign", sign);
+		}
+
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
 		}

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

@@ -13,6 +13,7 @@ import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.enums.DemandPortalSearchSignType;
 import com.goafanti.common.enums.UserLevel;
 import com.goafanti.common.enums.UserType;
 import com.goafanti.demand.service.DemandService;
@@ -56,19 +57,29 @@ public class PortalSearchApiController extends BaseApiController {
 	 * 科技需求搜索
 	 */
 	@RequestMapping(value = "/demandList", method = RequestMethod.GET)
-	public Result demandSearchList(String keyword, Integer industryCategoryA, Integer industryCategoryB,
+	public Result demandSearchList(Integer sign, String keyword, Integer industryCategoryA, Integer industryCategoryB,
 			Integer demandType, BigDecimal budgetCostLower, BigDecimal budgetCostUpper, String pageNo,
 			String pageSize) {
 		Result res = new Result();
 		Integer pNo = 1;
 		Integer pSize = 10;
+		if (null == sign) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "查询标记"));
+			return res;
+		}
+
+		if (!DemandPortalSearchSignType.ALL.getCode().equals(sign)
+				&& !DemandPortalSearchSignType.NEGOATION.getCode().equals(sign)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "查询标记"));
+			return res;
+		}
 		if (StringUtils.isNumeric(pageSize)) {
 			pSize = Integer.parseInt(pageSize);
 		}
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		res.setData(demandService.listDemandSearchList(keyword, industryCategoryA, industryCategoryB, demandType,
+		res.setData(demandService.listDemandSearchList(sign, keyword, industryCategoryA, industryCategoryB, demandType,
 				budgetCostLower, budgetCostUpper, pNo, pSize));
 		return res;
 	}