anderx 4 years ago
parent
commit
8097a332d3

+ 71 - 0
src/main/java/com/goafanti/common/enums/ChannelStatus.java

@@ -0,0 +1,71 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum ChannelStatus {
+	/** 0未分配*/ 
+	WFP(0,"未分配"),
+	/** 已分配经理*/ 
+	YFPJL(1,"已分配经理"),
+	/** 已分配营销员*/ 
+	YFPYXY(2,"已分配营销员"),
+	/** 0已存在私有*/ 
+	YCZSY(3,"已存在私有"),
+	/** 0已存在公共*/ 
+	YCZGG(4,"已存在公共"),
+	/** 0已存在签单*/ 
+	YCZQD(5,"已存在签单"),
+	/** 0回退 */ 
+	HT(6,"回退"),
+	/** 0已签单*/ 
+	YQD(7,"已签单"),
+	NULL(9,"");
+	 
+	private Integer	code;
+	private String	desc;
+	 
+	private ChannelStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, ChannelStatus> status = new HashMap<Integer, ChannelStatus>();
+
+	static {
+		for (ChannelStatus value : ChannelStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static ChannelStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return NULL;
+	}
+
+	public static ChannelStatus getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return NULL;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 1 - 3
src/main/java/com/goafanti/common/mapper/UserChannelMapper.xml

@@ -231,11 +231,9 @@
     </select>
     <update id="updateByuids">
      update user_channel set
-     <if test="type != 2">
      status =  #{status}
-     </if>
      <if test="type == 2">
-     status = 5 , recovery=1
+     ,recovery=1
      </if>  
      <if test="date !=null">
      ,distribution_time= #{date}

+ 4 - 3
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -46,6 +46,7 @@ import com.goafanti.common.dao.UserIdentityMapper;
 import com.goafanti.common.dao.UserLockReleaseMapper;
 import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.dao.UserTransferLogMapper;
+import com.goafanti.common.enums.ChannelStatus;
 import com.goafanti.common.enums.CustomerStatusFiled;
 import com.goafanti.common.enums.DeleteStatus;
 import com.goafanti.common.enums.IdentityProcess;
@@ -2110,19 +2111,19 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			userLockReleaseMapper.insertChannelList(uids,receiveId);
 			String role=userMapper.checkRoleMax(receiveId);
 			if (role.equals(AFTConstants.SALESMAN_MANAGER)) {
-				status=1;
+				status=ChannelStatus.YFPJL.getCode();
 			}else {
-				status=2;
+				status=ChannelStatus.YFPYXY.getCode();
 			}
 		}else {
 			userLockReleaseMapper.updateChannelList(uids,receiveId);
+			status=ChannelStatus.HT.getCode();
 		}
 		if(type==0) {
 			userChannelMapper.updateByuids(uids, type, date,receiveId,status);
 		}else {
 			userChannelMapper.updateByuids(uids, type, date,null,status);
 		}
-		
 		organizationContactBookMapper.updateByUids(uids, receiveId);
 		return 1;
 	}