生成证书
This commit is contained in:
@@ -411,8 +411,8 @@ public class ClassController {
|
|||||||
String endYear = DateUtil.year(classExamUser.getEndTime())+"";
|
String endYear = DateUtil.year(classExamUser.getEndTime())+"";
|
||||||
String endMonth = DateUtil.month(classExamUser.getEndTime())+1+"";
|
String endMonth = DateUtil.month(classExamUser.getEndTime())+1+"";
|
||||||
String endDay = DateUtil.dayOfMonth(classExamUser.getEndTime())+"";
|
String endDay = DateUtil.dayOfMonth(classExamUser.getEndTime())+"";
|
||||||
String description = endYear+"年"+endMonth+"月"+endDay+"日自考通过太湖学堂"+courseEntity.getTitle()+"课程考试,确认合格。";
|
String[] description= {endYear,endMonth,endDay,courseEntity.getTitle()};
|
||||||
String edes = "has past the online-examination study of "+courseEntity.getEtitle()+" Courses in Tai Hu Education online.";
|
String[] edes = {courseEntity.getEtitle()};
|
||||||
String url = userCertificateService.generateCertificate(type,certificateNo,photoUrl,realName, description, edes, endYear,endMonth,endDay);
|
String url = userCertificateService.generateCertificate(type,certificateNo,photoUrl,realName, description, edes, endYear,endMonth,endDay);
|
||||||
userCertificate.setCertificateNo(certificateNo);
|
userCertificate.setCertificateNo(certificateNo);
|
||||||
userCertificate.setCertificateUrl(url);
|
userCertificate.setCertificateUrl(url);
|
||||||
@@ -433,10 +433,10 @@ public class ClassController {
|
|||||||
userCertificate.setCertificateNo(certificateNo);
|
userCertificate.setCertificateNo(certificateNo);
|
||||||
double keshiTotal = (double)map.get("keshi");
|
double keshiTotal = (double)map.get("keshi");
|
||||||
String keshi = (keshiTotal+"").replace(".0","");
|
String keshi = (keshiTotal+"").replace(".0","");
|
||||||
String description = "自"+startYear+"年"+startMonth+"月"+startDay+"日至"+endYear+"年"+endMonth+"月"+endDay+"日" +
|
String[] des = {startYear,startMonth,startDay,endYear,endMonth,endDay,
|
||||||
"在太湖学堂"+classEntity.getTitle()+"学习,修完"+map.get("courseTitle")+"课程,共计"+keshi+"学时,确认合格。";
|
classEntity.getTitle(),map.get("courseTitle").toString(),keshi};
|
||||||
String edes = "Has satisfactorily completed an online courseTCM on "+map.get("courseETitle")+" with "+keshi+" course hours intotal, and has been recongnized eligibility without assessment.";
|
String[] edes = {map.get("courseETitle").toString(),keshi};
|
||||||
String url = userCertificateService.generateCertificate(type,certificateNo,photoUrl,realName, description, edes, endYear,endMonth,endDay);
|
String url = userCertificateService.generateCertificate(type,certificateNo,photoUrl,realName,des, edes, endYear,endMonth,endDay);
|
||||||
userCertificate.setTitle(classEntity.getTitle());
|
userCertificate.setTitle(classEntity.getTitle());
|
||||||
userCertificate.setCertificateUrl(url);
|
userCertificate.setCertificateUrl(url);
|
||||||
userCertificate.setClassId(classEntity.getId());
|
userCertificate.setClassId(classEntity.getId());
|
||||||
@@ -464,19 +464,19 @@ public class ClassController {
|
|||||||
String certificateNo = u0.getCertificateNo();
|
String certificateNo = u0.getCertificateNo();
|
||||||
int no = Integer.parseInt(certificateNo.substring(certificateNo.indexOf("1")+1,certificateNo.indexOf("1")+7))+1;
|
int no = Integer.parseInt(certificateNo.substring(certificateNo.indexOf("1")+1,certificateNo.indexOf("1")+7))+1;
|
||||||
if ("A".equals(type)){
|
if ("A".equals(type)){
|
||||||
res = "NO.A1"+String.format("%06d", no);
|
res = "NO."+String.format("%06d", no);
|
||||||
}else if ("B".equals(type)){
|
}else if ("B".equals(type)){
|
||||||
res = "NO.B1"+String.format("%06d", no);
|
res = "NO."+String.format("%06d", no);
|
||||||
}else if ("ZK".equals(type)){
|
}else if ("ZK".equals(type)){
|
||||||
res = "NO.ZK1"+String.format("%06d", no);
|
res = "NO.ZK"+String.format("%06d", no);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
if ("A".equals(type)){
|
if ("A".equals(type)){
|
||||||
res = "NO.A1000001";
|
res = "NO.000001";
|
||||||
}else if ("B".equals(type)){
|
}else if ("B".equals(type)){
|
||||||
res = "NO.B1000001";
|
res = "NO.000001";
|
||||||
}else if ("ZK".equals(type)){
|
}else if ("ZK".equals(type)){
|
||||||
res = "NO.ZK1000001";
|
res = "NO.ZK000001";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res+courseNamePinyin;
|
return res+courseNamePinyin;
|
||||||
|
|||||||
@@ -58,11 +58,13 @@ public class UserCertificateController {
|
|||||||
String iconUrl = params.get("iconUrl").toString();
|
String iconUrl = params.get("iconUrl").toString();
|
||||||
String realName = params.get("realName").toString();
|
String realName = params.get("realName").toString();
|
||||||
String description = params.get("description").toString();
|
String description = params.get("description").toString();
|
||||||
String edes = params.get("edes").toString();
|
String edescription = params.get("edes").toString();
|
||||||
String endYear = params.get("endYear").toString();
|
String endYear = params.get("endYear").toString();
|
||||||
String endMonth = params.get("endMonth").toString();
|
String endMonth = params.get("endMonth").toString();
|
||||||
String endDay = params.get("endDay").toString();
|
String endDay = params.get("endDay").toString();
|
||||||
String url = userCertificateService.generateCertificate(type,certificateNo,iconUrl,realName, description, edes, endYear,endMonth,endDay);
|
String[] des = description.split(",");
|
||||||
|
String[] edes = edescription.split(",");
|
||||||
|
String url = userCertificateService.generateCertificate(type,certificateNo,iconUrl,realName, des, edes, endYear,endMonth,endDay);
|
||||||
return R.ok().put("url",url);
|
return R.ok().put("url",url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ import com.peanut.modules.common.entity.UserCertificate;
|
|||||||
public interface UserCertificateService extends IService<UserCertificate> {
|
public interface UserCertificateService extends IService<UserCertificate> {
|
||||||
|
|
||||||
|
|
||||||
String generateCertificate(String type,String no,String iconUrl,String name,String des,String edes,String endy,String endm,String endd);
|
String generateCertificate(String type,String no,String iconUrl,String name,String[] des,String[] edes,String endy,String endm,String endd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,15 +23,8 @@ import java.util.UUID;
|
|||||||
@Service("commonUserCertificateService")
|
@Service("commonUserCertificateService")
|
||||||
public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao, UserCertificate> implements UserCertificateService {
|
public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao, UserCertificate> implements UserCertificateService {
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
|
|
||||||
System.out.println(" ");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String generateCertificate(String type,String certificateNo,String iconUrl,String realName,String des,String edes,
|
public String generateCertificate(String type,String certificateNo,String iconUrl,String realName,String[] des,String[] edes,
|
||||||
String endYear,String endMonth,String endDay) {
|
String endYear,String endMonth,String endDay) {
|
||||||
String url = "";
|
String url = "";
|
||||||
if ("A".equals(type)){
|
if ("A".equals(type)){
|
||||||
@@ -41,14 +34,11 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao,
|
|||||||
}else if ("ZK".equals(type)){
|
}else if ("ZK".equals(type)){
|
||||||
url = generateZKCertificate(certificateNo, iconUrl, realName, des, endYear, endMonth, endDay);
|
url = generateZKCertificate(certificateNo, iconUrl, realName, des, endYear, endMonth, endDay);
|
||||||
}
|
}
|
||||||
String eurl = generateECertificate(certificateNo,realName, edes);
|
String eurl = generateECertificate(type,certificateNo,realName, edes);
|
||||||
return url+","+eurl;
|
return url+","+eurl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String generateZKCertificate(String no,String iconUrl,String name,String[] des,String endy,String endm,String endd) {
|
||||||
|
|
||||||
|
|
||||||
public String generateZKCertificate(String no,String iconUrl,String name,String des,String endy,String endm,String endd) {
|
|
||||||
try {
|
try {
|
||||||
Image src = ImageIO.read(new URL("https://ehh-private-01.oss-cn-beijing.aliyuncs.com/certificate/ZK.png"));
|
Image src = ImageIO.read(new URL("https://ehh-private-01.oss-cn-beijing.aliyuncs.com/certificate/ZK.png"));
|
||||||
// 获取图片的高和宽
|
// 获取图片的高和宽
|
||||||
@@ -80,32 +70,34 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao,
|
|||||||
int namey = 765;
|
int namey = 765;
|
||||||
g.drawString(name, namex, namey);
|
g.drawString(name, namex, namey);
|
||||||
|
|
||||||
|
String[] str = {"年","月","日自考通过太湖学堂","课程考试,确认合格。"};
|
||||||
g.setColor(Color.BLACK);
|
g.setColor(Color.BLACK);
|
||||||
g.setFont(new Font("黑体", Font.BOLD, 30));
|
|
||||||
FontMetrics dess = g.getFontMetrics();
|
FontMetrics dess = g.getFontMetrics();
|
||||||
int alreadyWriteLine = 0; //已经写了多少行
|
int alreadyWriteLine = 0; //已经写了多少行
|
||||||
int nowWidth = 0; //目前一行的长度
|
int desTotalWidth = 50; //目前一行的长度
|
||||||
boolean space = true; //第一行空两格
|
for (int j = 0; j < 4; j++) {//可画字区域宽650,x 180,y 820高开始+10行间距
|
||||||
for (int i = 0; i < des.length(); i++) {
|
for (int k=0;k<des[j].length(); k++){
|
||||||
int oneWordWidth = dess.charWidth(des.charAt(i)); //获取单个字符的长度
|
int oneWordWidth = dess.charWidth(des[j].charAt(k));//获取单个字符的长度
|
||||||
if (nowWidth+oneWordWidth>650){
|
desTotalWidth += oneWordWidth;
|
||||||
alreadyWriteLine++;
|
if (desTotalWidth>650){
|
||||||
int writeY = 850 + alreadyWriteLine * (dess.getHeight()+10);//10是行间距
|
alreadyWriteLine++;
|
||||||
g.drawString(des.charAt(i) + "", 180, writeY);
|
desTotalWidth = oneWordWidth;
|
||||||
nowWidth = 0;
|
|
||||||
space = false;
|
|
||||||
nowWidth += oneWordWidth;
|
|
||||||
}else {
|
|
||||||
int writeY = 850 + alreadyWriteLine * (dess.getHeight()+10);//10是行间距
|
|
||||||
if (nowWidth==0&&space){//换行画
|
|
||||||
g.drawString(des.charAt(i)+"", 180+oneWordWidth, writeY);
|
|
||||||
nowWidth += oneWordWidth*2;
|
|
||||||
}else {//一字一字画
|
|
||||||
g.drawString(des.charAt(i)+"", 180+nowWidth, writeY);
|
|
||||||
nowWidth += oneWordWidth;
|
|
||||||
}
|
}
|
||||||
|
g.setFont(new Font("黑体", Font.BOLD, 30));
|
||||||
|
g.drawString(des[j].charAt(k)+"",180+desTotalWidth-oneWordWidth,820+alreadyWriteLine*(dess.getHeight()+10));
|
||||||
|
}
|
||||||
|
for (int k=0;k<str[j].length(); k++){
|
||||||
|
int oneWordWidth = dess.charWidth(str[j].charAt(k));//获取单个字符的长度
|
||||||
|
desTotalWidth += oneWordWidth;
|
||||||
|
if (desTotalWidth>650){
|
||||||
|
alreadyWriteLine++;
|
||||||
|
desTotalWidth = oneWordWidth;
|
||||||
|
}
|
||||||
|
g.setFont(new Font("宋体", Font.PLAIN, 30));
|
||||||
|
g.drawString(str[j].charAt(k)+"",180+desTotalWidth-oneWordWidth,820+alreadyWriteLine*(dess.getHeight()+10));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g.setColor(new Color(0,75,63));
|
g.setColor(new Color(0,75,63));
|
||||||
g.setFont(new Font("黑体", Font.BOLD, 28));
|
g.setFont(new Font("黑体", Font.BOLD, 28));
|
||||||
g.drawString(endy,595,1123);
|
g.drawString(endy,595,1123);
|
||||||
@@ -123,7 +115,7 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String generateBCertificate(String no,String iconUrl,String name,String des,String endy,String endm,String endd) {
|
public String generateBCertificate(String no,String iconUrl,String name,String[] des,String endy,String endm,String endd) {
|
||||||
try {
|
try {
|
||||||
Image src = ImageIO.read(new URL("https://ehh-private-01.oss-cn-beijing.aliyuncs.com/certificate/B.png"));
|
Image src = ImageIO.read(new URL("https://ehh-private-01.oss-cn-beijing.aliyuncs.com/certificate/B.png"));
|
||||||
// 获取图片的高和宽
|
// 获取图片的高和宽
|
||||||
@@ -155,31 +147,36 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao,
|
|||||||
int namey = 730;
|
int namey = 730;
|
||||||
g.drawString(name, namex, namey);
|
g.drawString(name, namex, namey);
|
||||||
|
|
||||||
g.setFont(new Font("黑体", Font.BOLD, 30));
|
String[] str = {"自","年","月","日至","年","月","日在太湖学堂","学习,修完","课程,共计","学时,确认合格。"};
|
||||||
|
g.setColor(Color.BLACK);
|
||||||
FontMetrics dess = g.getFontMetrics();
|
FontMetrics dess = g.getFontMetrics();
|
||||||
int alreadyWriteLine = 0; //已经写了多少行
|
int alreadyWriteLine = 0; //已经写了多少行
|
||||||
int nowWidth = 0; //目前一行的长度
|
int desTotalWidth = 50; //目前一行的长度
|
||||||
boolean space = true; //第一行空两格
|
for (int j = 0; j < 10; j++) {//可画字区域宽650,x 180,y 820高开始+10行间距
|
||||||
for (int i = 0; i < des.length(); i++) {
|
for (int k=0;k<str[j].length(); k++){
|
||||||
int oneWordWidth = dess.charWidth(des.charAt(i)); //获取单个字符的长度
|
int oneWordWidth = dess.charWidth(str[j].charAt(k));//获取单个字符的长度
|
||||||
if (nowWidth+oneWordWidth>650){
|
desTotalWidth += oneWordWidth;
|
||||||
alreadyWriteLine++;
|
if (desTotalWidth>650){
|
||||||
int writeY = 850 + alreadyWriteLine * (dess.getHeight()+10);//10是行间距
|
alreadyWriteLine++;
|
||||||
g.drawString(des.charAt(i) + "", 180, writeY);
|
desTotalWidth = oneWordWidth;
|
||||||
nowWidth = 0;
|
}
|
||||||
space = false;
|
g.setFont(new Font("宋体", Font.PLAIN, 30));
|
||||||
nowWidth += oneWordWidth;
|
g.drawString(str[j].charAt(k)+"",180+desTotalWidth-oneWordWidth,820+alreadyWriteLine*(dess.getHeight()+10));
|
||||||
}else {
|
}
|
||||||
int writeY = 850 + alreadyWriteLine * (dess.getHeight()+10);//10是行间距
|
if (j<=des.length){
|
||||||
if (nowWidth==0&&space){//换行画
|
for (int k=0;k<des[j].length(); k++){
|
||||||
g.drawString(des.charAt(i)+"", 180+oneWordWidth, writeY);
|
int oneWordWidth = dess.charWidth(des[j].charAt(k));//获取单个字符的长度
|
||||||
nowWidth += oneWordWidth*2;
|
desTotalWidth += oneWordWidth;
|
||||||
}else {//一字一字画
|
if (desTotalWidth>650){
|
||||||
g.drawString(des.charAt(i)+"", 180+nowWidth, writeY);
|
alreadyWriteLine++;
|
||||||
nowWidth += oneWordWidth;
|
desTotalWidth = oneWordWidth;
|
||||||
|
}
|
||||||
|
g.setFont(new Font("黑体", Font.BOLD, 30));
|
||||||
|
g.drawString(des[j].charAt(k)+"",180+desTotalWidth-oneWordWidth,820+alreadyWriteLine*(dess.getHeight()+10));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g.setFont(new Font("黑体", Font.BOLD, 28));
|
g.setFont(new Font("黑体", Font.BOLD, 28));
|
||||||
g.drawString(endy,600,1158);
|
g.drawString(endy,600,1158);
|
||||||
g.drawString(endm,695,1158);
|
g.drawString(endm,695,1158);
|
||||||
@@ -196,7 +193,7 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String generateACertificate(String no,String iconUrl,String name,String des,String endy,String endm,String endd) {
|
public String generateACertificate(String no,String iconUrl,String name,String[] des,String endy,String endm,String endd) {
|
||||||
try {
|
try {
|
||||||
Image src = ImageIO.read(new URL("https://ehh-private-01.oss-cn-beijing.aliyuncs.com/certificate/A.png"));
|
Image src = ImageIO.read(new URL("https://ehh-private-01.oss-cn-beijing.aliyuncs.com/certificate/A.png"));
|
||||||
// 获取图片的高和宽
|
// 获取图片的高和宽
|
||||||
@@ -228,28 +225,33 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao,
|
|||||||
int namey = 815;
|
int namey = 815;
|
||||||
g.drawString(name, namex, namey);
|
g.drawString(name, namex, namey);
|
||||||
|
|
||||||
g.setFont(new Font("黑体", Font.BOLD, 30));
|
String[] str = {"自","年","月","日至","年","月","日在太湖学堂","学习,修完","课程,共计","学时,确认合格。"};
|
||||||
|
g.setColor(Color.BLACK);
|
||||||
|
g.setFont(new Font("宋体", Font.PLAIN, 32));
|
||||||
FontMetrics dess = g.getFontMetrics();
|
FontMetrics dess = g.getFontMetrics();
|
||||||
int alreadyWriteLine = 0; //已经写了多少行
|
int alreadyWriteLine = 0; //已经写了多少行
|
||||||
int nowWidth = 0; //目前一行的长度
|
int desTotalWidth = 50; //目前一行的长度
|
||||||
boolean space = true; //第一行空两格
|
for (int j = 0; j < 10; j++) {//可画字区域宽650,x 180,y 820高开始+10行间距
|
||||||
for (int i = 0; i < des.length(); i++) {
|
for (int k=0;k<str[j].length(); k++){
|
||||||
int oneWordWidth = dess.charWidth(des.charAt(i)); //获取单个字符的长度
|
int oneWordWidth = dess.charWidth(str[j].charAt(k));//获取单个字符的长度
|
||||||
if (nowWidth+oneWordWidth>650){
|
desTotalWidth += oneWordWidth;
|
||||||
alreadyWriteLine++;
|
if (desTotalWidth>650){
|
||||||
int writeY = 865 + alreadyWriteLine * (dess.getHeight()+10);//10是行间距
|
alreadyWriteLine++;
|
||||||
g.drawString(des.charAt(i) + "", 180, writeY);
|
desTotalWidth = oneWordWidth;
|
||||||
nowWidth = 0;
|
}
|
||||||
space = false;
|
g.setFont(new Font("宋体", Font.PLAIN, 32));
|
||||||
nowWidth += oneWordWidth;
|
g.drawString(str[j].charAt(k)+"",180+desTotalWidth-oneWordWidth,860+alreadyWriteLine*(dess.getHeight()+20));
|
||||||
}else {
|
}
|
||||||
int writeY = 865 + alreadyWriteLine * (dess.getHeight()+10);//10是行间距
|
if (j<des.length){
|
||||||
if (nowWidth==0&&space){//换行画
|
for (int k=0;k<des[j].length(); k++){
|
||||||
g.drawString(des.charAt(i)+"", 180+oneWordWidth, writeY);
|
int oneWordWidth = dess.charWidth(des[j].charAt(k));//获取单个字符的长度
|
||||||
nowWidth += oneWordWidth*2;
|
desTotalWidth += oneWordWidth;
|
||||||
}else {//一字一字画
|
if (desTotalWidth>650){
|
||||||
g.drawString(des.charAt(i)+"", 180+nowWidth, writeY);
|
alreadyWriteLine++;
|
||||||
nowWidth += oneWordWidth;
|
desTotalWidth = oneWordWidth;
|
||||||
|
}
|
||||||
|
g.setFont(new Font("黑体", Font.BOLD, 32));
|
||||||
|
g.drawString(des[j].charAt(k)+"",180+desTotalWidth-oneWordWidth,860+alreadyWriteLine*(dess.getHeight()+20));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -270,7 +272,7 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao,
|
|||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public String generateECertificate(String no,String name,String des) {
|
public String generateECertificate(String type,String no,String name,String[] edes) {
|
||||||
try {
|
try {
|
||||||
Image src = ImageIO.read(new URL("https://ehh-private-01.oss-cn-beijing.aliyuncs.com/certificate/E.png"));
|
Image src = ImageIO.read(new URL("https://ehh-private-01.oss-cn-beijing.aliyuncs.com/certificate/E.png"));
|
||||||
String filename = "eee";
|
String filename = "eee";
|
||||||
@@ -305,6 +307,12 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao,
|
|||||||
int alreadyWriteLine = 0; //已经写了多少行
|
int alreadyWriteLine = 0; //已经写了多少行
|
||||||
int nowWidth = 0; //目前一行的长度
|
int nowWidth = 0; //目前一行的长度
|
||||||
boolean space = true; //第一行空两格
|
boolean space = true; //第一行空两格
|
||||||
|
String des = "";
|
||||||
|
if ("ZK".equals(type)){
|
||||||
|
des = "has past the online-examination study of "+edes[0]+" Courses in Tai Hu Education online.";
|
||||||
|
}else {
|
||||||
|
des = "Has satisfactorily completed an online courseTCM on "+edes[0]+" with "+edes[1]+" course hours intotal, and has been recongnized eligibility without assessment.";
|
||||||
|
}
|
||||||
for (int i = 0; i < des.length(); i++) {
|
for (int i = 0; i < des.length(); i++) {
|
||||||
int oneWordWidth = dess.charWidth(des.charAt(i)); //获取单个字符的长度
|
int oneWordWidth = dess.charWidth(des.charAt(i)); //获取单个字符的长度
|
||||||
if (nowWidth+oneWordWidth>700){//换行画
|
if (nowWidth+oneWordWidth>700){//换行画
|
||||||
@@ -343,11 +351,13 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao,
|
|||||||
String name = "";
|
String name = "";
|
||||||
for (int i = 0; i < sss.length; i++) {
|
for (int i = 0; i < sss.length; i++) {
|
||||||
String ss = sss[i];
|
String ss = sss[i];
|
||||||
ss = ss.replace(ss.charAt(0),Character.toUpperCase(ss.charAt(0)));
|
if (!" ".equals(ss)){
|
||||||
if (i==0){
|
ss = ss.replace(ss.charAt(0),Character.toUpperCase(ss.charAt(0)));
|
||||||
nick = ss;
|
if (i==0){
|
||||||
}else {
|
nick = ss;
|
||||||
name = name+" "+ss;
|
}else {
|
||||||
|
name = name+" "+ss;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return name+" "+nick;
|
return name+" "+nick;
|
||||||
|
|||||||
Reference in New Issue
Block a user