Browse Source

新增修改名称

anderx 4 years ago
parent
commit
53706e9d1f

+ 1 - 1
GeneratorConfig.xml

@@ -43,7 +43,7 @@
     <property name="enableSubPackages" value="false"/>
      <property name="nullCatalogMeansCurrent" value="true"/>
     </javaClientGenerator>
-    <table schema="aft" tableName="public_release_log"
+    <table schema="aft" tableName="user_names"
 	enableCountByExample="false" enableUpdateByExample="false"
 	enableDeleteByExample="false" enableSelectByExample="false"
 	selectByExampleQueryId="false" enableSelectByPrimaryKey="true"

+ 25 - 0
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -1331,6 +1331,31 @@ public class AdminCustomerApiController extends BaseApiController{
 		res.setData(customerService.pushChannelDeliver( uids , receiveId,remarks,type));
 		return res;
 	}
+	
+	/** 修改客户名称 **/
+	@RequestMapping(value = "/updateUserName", method = RequestMethod.POST)
+	public Result updateUserName(String uid,String userName){
+		Result res = new Result();
+		if(StringUtils.isBlank(uid) || StringUtils.isBlank(userName)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"uid或者名称","uid或者名称"));
+			return res;
+		} 
+		customerService.updateUserName(uid,userName);
+		return res;
+	}
+	
+	
+	/** 客户名称 **/
+	@RequestMapping(value = "/listUserName", method = RequestMethod.GET)
+	public Result listUserName(String uid){
+		Result res = new Result();
+		if(StringUtils.isBlank(uid) || StringUtils.isBlank(uid)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"uid","uid"));
+			return res;
+		} 
+		res.data(customerService.listUserName(uid));
+		return res;
+	}
 }
 
 

+ 3 - 0
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -28,6 +28,7 @@ import com.goafanti.customer.bo.InputChannelCounts;
 import com.goafanti.customer.bo.InputListChannel;
 import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.customer.bo.StatisticBo;
+import com.goafanti.customer.bo.UserNamesListBo;
 import com.goafanti.customer.bo.transferListBo;
 
 public interface CustomerService {
@@ -565,4 +566,6 @@ public interface CustomerService {
 	boolean checkRecovery(List<String> uids);
 	List<userDaysBo> selectChannelNotFollow(String string);
 	Object listChannelCounts(InputChannelCounts in);
+	int updateUserName(String uid, String userName);
+	List<UserNamesListBo> listUserName(String uid);
 }

+ 27 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -45,6 +45,7 @@ import com.goafanti.common.dao.UserFollowMapper;
 import com.goafanti.common.dao.UserIdentityMapper;
 import com.goafanti.common.dao.UserLockReleaseMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.dao.UserNamesMapper;
 import com.goafanti.common.dao.UserTransferLogMapper;
 import com.goafanti.common.enums.ChannelStatus;
 import com.goafanti.common.enums.CustomerStatusFiled;
@@ -66,6 +67,7 @@ import com.goafanti.common.model.UserFollow;
 import com.goafanti.common.model.UserFollowBusiness;
 import com.goafanti.common.model.UserIdentity;
 import com.goafanti.common.model.UserLockRelease;
+import com.goafanti.common.model.UserNames;
 import com.goafanti.common.model.UserTransferLog;
 import com.goafanti.common.utils.BeanUtilsExt;
 import com.goafanti.common.utils.DateUtils;
@@ -89,6 +91,7 @@ import com.goafanti.customer.bo.InputChannelCounts;
 import com.goafanti.customer.bo.InputListChannel;
 import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.customer.bo.StatisticBo;
+import com.goafanti.customer.bo.UserNamesListBo;
 import com.goafanti.customer.bo.transferListBo;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.user.bo.OutUserChannel;
@@ -137,6 +140,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	private UserTransferLogMapper userTransferLogMapper;
 	@Resource
 	private UserChannelMapper userChannelMapper;
+	@Resource
+	private UserNamesMapper	userNamesMapper;
+	
 	@Value(value = "${upload.path}")
 	private String uploadPath = null;
 
@@ -2203,4 +2209,25 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return userMapper.getUserByName(name);
 	}
 
+	@Override
+	public int updateUserName(String uid, String userName) {
+		User u=new User();
+		u.setId(uid);
+		u.setNickname(userName);
+		u.setIdentifyName(userName);
+		userMapper.updateByPrimaryKeySelective(u);
+		UserNames un=new UserNames();
+		un.setAid(TokenManager.getAdminId());
+		un.setUid(uid);
+		un.setName(userName);
+		userNamesMapper.insertSelective(un);
+		return 1;
+	}
+
+	@Override
+	public List<UserNamesListBo> listUserName(String uid) {
+		List<UserNamesListBo> list=userNamesMapper.getUserList(uid);
+		return list;
+	}
+
 }

+ 6 - 6
src/main/resources/props/config_local.properties

@@ -2,13 +2,13 @@ dev.name=local
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #本地
-#jdbc.url=jdbc\:mysql://localhost:3306/aft20210528?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=123456
-#测试
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
-jdbc.password=aftdev
+jdbc.password=123456
+#测试
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 #\u68c0\u6d4b\u6570\u636e\u5e93\u94fe\u63a5\u662f\u5426\u6709\u6548\uff0c\u5fc5\u987b\u914d\u7f6e
 jdbc.validationQuery=SELECT 'x'
 #\u521d\u59cb\u8fde\u63a5\u6570