加盟商编码

This commit is contained in:
苏竹红
2024-06-19 09:53:15 +08:00
parent cc11f58a56
commit 998909c522
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package com.cool.store.utils;
import java.util.Random;
/**
* @Author suzhuhong
* @Date 2024/6/19 9:51
* @Version 1.0
*/
public class RandomEightCharCodeUtils {
private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
public static String getCode() {
Random random = new Random();
StringBuilder randomCode = new StringBuilder(8);
for (int i = 0; i < 8; i++) {
int index = random.nextInt(CHARACTERS.length());
randomCode.append(CHARACTERS.charAt(index));
}
return randomCode.toString();
}
}

View File

@@ -14,6 +14,7 @@ import com.cool.store.request.LineListRequest;
import com.cool.store.request.PartnerRequest;
import com.cool.store.request.PointLinePageRequest;
import com.cool.store.request.PublicLineListRequest;
import com.cool.store.utils.RandomEightCharCodeUtils;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Maps;
@@ -73,6 +74,7 @@ public class LineInfoDAO {
}
//准加盟商
lineInfo.setJoinStatus(CommonConstants.ONE);
lineInfo.setPartnerNum(RandomEightCharCodeUtils.getCode());
lineInfo.setWorkflowSubStageStatus(workflowSubStageStatus.getCode());
return lineInfoMapper.updateByPrimaryKeySelective(lineInfo);
}