he2802 1 year ago
parent
commit
adf7019300

+ 6 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/DangAnController.java

@@ -1,9 +1,12 @@
 package com.zhongzheng.controller.user;
 
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.poi.EasyPoiUtil;
@@ -173,6 +176,9 @@ public class DangAnController extends BaseController {
     @PostMapping("/userDataImportUp")
     public AjaxResult userDataImportUp(MultipartFile file) {
         List<UserDataImportBo> customerBos = EasyPoiUtil.importExcel(file,0,1,UserDataImportBo.class);
+        if (CollectionUtils.isEmpty(customerBos) || customerBos.stream().allMatch(x -> ObjectUtils.isNull(x.getUserCard()))){
+            throw new CustomException("导入文件格式不正确或文件为空,请检查文件!");
+        }
         iUserService.userDataImportUp(customerBos);
         return AjaxResult.success();
     }

+ 1 - 1
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/poi/EasyPoiUtil.java

@@ -166,7 +166,7 @@ public class EasyPoiUtil {
         } catch (NoSuchElementException e) {
             throw new RuntimeException("excel文件不能为空");
         } catch (Exception e) {
-            throw new RuntimeException(e.getMessage());
+            throw new RuntimeException("导入的文件不正确,请重新导入!");
 
         }
         return list;

+ 13 - 7
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -1755,22 +1755,28 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         }
         customerBos.forEach(item -> {
             if (StringUtils.isBlank(item.getUserCard())){
-                return;
+                throw new CustomException("身份证号码不能为空!");
             }
             User user = getOne(new LambdaQueryWrapper<User>()
                     .eq(User::getIdCard, EncryptHandler.encrypt(item.getUserCard()))
                     .eq(User::getStatus, 1));
             if (Objects.isNull(user)){
-                return;
+                throw new CustomException("用户获取失败,请检查身份证号码!");
             }
 
             //跟新用户资料
             user.setRealname(item.getUserName());
-            user.setTelphone(EncryptHandler.encrypt(item.getUserPhone()));
-            user.setSex(StringUtils.isNotBlank(item.getSex()) && item.getSex().equals("男") ? 1:2);
+            if (ObjectUtils.isNotNull(item.getUserPhone())){
+                user.setTelphone(EncryptHandler.encrypt(item.getUserPhone()));
+            }
+            if (ObjectUtils.isNotNull(item.getSex())){
+                user.setSex(StringUtils.isNotBlank(item.getSex()) && item.getSex().equals("男") ? 1:2);
+            }
             user.setEduLevel(item.getEducation());
             user.setSchool(item.getSchool());
-            user.setGraduationTime(DateUtils.formatDate(item.getGraduationTime(),"yyyy-MM-dd"));
+            if (ObjectUtils.isNotNull(item.getGraduationTime())){
+                user.setGraduationTime(DateUtils.formatDate(item.getGraduationTime(),"yyyy-MM-dd"));
+            }
             user.setMajor(item.getMajor());
             user.setWorkYear(item.getWorkYear());
             user.setCompanyName(item.getCompany());
@@ -1808,7 +1814,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 User user = getOne(new LambdaQueryWrapper<User>()
                         .eq(User::getIdCard, EncryptHandler.encrypt(idCard)));
                 if (ObjectUtils.isNull(user)){
-                    return;
+                    throw new CustomException("文件名称有误,请按命名规则修改文件名!");
                 }
 
                 //上传OSS
@@ -1825,7 +1831,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                     throw new CustomException(name+"上传oss失败");
                 }
                 if (name.toString().contains("证件照")){
-                    user.setAvatar(upload);
+                    user.setOneInchPhotos(upload);
                 }
                 if (name.toString().contains("身份证正面")){
                     user.setIdCardImg1(upload);

+ 8 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -681,12 +681,12 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         queryBo.setId(goodsVo.getBusinessId());
         String fullName = iCourseBusinessService.queryFullName(queryBo);
         if(goodsVo.getBusinessId().longValue()!=business.getId().longValue()){
-//            CourseBusiness business7 = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getId,goodsVo.getBusinessId()).last("limit 1"));
-//            if(Validator.isEmpty(business7)||(Validator.isNotEmpty(business7)&&!"七大员".equals(business7.getBusinessName()))){
-//                if(!"继续教育二级造价师".equals(fullName)){
-//                    return true;
-//                }
-//            }
+            CourseBusiness business7 = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getId,goodsVo.getBusinessId()).last("limit 1"));
+            if(Validator.isEmpty(business7)||(Validator.isNotEmpty(business7)&&!"七大员".equals(business7.getBusinessName()))){
+                if(!"继续教育二级造价师".equals(fullName)){
+                    return true;
+                }
+            }
 //            if(Validator.isNotEmpty(business7)&&"七大员".equals(business7.getBusinessName())){
 //                hasSeven = true;
 //                studyRec.setCourseType(17);
@@ -697,6 +697,8 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             if (ObjectUtils.isNotNull(sysTenant) && sysTenant.getPeriodSign() == 1){
                 hasSeven = true;
                 studyRec.setCourseType(17);
+            }else if (!"继续教育二级造价师".equals(fullName)){
+                return true;
             }
         }
         UserVo userVo = iUserService.queryById(bo.getUserId());

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserQueryBo.java

@@ -221,4 +221,10 @@ public class UserQueryBo extends BaseEntity {
 	private Long projectId;
 	private Long majorId;
 
+	@ApiModelProperty("承诺书上传:1是 0否")
+	private Integer promiseUploadSign;
+
+	@ApiModelProperty("承诺书签名:1是 0否")
+	private Integer promiseSign;
+
 }

+ 5 - 2
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -2068,9 +2068,12 @@
             AND m.id = #{majorId}
         </if>
         <if test="goodsName != null and goodsName !='' ">
-            AND g.goods_name = #{goodsName}
+            AND g.goods_name like concat('%', #{goodsName}, '%'))
         </if>
-        <if test="subscribeStatus != null and subscribeStatus != 3">
+        <if test="subscribeStatus != null and subscribeStatus != 1">
+            AND us.subscribe_status = 1 AND (TIME_TO_SEC(us.apply_site_end_time) + us.apply_site_exam_time) &gt; UNIX_TIMESTAMP()
+        </if>
+        <if test="subscribeStatus != null and subscribeStatus == 2">
             AND us.subscribe_status = #{subscribeStatus}
         </if>
         <if test="subscribeStatus != null and subscribeStatus == 3">

+ 16 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml

@@ -728,6 +728,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             LEFT JOIN order_goods og ON o.order_sn = og.order_sn
             LEFT JOIN goods g ON og.goods_id = g.goods_id WHERE o.`status` = 1 AND o.user_id = u.user_id AND og.pay_status IN ( 2, 3, 4 )  AND og.refund_status != 2 AND g.business_id = #{businessId})>0
         </if>
+        <if test="promiseUploadSign != null and promiseUploadSign == 1" >
+            AND (SELECT COUNT(up.id) FROM user_profile up WHERE up.user_id = u.user_id AND up.current_status = 1
+            AND INSTR(up.key_value,'"fieldKey":"commitment_seal","value":"oss/images/avatar') &gt; 0) &gt; 0
+        </if>
+        <if test="promiseUploadSign != null and promiseUploadSign == 0" >
+            AND (SELECT COUNT(up.id) FROM user_profile up WHERE up.user_id = u.user_id AND up.current_status = 1
+            AND INSTR(up.key_value,'"fieldKey":"commitment_seal","value":"oss/images/avatar') = 0) &gt; 0
+        </if>
+        <if test="promiseSign != null and promiseSign == 1" >
+            AND (SELECT COUNT(up.id) FROM user_profile up WHERE up.user_id = u.user_id AND up.current_status = 1
+            AND INSTR(up.key_value,'"fieldKey":"commitment_electr_signature","value":"oss/images/avatar') &gt; 0) &gt; 0
+        </if>
+        <if test="promiseSign != null and promiseSign == 0" >
+            AND (SELECT COUNT(up.id) FROM user_profile up WHERE up.user_id = u.user_id AND up.current_status = 1
+            AND INSTR(up.key_value,'"fieldKey":"commitment_electr_signature","value":"oss/images/avatar') = 0) &gt; 0
+        </if>
         order by u.user_id desc
     </select>
 

+ 3 - 4
zhongzheng-system/src/main/resources/mapper/modules/user/UserSubscribeMapper.xml

@@ -816,8 +816,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         AND usu.order_goods_id = us.order_goods_id
         AND usu.subscribe_status = 1
         ) >1
-        THEN 2
-        ELSE 0 END
+        THEN 0 ELSE NULL END
         AS applyNew
         FROM user_subscribe us
         LEFT JOIN order_goods og ON us.order_goods_id = og.order_goods_id
@@ -846,7 +845,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND m.id = #{majorId}
         </if>
         <if test="goodsName != null and goodsName !='' ">
-            AND g.goods_name = #{goodsName}
+            AND g.goods_name LIKE concat('%',#{goodsName},'%')
         </if>
         <if test="applyStatus != null ">
             AND us.result = #{applyStatus}
@@ -913,7 +912,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND m.id = #{majorId}
         </if>
         <if test="goodsName != null and goodsName !='' ">
-            AND g.goods_name = #{goodsName}
+            AND g.goods_name LIKE concat('%',#{goodsName},'%')
         </if>
     </select>