证书修改

This commit is contained in:
wuchunlei
2024-09-19 14:33:45 +08:00
parent 5727a4358f
commit 14ee4b060b
2 changed files with 19 additions and 8 deletions

View File

@@ -403,7 +403,11 @@ public class ClassController {
userCertificate.setUserId(ShiroUtils.getUId());
if ("ZK".equals(type)){
CourseEntity courseEntity = courseService.getById(params.get("relationId").toString());
userCertificate.setTitle(courseEntity.getTitle());
String courseTitle = courseEntity.getTitle();
if (courseTitle.contains("")){
courseTitle = courseEntity.getTitle().substring(0,courseEntity.getTitle().indexOf(""));
}
userCertificate.setTitle(courseTitle);
String certificateNo = getNextCertificateNo(type,courseEntity.getTitleAbbr());//证书编号
ClassExamUser classExamUser = classExamUserService.getOne(new LambdaQueryWrapper<ClassExamUser>()
.eq(ClassExamUser::getUserId,ShiroUtils.getUId())
@@ -411,7 +415,7 @@ public class ClassController {
String endYear = DateUtil.year(classExamUser.getEndTime())+"";
String endMonth = DateUtil.month(classExamUser.getEndTime())+1+"";
String endDay = DateUtil.dayOfMonth(classExamUser.getEndTime())+"";
String[] description= {endYear,endMonth,endDay,courseEntity.getTitle()};
String[] description= {endYear,endMonth,endDay,courseTitle};
String[] edes = {courseEntity.getEtitle()};
String url = userCertificateService.generateCertificate(type,certificateNo,photoUrl,realName, description, edes, endYear,endMonth,endDay);
userCertificate.setCertificateNo(certificateNo);
@@ -433,8 +437,12 @@ public class ClassController {
userCertificate.setCertificateNo(certificateNo);
double keshiTotal = (double)map.get("keshi");
String keshi = (keshiTotal+"").replace(".0","");
String courseTitle = map.get("courseTitle").toString();
if (courseTitle.contains("")){
courseTitle = courseTitle.substring(0,courseTitle.indexOf(""));
}
String[] des = {startYear,startMonth,startDay,endYear,endMonth,endDay,
classEntity.getTitle(),map.get("courseTitle").toString(),keshi};
classEntity.getTitle(),courseTitle,keshi};
String[] edes = {map.get("courseETitle").toString(),keshi};
String url = userCertificateService.generateCertificate(type,certificateNo,photoUrl,realName,des, edes, endYear,endMonth,endDay);
userCertificate.setTitle(classEntity.getTitle());
@@ -462,14 +470,17 @@ public class ClassController {
if (userCertificateList.size() > 0){
UserCertificate u0 = userCertificateList.get(0);
String certificateNo = u0.getCertificateNo();
int no = 0;
if (certificateNo.contains("ZK")){
no = Integer.parseInt(certificateNo.substring(5,11))+1;
}else {
no = Integer.parseInt(certificateNo.substring(3,9))+1;
}
if ("A".equals(type)){
int no = Integer.parseInt(certificateNo.substring(4,10))+1;
res = "NO."+String.format("%06d", no);
}else if ("B".equals(type)){
int no = Integer.parseInt(certificateNo.substring(4,10))+1;
res = "NO."+String.format("%06d", no);
}else if ("ZK".equals(type)){
int no = Integer.parseInt(certificateNo.substring(6,12))+1;
res = "NO.ZK"+String.format("%06d", no);
}
}else {

View File

@@ -309,9 +309,9 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateDao,
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.";
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.";
des = "Has satisfactorily completed an online course on "+edes[0]+" with "+edes[1]+" course hours intotal, and has been recongnized eligibility without assessment.";
}
for (int i = 0; i < des.length(); i++) {
int oneWordWidth = dess.charWidth(des.charAt(i)); //获取单个字符的长度