Antiloveg 8 years ago
parent
commit
e8b398d6f3

+ 58 - 0
src/main/java/com/goafanti/common/enums/DemandInfoSourceStatus.java

@@ -0,0 +1,58 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum DemandInfoSourceStatus {
+	
+	CUSTOMER(0, "客户录入"),
+	PLANTFORM(1,"平台登记"),
+	IMPORT(2, "批量导入"),
+	DOCKING(3,"第三方数据对接"),
+	OTHER(4, "其他");
+
+	private DemandInfoSourceStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, DemandInfoSourceStatus> status = new HashMap<Integer, DemandInfoSourceStatus>();
+
+	static {
+		for (DemandInfoSourceStatus value : DemandInfoSourceStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static DemandInfoSourceStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static DemandInfoSourceStatus 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;
+	}
+
+}

+ 2 - 0
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -25,6 +25,7 @@ import com.goafanti.common.dao.UserMapper;
 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.DemandReleaseStatus;
 import com.goafanti.common.enums.DemandStatus;
 import com.goafanti.common.enums.NoticeReadStatus;
@@ -320,6 +321,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			d.setDeletedSign(DeleteStatus.UNDELETE.getCode());
 			d.setAuditStatus(DemandAuditStatus.INAUDIT.getCode());
 			d.setStatus(DemandStatus.UNRESOLVED.getCode());
+			d.setInfoSources(DemandInfoSourceStatus.IMPORT.getCode());
 			List<String> keywordsList = bo.getKeywords();
 			if (null != keywordsList && keywordsList.size() > 0) {
 				for (String s : keywordsList) {