|
@@ -18,6 +18,7 @@ import com.zhongzheng.common.core.redis.RedisCache;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
|
+import com.zhongzheng.common.utils.ToolsUtils;
|
|
import com.zhongzheng.modules.alioss.service.OssService;
|
|
import com.zhongzheng.modules.alioss.service.OssService;
|
|
import com.zhongzheng.modules.base.bo.CertificateTpAddBo;
|
|
import com.zhongzheng.modules.base.bo.CertificateTpAddBo;
|
|
import com.zhongzheng.modules.base.bo.CertificateTpEditBo;
|
|
import com.zhongzheng.modules.base.bo.CertificateTpEditBo;
|
|
@@ -204,6 +205,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
bo.setPageSize(null);
|
|
bo.setPageSize(null);
|
|
bo.setPageNum(null);
|
|
bo.setPageNum(null);
|
|
GoodsVo goodsVo = iGoodsService.selectDetail(bo.getGoodsId());
|
|
GoodsVo goodsVo = iGoodsService.selectDetail(bo.getGoodsId());
|
|
|
|
+ goodsVo.setSelfClassHours(goodsVo.getClassHours());
|
|
//获取培训开始时间
|
|
//获取培训开始时间
|
|
UserStudyRecordQueryBo studyRecordQueryBo = new UserStudyRecordQueryBo();
|
|
UserStudyRecordQueryBo studyRecordQueryBo = new UserStudyRecordQueryBo();
|
|
studyRecordQueryBo.setUserId(bo.getUserId());
|
|
studyRecordQueryBo.setUserId(bo.getUserId());
|
|
@@ -294,6 +296,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
queryBo.setGradeId(gradeUser.getGradeId());
|
|
queryBo.setGradeId(gradeUser.getGradeId());
|
|
queryBo.setUserId(gradeUser.getUserId());
|
|
queryBo.setUserId(gradeUser.getUserId());
|
|
queryBo.setOrderGoodsId(gradeUser.getOrderGoodsId());
|
|
queryBo.setOrderGoodsId(gradeUser.getOrderGoodsId());
|
|
|
|
+
|
|
OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>()
|
|
OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>()
|
|
.eq(OrderGoods::getOrderGoodsId, gradeUser.getOrderGoodsId()));
|
|
.eq(OrderGoods::getOrderGoodsId, gradeUser.getOrderGoodsId()));
|
|
queryBo.setGoodsId(orderGoods.getGoodsId());
|
|
queryBo.setGoodsId(orderGoods.getGoodsId());
|
|
@@ -365,7 +368,12 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
sex = "女";
|
|
sex = "女";
|
|
}
|
|
}
|
|
vo.setSex(sex);
|
|
vo.setSex(sex);
|
|
- vo.setClassHours(goodsVo.getClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP )+"");
|
|
|
|
|
|
+ Integer totalHour = 0;
|
|
|
|
+ for(CourseChapterVo chapterVo : chapterList){
|
|
|
|
+ totalHour+=chapterVo.getSectionNum();
|
|
|
|
+ }
|
|
|
|
+ goodsVo.setClassHours(goodsVo.getSelfClassHours());
|
|
|
|
+ vo.setClassHours(goodsVo.getSelfClassHours()+"");
|
|
vo.setDateY(nowDate.substring(0, 4));
|
|
vo.setDateY(nowDate.substring(0, 4));
|
|
vo.setDateM(nowDate.substring(5, 7));
|
|
vo.setDateM(nowDate.substring(5, 7));
|
|
vo.setDateD(nowDate.substring(8, 10));
|
|
vo.setDateD(nowDate.substring(8, 10));
|
|
@@ -395,7 +403,12 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
sex = "女";
|
|
sex = "女";
|
|
}
|
|
}
|
|
vo.setSex(sex);
|
|
vo.setSex(sex);
|
|
- vo.setClassHours(goodsVo.getClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP )+"");
|
|
|
|
|
|
+ Integer totalHour = 0;
|
|
|
|
+ for(CourseChapterVo chapterVo : chapterList){
|
|
|
|
+ totalHour+=chapterVo.getSectionNum();
|
|
|
|
+ }
|
|
|
|
+ goodsVo.setClassHours(goodsVo.getSelfClassHours());
|
|
|
|
+ vo.setClassHours(goodsVo.getSelfClassHours()+"");
|
|
vo.setDateY(nowDate.substring(0, 4));
|
|
vo.setDateY(nowDate.substring(0, 4));
|
|
vo.setDateM(nowDate.substring(5, 7));
|
|
vo.setDateM(nowDate.substring(5, 7));
|
|
vo.setDateD(nowDate.substring(8, 10));
|
|
vo.setDateD(nowDate.substring(8, 10));
|
|
@@ -425,7 +438,12 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
sex = "女";
|
|
sex = "女";
|
|
}
|
|
}
|
|
vo.setSex(sex);
|
|
vo.setSex(sex);
|
|
- vo.setClassHours(goodsVo.getClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP )+"");
|
|
|
|
|
|
+ Integer totalHour = 0;
|
|
|
|
+ for(CourseChapterVo chapterVo : chapterList){
|
|
|
|
+ totalHour+=chapterVo.getSectionNum();
|
|
|
|
+ }
|
|
|
|
+ goodsVo.setClassHours(goodsVo.getSelfClassHours());
|
|
|
|
+ vo.setClassHours(goodsVo.getSelfClassHours()+"");
|
|
vo.setDateY(nowDate.substring(0, 4));
|
|
vo.setDateY(nowDate.substring(0, 4));
|
|
vo.setDateM(nowDate.substring(5, 7));
|
|
vo.setDateM(nowDate.substring(5, 7));
|
|
vo.setDateD(nowDate.substring(8, 10));
|
|
vo.setDateD(nowDate.substring(8, 10));
|
|
@@ -455,7 +473,12 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
sex = "女";
|
|
sex = "女";
|
|
}
|
|
}
|
|
vo.setSex(sex);
|
|
vo.setSex(sex);
|
|
- vo.setClassHours(goodsVo.getClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP )+"");
|
|
|
|
|
|
+ Integer totalHour = 0;
|
|
|
|
+ for(CourseChapterVo chapterVo : chapterList){
|
|
|
|
+ totalHour+=chapterVo.getSectionNum();
|
|
|
|
+ }
|
|
|
|
+ goodsVo.setClassHours(goodsVo.getSelfClassHours());
|
|
|
|
+ vo.setClassHours(goodsVo.getSelfClassHours()+"");
|
|
vo.setDateY(nowDate.substring(0, 4));
|
|
vo.setDateY(nowDate.substring(0, 4));
|
|
vo.setDateM(nowDate.substring(5, 7));
|
|
vo.setDateM(nowDate.substring(5, 7));
|
|
vo.setDateD(nowDate.substring(8, 10));
|
|
vo.setDateD(nowDate.substring(8, 10));
|
|
@@ -485,7 +508,12 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
sex = "女";
|
|
sex = "女";
|
|
}
|
|
}
|
|
vo.setSex(sex);
|
|
vo.setSex(sex);
|
|
- vo.setClassHours(goodsVo.getClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP )+"");
|
|
|
|
|
|
+ Integer totalHour = 0;
|
|
|
|
+ for(CourseChapterVo chapterVo : chapterList){
|
|
|
|
+ totalHour+=chapterVo.getSectionNum();
|
|
|
|
+ }
|
|
|
|
+ goodsVo.setClassHours(goodsVo.getSelfClassHours());
|
|
|
|
+ vo.setClassHours(goodsVo.getSelfClassHours()+"");
|
|
vo.setDateY(nowDate.substring(0, 4));
|
|
vo.setDateY(nowDate.substring(0, 4));
|
|
vo.setDateM(nowDate.substring(5, 7));
|
|
vo.setDateM(nowDate.substring(5, 7));
|
|
vo.setDateD(nowDate.substring(8, 10));
|
|
vo.setDateD(nowDate.substring(8, 10));
|
|
@@ -515,7 +543,13 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
sex = "女";
|
|
sex = "女";
|
|
}
|
|
}
|
|
vo.setSex(sex);
|
|
vo.setSex(sex);
|
|
- vo.setClassHours(goodsVo.getClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP )+"");
|
|
|
|
|
|
+ Integer totalHour = 0;
|
|
|
|
+ for(CourseChapterVo chapterVo : chapterList){
|
|
|
|
+ totalHour+=chapterVo.getSectionNum();
|
|
|
|
+ }
|
|
|
|
+ goodsVo.setClassHours(goodsVo.getSelfClassHours());
|
|
|
|
+ vo.setClassHours(goodsVo.getSelfClassHours()+"");
|
|
|
|
+ // vo.setClassHours(goodsVo.getClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP )+"");
|
|
vo.setDateY(nowDate.substring(0, 4));
|
|
vo.setDateY(nowDate.substring(0, 4));
|
|
vo.setDateM(nowDate.substring(5, 7));
|
|
vo.setDateM(nowDate.substring(5, 7));
|
|
vo.setDateD(nowDate.substring(8, 10));
|
|
vo.setDateD(nowDate.substring(8, 10));
|
|
@@ -661,7 +695,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
Long id = iUserCertificateService.selectMaxId();
|
|
Long id = iUserCertificateService.selectMaxId();
|
|
String nowId = Long.toString(id);
|
|
String nowId = Long.toString(id);
|
|
String result = "";
|
|
String result = "";
|
|
- result = String.format("%0" + 5 + "d", Integer.parseInt(nowId) + 1);
|
|
|
|
|
|
+ result = String.format("%05d", Integer.parseInt(nowId) + 1);
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -749,13 +783,32 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
return chapterListTxt;
|
|
return chapterListTxt;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ private String getImgDir(){
|
|
|
|
+ String tenantId = ToolsUtils.getTenantId();
|
|
|
|
+ if(tenantId.equals("694515817698614")){
|
|
|
|
+ return tenantId;
|
|
|
|
+ }else {
|
|
|
|
+ return "867735392558919680";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private Boolean haveStamp(){
|
|
|
|
+ String tenantId = ToolsUtils.getTenantId();
|
|
|
|
+ if(tenantId.equals("694515817698614")){
|
|
|
|
+ return false;
|
|
|
|
+ }else {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private String drawPic(CertificatePhotoVo entity){
|
|
private String drawPic(CertificatePhotoVo entity){
|
|
Font font = new Font("微软雅黑", Font.PLAIN, 45);// 添加字体的属性设置
|
|
Font font = new Font("微软雅黑", Font.PLAIN, 45);// 添加字体的属性设置
|
|
String projectUrl = "D:\\test\\";
|
|
String projectUrl = "D:\\test\\";
|
|
String imgName = projectUrl + "out01.jpg";
|
|
String imgName = projectUrl + "out01.jpg";
|
|
try {
|
|
try {
|
|
// 加载本地图片
|
|
// 加载本地图片
|
|
- InputStream imgStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/002.jpg");
|
|
|
|
|
|
+ InputStream imgStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/"+getImgDir()+"/002.jpg");
|
|
// String imageLocalUrl = projectUrl + "002.jpg";
|
|
// String imageLocalUrl = projectUrl + "002.jpg";
|
|
// BufferedImage imageLocal = ImageIO.read(new File(imageLocalUrl));
|
|
// BufferedImage imageLocal = ImageIO.read(new File(imageLocalUrl));
|
|
BufferedImage imageLocal = ImageIO.read(imgStream);
|
|
BufferedImage imageLocal = ImageIO.read(imgStream);
|
|
@@ -825,7 +878,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
String imgName = null;
|
|
String imgName = null;
|
|
try {
|
|
try {
|
|
// 加载本地图片
|
|
// 加载本地图片
|
|
- InputStream imgStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/003.jpg");
|
|
|
|
|
|
+ InputStream imgStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/"+getImgDir()+"/003.jpg");
|
|
// String imageLocalUrl = projectUrl + "003.jpg";
|
|
// String imageLocalUrl = projectUrl + "003.jpg";
|
|
// BufferedImage imageLocal = ImageIO.read(new File(imageLocalUrl));
|
|
// BufferedImage imageLocal = ImageIO.read(new File(imageLocalUrl));
|
|
BufferedImage imageLocal = ImageIO.read(imgStream);
|
|
BufferedImage imageLocal = ImageIO.read(imgStream);
|
|
@@ -886,7 +939,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
String imgName = null;
|
|
String imgName = null;
|
|
try {
|
|
try {
|
|
// 加载图片
|
|
// 加载图片
|
|
- InputStream imgStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/004.jpg");
|
|
|
|
|
|
+ InputStream imgStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/"+getImgDir()+"/004.jpg");
|
|
// String imageLocalUrl = projectUrl + "003.jpg";
|
|
// String imageLocalUrl = projectUrl + "003.jpg";
|
|
// BufferedImage imageLocal = ImageIO.read(new File(imageLocalUrl));
|
|
// BufferedImage imageLocal = ImageIO.read(new File(imageLocalUrl));
|
|
BufferedImage imageLocal = ImageIO.read(imgStream);
|
|
BufferedImage imageLocal = ImageIO.read(imgStream);
|
|
@@ -932,7 +985,9 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
|
|
|
|
InputStream logoStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/001.png");
|
|
InputStream logoStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/001.png");
|
|
BufferedImage logoBuffered = ImageIO.read(logoStream);
|
|
BufferedImage logoBuffered = ImageIO.read(logoStream);
|
|
- g.drawImage(logoBuffered, 1438, 2555, 529, 528, null);
|
|
|
|
|
|
+ if(haveStamp()){
|
|
|
|
+ g.drawImage(logoBuffered, 1438, 2555, 529, 528, null);
|
|
|
|
+ }
|
|
|
|
|
|
//二维码
|
|
//二维码
|
|
String qrTxt = CERTIFICATE_HOST+"pages/certificate/index?code="+entity.getCode();
|
|
String qrTxt = CERTIFICATE_HOST+"pages/certificate/index?code="+entity.getCode();
|
|
@@ -969,7 +1024,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
String imgName = null;
|
|
String imgName = null;
|
|
try {
|
|
try {
|
|
// 加载本地图片
|
|
// 加载本地图片
|
|
- InputStream imgStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/005.jpg");
|
|
|
|
|
|
+ InputStream imgStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/"+getImgDir()+"/005.jpg");
|
|
// String imageLocalUrl = projectUrl + "003.jpg";
|
|
// String imageLocalUrl = projectUrl + "003.jpg";
|
|
// BufferedImage imageLocal = ImageIO.read(new File(imageLocalUrl));
|
|
// BufferedImage imageLocal = ImageIO.read(new File(imageLocalUrl));
|
|
BufferedImage imageLocal = ImageIO.read(imgStream);
|
|
BufferedImage imageLocal = ImageIO.read(imgStream);
|
|
@@ -1028,7 +1083,9 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
|
|
|
|
InputStream logoStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/001.png");
|
|
InputStream logoStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/001.png");
|
|
BufferedImage logoBuffered = ImageIO.read(logoStream);
|
|
BufferedImage logoBuffered = ImageIO.read(logoStream);
|
|
- g.drawImage(logoBuffered, 1012, 1666, 330, 330, null);
|
|
|
|
|
|
+ if(haveStamp()){
|
|
|
|
+ g.drawImage(logoBuffered, 1012, 1666, 330, 330, null);
|
|
|
|
+ }
|
|
|
|
|
|
//二维码
|
|
//二维码
|
|
String qrTxt = CERTIFICATE_HOST+"pages/certificate/index?code="+entity.getCode();
|
|
String qrTxt = CERTIFICATE_HOST+"pages/certificate/index?code="+entity.getCode();
|
|
@@ -1064,7 +1121,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
String imgName = null;
|
|
String imgName = null;
|
|
try {
|
|
try {
|
|
// 加载本地图片
|
|
// 加载本地图片
|
|
- InputStream imgStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/006.jpg");
|
|
|
|
|
|
+ InputStream imgStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/"+getImgDir()+"/006.jpg");
|
|
// String imageLocalUrl = projectUrl + "003.jpg";
|
|
// String imageLocalUrl = projectUrl + "003.jpg";
|
|
// BufferedImage imageLocal = ImageIO.read(new File(imageLocalUrl));
|
|
// BufferedImage imageLocal = ImageIO.read(new File(imageLocalUrl));
|
|
BufferedImage imageLocal = ImageIO.read(imgStream);
|
|
BufferedImage imageLocal = ImageIO.read(imgStream);
|
|
@@ -1123,7 +1180,10 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
|
|
|
|
InputStream logoStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/001.png");
|
|
InputStream logoStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/001.png");
|
|
BufferedImage logoBuffered = ImageIO.read(logoStream);
|
|
BufferedImage logoBuffered = ImageIO.read(logoStream);
|
|
- g.drawImage(logoBuffered, 1012, 1666, 330, 330, null);
|
|
|
|
|
|
+ if(haveStamp()){
|
|
|
|
+ g.drawImage(logoBuffered, 1012, 1666, 330, 330, null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
//二维码
|
|
//二维码
|
|
String qrTxt = CERTIFICATE_HOST+"pages/certificate/index?code="+entity.getCode();
|
|
String qrTxt = CERTIFICATE_HOST+"pages/certificate/index?code="+entity.getCode();
|