he2802 2 лет назад
Родитель
Сommit
a1af4af612

BIN
zhongzheng-common/src/main/resources/static/005.jpg


BIN
zhongzheng-common/src/main/resources/static/0051.jpg


+ 17 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -690,6 +690,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         SnowflakeIdUtils idWorker = new SnowflakeIdUtils(3, 1);
         inertData.setUserAccount(String.valueOf(idWorker.nextId()));
         inertData.setSex(1);
+        if (ObjectUtils.isNotNull(bo.getEduLevel())){
+            inertData.setEduLevel(bo.getEduLevel());
+        }
+        if (ObjectUtils.isNotNull(bo.getSex())){
+            inertData.setSex(bo.getSex());
+        }
         if (ObjectUtils.isNotNull(bo.getIdcard())){
             inertData.setIdCard(bo.getIdcard());
         }
@@ -1008,6 +1014,17 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 }else {
                     registerBo.setTel(bo.getTelphone());
                 }
+                if(Validator.isNotEmpty(bo.getSex())){
+                    if(bo.getSex().equals("男")){
+                        registerBo.setSex(1);
+                    }
+                    else if(bo.getSex().equals("女")){
+                        registerBo.setSex(2);
+                    }
+                }
+                if(Validator.isNotEmpty(bo.getEducation())){
+                    registerBo.setEduLevel(bo.getEducation());
+                }
                 registerBo.setIdcard(bo.getIdCard());
                 registerBo.setRegisterPlat("4");
                 Long userId = systemRegisterUser(registerBo);

+ 51 - 12
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateTpServiceImpl.java

@@ -194,21 +194,31 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
                 .eq(ObjectUtils.isNotNull(bo.getOrderGoodsId()),ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId())
                 .eq(ClassGradeUser::getGradeId,bo.getGradeId()).last("limit 1"));
         UserVo userVo = iUserService.queryById(bo.getUserId());
+        if(Validator.isEmpty(userVo.getRealname())){
+            throw new CustomException("生成证书姓名缺失");
+        }
         if(Validator.isNotEmpty(goodsVo.getMoreCertificateStatus())&&goodsVo.getMoreCertificateStatus()==1){
             //获取章列表
             List<CourseChapterVo> chapterList =  iClassGradeUserService.findChapterList(bo);
             BigDecimal totalTime = new BigDecimal(0);
+            BigDecimal totalClassHour = new BigDecimal(0);
             BigDecimal publicTotalTime = new BigDecimal(0);
+            BigDecimal publicClassHour = new BigDecimal(0);
             for(CourseChapterVo chapterVo : chapterList){
+                BigDecimal cTime = new BigDecimal(courseMenuMapper.countChapterTotalTime(chapterVo.getChapterId()));
                 if(Validator.isEmpty(chapterVo.getCommonSign())||chapterVo.getCommonSign()==0){
-                    totalTime=totalTime.add(new BigDecimal(courseMenuMapper.countChapterTotalTime(chapterVo.getChapterId())));
+                    totalTime=totalTime.add(cTime);
+                    totalClassHour = totalClassHour.add(cTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP).setScale( 0, BigDecimal.ROUND_HALF_UP ));
                 }else if(chapterVo.getCommonSign()==1){
-                    publicTotalTime=publicTotalTime.add(new BigDecimal(courseMenuMapper.countChapterTotalTime(chapterVo.getChapterId())));
+                    publicTotalTime=publicTotalTime.add(cTime);
+                    publicClassHour = publicClassHour.add(cTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP).setScale( 0, BigDecimal.ROUND_HALF_UP ));
                 }
 
             }
-            goodsVo.setClassHours(totalTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP));
-            goodsVo.setPublicClassHours(publicTotalTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP));
+            goodsVo.setClassHours(totalClassHour);
+            goodsVo.setPublicClassHours(publicClassHour);
+           /* goodsVo.setClassHours(totalTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP));
+            goodsVo.setPublicClassHours(publicTotalTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP));*/
             if(Validator.isNotEmpty(goodsVo.getCertificateTpId())){
                 //        String[] s = goodsVo.getCertificateIds().split(",");
                 List<Long> tpIds = new ArrayList<>();
@@ -242,10 +252,13 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
                     //获取章列表
                     List<CourseChapterVo> chapterList =  iClassGradeUserService.findChapterList(bo);
                     BigDecimal totalTime = new BigDecimal(0);
+                    BigDecimal totalClassHour = new BigDecimal(0);
                     for(CourseChapterVo chapterVo : chapterList){
-                        totalTime=totalTime.add(new BigDecimal(courseMenuMapper.countChapterTotalTime(chapterVo.getChapterId())));
+                        BigDecimal cTime = new BigDecimal(courseMenuMapper.countChapterTotalTime(chapterVo.getChapterId()));
+                        totalTime=totalTime.add(cTime);
+                        totalClassHour = totalClassHour.add(cTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP).setScale( 0, BigDecimal.ROUND_HALF_UP ));
                     }
-                    goodsVo.setClassHours(totalTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP));
+                    goodsVo.setClassHours(totalClassHour);
                     List<Long> tpIds = new ArrayList<>();
                     if(Validator.isNotEmpty(moduleVo.getCertificateTpId())){
                         tpIds.add(moduleVo.getCertificateTpId());
@@ -611,9 +624,17 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
         addBo.setTrainStartTime(vo.getTrainStartTime());
         addBo.setTrainEndTime(vo.getTrainEndTime());
         addBo.setChapterStr(ArrayUtils.toString(vo.getChapterList(), ","));
+<<<<<<< HEAD
         addBo.setMoreCertificateStatus(goodsVo.getMoreCertificateStatus());
         addBo.setModuleId(moduleId);
         addBo.setPublicClassHours(goodsVo.getPublicClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP ));
+=======
+        if(Validator.isEmpty(goodsVo.getPublicClassHours())){
+            addBo.setPublicClassHours(BigDecimal.ZERO);
+        }else{
+            addBo.setPublicClassHours(goodsVo.getPublicClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP ));
+        }
+>>>>>>> zs09
         return addBo;
     }
     private String getCertificateCode(){
@@ -703,6 +724,9 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             else if(i==13){
                 numTag = "14. ";
             }
+            else if(i==14){
+                numTag = "15. ";
+            }
             chapterListTxt.add(numTag+chapterList.get(i).getName());
         }
         return chapterListTxt;
@@ -924,6 +948,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
     private  String drawPicErZao(CertificatePhotoVo entity){
         Font font = new Font("微软雅黑", Font.PLAIN, 31);// 添加字体的属性设置 微软雅黑
         Font font2 = new Font("微软雅黑", Font.BOLD, 38);
+        Font font3 = new Font("微软雅黑", Font.PLAIN, 28);
         String imgName = null;
         try {
             // 加载本地图片
@@ -951,7 +976,13 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             if("必修".equals(entity.getMajor())){
                 g.drawString(entity.getMajor(), 768, 718);
             }else{
+<<<<<<< HEAD
                 g.drawString("选修("+entity.getMajor()+")", 677, 718);
+=======
+                g.setFont(font3);
+                g.drawString("选修("+entity.getMajor()+")", 675, 718);
+                g.setFont(font);
+>>>>>>> zs09
             }
 
 
@@ -965,7 +996,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             Integer startY = 810;
             Integer j = 0;
             for(String name : entity.getChapterList()){
-                if(j<6){
+                if(j<15){
                     g.drawString(name, 300, startY);
                     startY+=50;
                 }else{
@@ -991,10 +1022,10 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             //二维码
             String qrTxt = CERTIFICATE_HOST+"pages/certificate/index?code="+entity.getCode();
             QRCodeWriter qrCodeWriter = new QRCodeWriter();
-            BitMatrix bitMatrix = qrCodeWriter.encode(qrTxt, BarcodeFormat.QR_CODE, 150, 150);
+            BitMatrix bitMatrix = qrCodeWriter.encode(qrTxt, BarcodeFormat.QR_CODE, 180, 180);
             BufferedImage qrImage = toBufferedImage(bitMatrix);
             // 在模板上添加用户二维码(地址,左边距,上边距,图片宽度,图片高度,未知)
-            g.drawImage(qrImage, 1233, 175, 150, 150, null);
+            g.drawImage(qrImage, 1209, 145, 180, 180, null);
             // 完成模板修改
             g.dispose();
             // 获取新文件的地址
@@ -1019,6 +1050,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
     private  String drawPicErJian(CertificatePhotoVo entity){
         Font font = new Font("微软雅黑", Font.PLAIN, 31);// 添加字体的属性设置 微软雅黑
         Font font2 = new Font("微软雅黑", Font.BOLD, 38);
+        Font font3 = new Font("微软雅黑", Font.PLAIN, 28);
         String imgName = null;
         try {
             // 加载本地图片
@@ -1046,7 +1078,14 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             if("必修".equals(entity.getMajor())){
                 g.drawString(entity.getMajor(), 768, 718);
             }else{
+<<<<<<< HEAD
                 g.drawString("选修("+entity.getMajor()+")", 677, 718);
+=======
+                g.setFont(font3);
+                g.drawString("选修("+entity.getMajor()+")", 675, 718);
+                g.setFont(font);
+
+>>>>>>> zs09
             }
 
 
@@ -1060,7 +1099,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             Integer startY = 810;
             Integer j = 0;
             for(String name : entity.getChapterList()){
-                if(j<14){
+                if(j<15){
                     g.drawString(name, 300, startY);
                     startY+=50;
                 }else{
@@ -1086,10 +1125,10 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             //二维码
             String qrTxt = CERTIFICATE_HOST+"pages/certificate/index?code="+entity.getCode();
             QRCodeWriter qrCodeWriter = new QRCodeWriter();
-            BitMatrix bitMatrix = qrCodeWriter.encode(qrTxt, BarcodeFormat.QR_CODE, 150, 150);
+            BitMatrix bitMatrix = qrCodeWriter.encode(qrTxt, BarcodeFormat.QR_CODE, 180, 180);
             BufferedImage qrImage = toBufferedImage(bitMatrix);
             // 在模板上添加用户二维码(地址,左边距,上边距,图片宽度,图片高度,未知)
-            g.drawImage(qrImage, 1233, 175, 150, 150, null);
+            g.drawImage(qrImage, 1209, 145, 180, 180, null);
             // 完成模板修改
             g.dispose();
             // 获取新文件的地址

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java

@@ -512,6 +512,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
                         if(Validator.isNotEmpty(user2)){
                             throw new CustomException("身份证号码已存在,创建失败");
                         }
+                        idcard = idcard.trim();
                         objectLambdaUpdateWrapper.set(User::getIdCard, idcard);
                     }
                 }
@@ -525,6 +526,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
                         if(Validator.isNotEmpty(user2)){
                             throw new CustomException("手机号码已存在,创建失败");
                         }
+                        telphone = telphone.trim();
                         objectLambdaUpdateWrapper.set(User::getTelphone, telphone);
                     }
                 }
@@ -533,6 +535,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
                 name = JSONObject.parseObject(String.valueOf(maps.get("name")), UserProfileFit.class).getValue();
                 if(Validator.isNotEmpty(name)){
                     if(Validator.isNotEmpty(user)&&Validator.isEmpty(user.getRealname())) { //姓名为空是覆盖
+                        name = name.trim();
                         objectLambdaUpdateWrapper.set(User::getRealname, name);
                     }
 

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseChapterVo.java

@@ -7,6 +7,8 @@ import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -85,4 +87,5 @@ public class CourseChapterVo {
 	private Integer commonSign;
 	@ApiModelProperty("节总时间")
 	private Long totalTime;
+
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserIdCardAddBo.java

@@ -29,4 +29,8 @@ public class UserIdCardAddBo {
     /** 公司名称 */
     @ApiModelProperty("公司名称")
     private String companyName;
+    @ApiModelProperty("教育")
+    public String education;
+    @ApiModelProperty("性别")
+    public String sex;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserSystemRegisterBo.java

@@ -27,5 +27,7 @@ public class UserSystemRegisterBo {
     /** 公司名称 */
     @ApiModelProperty("公司名称")
     private String companyName;
+    private Integer sex;
+    private String eduLevel;
 
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserCertificateMapper.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.user.mapper;
 
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.user.bo.UserCertificateQueryBo;
 import com.zhongzheng.modules.user.domain.UserCertificate;
@@ -16,5 +17,6 @@ import java.util.List;
 public interface UserCertificateMapper extends BaseMapper<UserCertificate> {
     Long selectMaxId();
     List<UserCertificateVo> selectList(UserCertificateQueryBo bo);
+    @InterceptorIgnore(tenantLine = "true")
     UserCertificateVo selectDetail(UserCertificateQueryBo code);
 }

+ 45 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserCertificateServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.mapper.CourseMenuMapper;
 import com.zhongzheng.modules.course.service.IMajorService;
 import com.zhongzheng.modules.course.vo.CourseChapterVo;
@@ -85,6 +86,9 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateMappe
         if(Validator.isEmpty(userCertificateVo)){
             throw new CustomException("证书不存在");
         }
+        if(Validator.isNotEmpty(userCertificateVo.getTenantId())){
+            ServletUtils.getResponse().setHeader("TenantId",userCertificateVo.getTenantId());
+        }
         MajorVo majorVo = iMajorService.queryById(userCertificateVo.getMajorId());
         if(Validator.isEmpty(majorVo)){
             throw new CustomException("专业不存在");
@@ -102,6 +106,47 @@ public class UserCertificateServiceImpl extends ServiceImpl<UserCertificateMappe
             chapterVo.setTotalTime(secTotalTime);
         }
         userCertificateVo.setChapterList(chapterList);
+        if(userCertificateVo.getKeyValue().equals("certificate01")){
+            userCertificateVo.setMajorType("继续教育(专业)");
+        }
+        else if(userCertificateVo.getKeyValue().equals("certificate02")){
+            userCertificateVo.setMajorType("继续教育(选修)");
+        }
+        else if(userCertificateVo.getKeyValue().equals("certificate03")){
+            userCertificateVo.setMajorType("一级注册建造师(必修)");
+        }
+        else if(userCertificateVo.getKeyValue().equals("certificate04")){
+            userCertificateVo.setMajorType("一级注册建造师(选修)");
+        }
+        else if(userCertificateVo.getKeyValue().equals("certificate05")){
+            userCertificateVo.setMajorType("一级注册建造师(选修)");
+        }
+        else if(userCertificateVo.getKeyValue().equals("certificate06")){
+            userCertificateVo.setMajorType("一级注册建造师(选修)");
+        }
+        else if(userCertificateVo.getKeyValue().equals("certificate07")){
+            userCertificateVo.setMajorType("一级注册建造师(选修)");
+        }
+        else if(userCertificateVo.getKeyValue().equals("certificate08")){
+            userCertificateVo.setMajorType("一级注册建造师(选修)");
+        }
+        else if(userCertificateVo.getKeyValue().equals("certificate09")){
+            userCertificateVo.setMajorType("施工现场专业人员继续教育");
+        }
+        else if(userCertificateVo.getKeyValue().equals("certificate10")){
+            if(Validator.isNotEmpty(userCertificateVo.getMajor())&&userCertificateVo.getMajor().equals("必修")){
+                userCertificateVo.setMajorType("二级注册造价师(必修)");
+            }else{
+                userCertificateVo.setMajorType("二级注册造价师(选修)");
+            }
+        }
+        else if(userCertificateVo.getKeyValue().equals("certificate11")){
+            if(Validator.isNotEmpty(userCertificateVo.getMajor())&&userCertificateVo.getMajor().equals("必修")){
+                userCertificateVo.setMajorType("二级注册建造师(必修)");
+            }else{
+                userCertificateVo.setMajorType("二级注册建造师(选修)");
+            }
+        }
         return userCertificateVo;
     }
 

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserCertificateVo.java

@@ -129,4 +129,11 @@ public class UserCertificateVo {
 	@ApiModelProperty("专业")
 	private String major;
 
+<<<<<<< HEAD
+=======
+	private String tenantId;
+
+	@ApiModelProperty("专业类型")
+	private String majorType;
+>>>>>>> zs09
 }

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserCertificateMapper.xml

@@ -59,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="chapterStr" column="chapter_str"/>
         <result property="moduleId" column="module_id"/>
         <result property="moreCertificateStatus" column="more_certificate_status"/>
+        <result property="tenantId" column="tenant_id"/>
     </resultMap>
 
     <select id="selectMaxId"   resultType="Long">