he2802 2 năm trước cách đây
mục cha
commit
ff61c57e6a
43 tập tin đã thay đổi với 712 bổ sung151 xóa
  1. 13 23
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/activity/ActivityRecommendController.java
  2. 38 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionController.java
  3. 11 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java
  4. 26 4
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java
  5. 1 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/system/SysLoginController.java
  6. 5 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/system/SysProfileController.java
  7. 17 4
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/system/SysUserController.java
  8. 47 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/SmsController.java
  9. 1 0
      zhongzheng-admin/src/main/resources/application-trial.yml
  10. 9 6
      zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java
  11. 9 2
      zhongzheng-api/src/main/java/com/zhongzheng/controller/order/OrderController.java
  12. 18 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserController.java
  13. 1 0
      zhongzheng-api/src/main/resources/application-trial.yml
  14. 2 0
      zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/entity/SysUser.java
  15. 5 0
      zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/model/LoginBody.java
  16. 3 2
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/mybatisplus/CustomTenantLineHandler.java
  17. 26 2
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/SysLoginService.java
  18. 15 5
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java
  19. 4 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/domain/ActivityOrder.java
  20. 3 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/service/impl/ActivityRecommendServiceImpl.java
  21. 4 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionService.java
  22. 132 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java
  23. 25 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionImportContentV3.java
  24. 54 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionImportV3.java
  25. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java
  26. 33 16
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  27. 15 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  28. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java
  29. 14 14
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java
  30. 1 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderService.java
  31. 127 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java
  32. 5 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/IScheduleService.java
  33. 16 37
      zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java
  34. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/system/service/impl/SysUserServiceImpl.java
  35. 5 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/system/service/impl/SysWebServiceImpl.java
  36. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserAddBo.java
  37. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserAppRegisterBo.java
  38. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserEditBo.java
  39. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/User.java
  40. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserVo.java
  41. 2 2
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml
  42. 2 0
      zhongzheng-system/src/main/resources/mapper/modules/system/SysUserMapper.xml
  43. 1 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml

+ 13 - 23
zhongzheng-admin/src/main/java/com/zhongzheng/controller/activity/ActivityRecommendController.java

@@ -1,35 +1,25 @@
 package com.zhongzheng.controller.activity;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Arrays;
-
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.enums.BusinessType;
 import com.zhongzheng.modules.activity.bo.ActivityRecommendAddBo;
 import com.zhongzheng.modules.activity.bo.ActivityRecommendEditBo;
-import com.zhongzheng.modules.activity.bo.ActivityRecommendGoodsEditBo;
 import com.zhongzheng.modules.activity.bo.ActivityRecommendQueryBo;
-import com.zhongzheng.modules.activity.service.IActivityRecommendGoodsService;
 import com.zhongzheng.modules.activity.service.IActivityRecommendService;
 import com.zhongzheng.modules.activity.vo.ActivityRecommendVo;
-import lombok.RequiredArgsConstructor;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.zhongzheng.common.annotation.Log;
-import com.zhongzheng.common.core.controller.BaseController;
-import com.zhongzheng.common.core.domain.AjaxResult;
-import com.zhongzheng.common.enums.BusinessType;
-import com.zhongzheng.common.utils.poi.ExcelUtil;
-import com.zhongzheng.common.core.page.TableDataInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * 商品推荐Controller

+ 38 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionController.java

@@ -222,6 +222,44 @@ public class QuestionController extends BaseController {
         return AjaxResult.success(rs);
     }
 
+    @Log(title = "题目管理", businessType = BusinessType.IMPORT)
+    @ApiOperation("导入旧系统题目模板返回数组")
+    @PreAuthorize("@ss.hasPermi('system:question:import')")
+    @PostMapping("/importDataBackFromOldList")
+    public AjaxResult<Map<String, Object>> importDataBackFromOldList(MultipartFile file) throws Exception
+    {
+        List<QuestionImportV3> questionList2 =EasyPoiUtil.importExcel(file,0,1,QuestionImportV3.class);
+
+        ExcelUtil<QuestionImportV3> util = new ExcelUtil<QuestionImportV3>(QuestionImportV3.class);
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        String operName = loginUser.getUsername();
+        //只返回数据不插入数据库
+        Map<String, Object> rs = iQuestionService.importExcelQuestionV3NotInBankFromOld(questionList2, false, operName);
+        List<QuestionImportV3> errorList = (List<QuestionImportV3>)rs.get("errorList");
+        List<QuestionAddBo> nqList = (List<QuestionAddBo>)rs.get("questionList");
+        if(Validator.isNotEmpty(errorList)&&errorList.size()>0){
+            List<QuestionImportV3> errorListExport = new ArrayList<>();
+            for(QuestionImportV3 qi : errorList){
+                QuestionImportV3 item = BeanUtil.toBean(qi, QuestionImportV3.class);
+                errorListExport.add(item);
+            }
+            ExcelUtil<QuestionImportV3> util1 = new ExcelUtil<QuestionImportV3>(QuestionImportV3.class);
+            String timeStr= LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+            rs.put("errorExcel",util.exportEasyExcel(util1.exportEasyData(errorListExport), "导出错误数据"+timeStr));
+            rs.remove("errorList");
+        }
+        if(errorList.size()>0&&nqList.size()>0){
+            rs.put("fullStatus","部分成功");
+        }
+        else if(errorList.size()==0){
+            rs.put("fullStatus","全部成功");
+        }
+        else{
+            rs.put("fullStatus","失败");
+        }
+        return AjaxResult.success(rs);
+    }
+
     @Log(title = "导入题目Word模板", businessType = BusinessType.IMPORT)
     @ApiOperation("导入题目Word模板")
     @PreAuthorize("@ss.hasPermi('system:question:import')")

+ 11 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -31,6 +31,7 @@ import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.system.bo.SysTenantAdminBo;
 import com.zhongzheng.modules.system.domain.SysTenant;
+import com.zhongzheng.modules.system.service.ISysConfigService;
 import com.zhongzheng.modules.system.service.ISysTenantService;
 import com.zhongzheng.modules.system.service.ISysWebService;
 import com.zhongzheng.modules.system.vo.SysTenantVo;
@@ -96,6 +97,8 @@ public class CommonController
     private  ITopSysTenantRegisterService iTopSysTenantRegisterService;
     @Autowired
     private  ISysWebService webService;
+    @Autowired
+    private ISysConfigService configService;
     /**
      * 通用下载请求
      *
@@ -298,7 +301,7 @@ public class CommonController
     public AjaxResult<Void> testGrade()
     {
      //   iClassGradeService.checkEjjjPeopleNumLimit(195L,984L);
-        iUserService.batchUpdateTelId();
+     //   iUserService.batchUpdateTelId();
         return AjaxResult.success();
     }
 
@@ -369,4 +372,11 @@ public class CommonController
         iTopSysTenantRegisterService.test(new TopSysTenantRegisterAddBo());
         return AjaxResult.success();
     }*/
+
+    @ApiOperation("登录双重验证")
+    @GetMapping("common/free/dual_auth")
+    public AjaxResult<String> dual_auth() {
+        String dualAuth = configService.selectConfigByKey("login.dual.auth");
+        return AjaxResult.success("成功",dualAuth);
+    }
 }

+ 26 - 4
zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java

@@ -5,21 +5,22 @@ import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.framework.web.service.AsyncService;
 import com.zhongzheng.framework.web.service.WxLoginService;
 import com.zhongzheng.modules.exam.bo.ExamApplyQueryBo;
-import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
 import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
 import com.zhongzheng.modules.schedule.service.IScheduleService;
 import com.zhongzheng.modules.user.bo.UserQueryBo;
 import com.zhongzheng.modules.user.bo.UserWxFollowQueryBo;
-import com.zhongzheng.modules.user.service.IUserWxFollowService;
 import com.zhongzheng.modules.wx.bo.WxLoginBody;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.text.ParseException;
+import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -395,4 +396,25 @@ public class ScheduleController extends BaseController {
         return AjaxResult.success();
     }
 
+    @ApiOperation("同步机构商品")
+    @GetMapping("/synchronization/goods")
+    public AjaxResult synchronizationGoods(){
+        //湛江云学堂 972001468256950403
+        //茂名市建设培训学校 680980002459417532
+        //肇庆市建筑业协会 480813706424615769
+//        List<String> tenantIds = Arrays.asList("972001468256950403", "680980002459417532", "480813706424615769");
+        List<String> tenantIds = Arrays.asList("393436084591672437");
+        tenantIds.forEach(tenantId -> {
+            iScheduleService.synchronizationGoodsByTenantId(tenantId);
+        });
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("处理商品关联")
+    @GetMapping("/goods/dispose")
+    public AjaxResult goodsDispose(){
+        iScheduleService.goodsDispose();
+        return AjaxResult.success();
+    }
+
 }

+ 1 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/system/SysLoginController.java

@@ -84,7 +84,7 @@ public class SysLoginController
         AjaxResult ajax = AjaxResult.success();
         // 生成令牌
         String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
-                loginBody.getUuid());
+                loginBody.getUuid(),loginBody.getSmsCode(),loginBody.getPhonenumber());
         ajax.put(Constants.TOKEN, token);
         return ajax;
     }

+ 5 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/system/SysProfileController.java

@@ -9,8 +9,10 @@ import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.domain.entity.SysUser;
 import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.common.utils.file.FileUploadUtils;
 import com.zhongzheng.framework.web.service.TokenService;
 import com.zhongzheng.modules.system.service.ISysUserService;
@@ -94,6 +96,9 @@ public class SysProfileController extends BaseController
         {
             return AjaxResult.error("修改密码失败,旧密码错误");
         }
+        if(!ToolsUtils.verifPwd(newPassword)){
+            throw new CustomException("密码应由8-16位数字、大小写字母、符号组成");
+        }
         if (SecurityUtils.matchesPassword(newPassword, password))
         {
             return AjaxResult.error("新密码不能与旧密码相同");

+ 17 - 4
zhongzheng-admin/src/main/java/com/zhongzheng/controller/system/SysUserController.java

@@ -18,10 +18,7 @@ import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.exception.user.UserPasswordNotMatchException;
-import com.zhongzheng.common.utils.MessageUtils;
-import com.zhongzheng.common.utils.SecurityUtils;
-import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.common.utils.ToolsUtils;
+import com.zhongzheng.common.utils.*;
 import com.zhongzheng.common.utils.poi.ExcelUtil;
 import com.zhongzheng.framework.manager.AsyncManager;
 import com.zhongzheng.framework.manager.factory.AsyncFactory;
@@ -168,6 +165,7 @@ public class SysUserController extends BaseController
             throw new CustomException("密码应由8-16位数字、大小写字母、符号组成");
         }
         user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
+        user.setPwdTime(DateUtils.getNowTime());
         return toAjax(userService.insertUser(user));
     }
 
@@ -224,6 +222,7 @@ public class SysUserController extends BaseController
                 throw new CustomException("密码应由8-16位数字、大小写字母、符号组成");
             }
             user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
+            user.setPwdTime(DateUtils.getNowTime());
         }
         user.setUpdateBy(SecurityUtils.getUsername());
         int result = userService.updateUser(user);
@@ -292,4 +291,18 @@ public class SysUserController extends BaseController
         List<SysUser> list = userService.queryBusinessPeopleList(bo);
         return getDataTable(list);
     }
+
+    @ApiOperation("检查密码修改时间")
+    @PreAuthorize("@ss.hasPermi('system:user:list')")
+    @GetMapping("/checkPwdTime")
+    public AjaxResult<Boolean> checkPwdTime()
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        SysUser user = userService.selectUserById(loginUser.getUser().getUserId());
+        boolean needUpdate = false;
+        if(Validator.isNotEmpty(user.getPwdTime())&&(DateUtils.getNowTime().longValue()-user.getPwdTime().longValue())>90*24*3600){
+            needUpdate = true;
+        }
+        return AjaxResult.success(needUpdate);
+    }
 }

+ 47 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/SmsController.java

@@ -0,0 +1,47 @@
+package com.zhongzheng.controller.user;
+
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.modules.alisms.bo.SmsAddBo;
+import com.zhongzheng.modules.alisms.service.IAliSmsService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 客户端用户Controller
+ *
+ * @author hjl
+ * @date 2021-06-08
+ */
+@Api(value = "短信控制器", tags = {"短信控制器"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/app/common/sms")
+public class SmsController extends BaseController {
+
+    private final IAliSmsService iSmsService;
+
+
+    @ApiOperation("获取注册短信")
+    @PostMapping("/register")
+    public AjaxResult register(@RequestBody SmsAddBo bo) {
+        iSmsService.sendRegisterSms(bo.getTel());
+        return AjaxResult.success();
+    }
+
+
+    @ApiOperation("获取登录短信")
+    @PostMapping("/login")
+    public AjaxResult login(@RequestBody SmsAddBo bo) {
+        iSmsService.sendLoginSms(bo.getTel());
+        return AjaxResult.success();
+    }
+
+
+}

+ 1 - 0
zhongzheng-admin/src/main/resources/application-trial.yml

@@ -138,6 +138,7 @@ oldStudySys:
     shareCanclePath: https://www.xyyxt.net/witsystem/dataapi/ordercance
     searchGradeCount: https://www.xyyxt.net/System/BussinessApi/OfficialGradeCount
     pushGradeCount: https://www.xyyxt.net/System/BussinessApi/OfficialGradeCountAuto
+    educationalInspector: https://zs.gdzzkj.net/EduSystem/BusinessApi/NewYxtUserPrompt
     classUserListPath: https://www.xyyxt.net/System/BussinessApi/UserCourseCategoryListcno
     classOpenPath: https://www.xyyxt.net/System/BussinessApi/OpenClass
 

+ 9 - 6
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java

@@ -1,7 +1,6 @@
 package com.zhongzheng.controller.cmmon;
 
 import cn.hutool.core.lang.Validator;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.page.TableDataInfo;
@@ -17,10 +16,6 @@ import com.zhongzheng.modules.course.service.ICourseTopicService;
 import com.zhongzheng.modules.course.vo.CourseTopicGoodsVo;
 import com.zhongzheng.modules.course.vo.CourseTopicVo;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
-import com.zhongzheng.modules.exam.bo.ExamActivityApplyBo;
-import com.zhongzheng.modules.exam.bo.ExamActivityApplyVo;
-import com.zhongzheng.modules.exam.service.IExamActivityService;
-import com.zhongzheng.modules.exam.vo.ExamActivityVo;
 import com.zhongzheng.modules.goods.service.IGoodsSpecTemplateService;
 import com.zhongzheng.modules.goods.vo.GoodsSpecTemplateVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserVo;
@@ -29,7 +24,6 @@ import com.zhongzheng.modules.order.domain.Printer;
 import com.zhongzheng.modules.system.bo.SysTenantQueryBo;
 import com.zhongzheng.modules.system.service.ISysConfigService;
 import com.zhongzheng.modules.system.service.ISysTenantService;
-import com.zhongzheng.modules.system.service.ISysWebService;
 import com.zhongzheng.modules.wx.bo.WxInfoBo;
 import com.zhongzheng.modules.wx.bo.WxInfoQuery;
 import com.zhongzheng.modules.wx.bo.WxServerBody;
@@ -269,4 +263,13 @@ public class CommonController extends BaseController {
     }
 
 
+    /**
+     * 领取题库活动校验
+     */
+    @ApiOperation("领取题库活动校验")
+    @GetMapping("/check")
+    public AjaxResult<Void> checkTime() {
+        return toAjax(iCourseService.checkTime()? 1 : 0);
+    }
+
 }

+ 9 - 2
zhongzheng-api/src/main/java/com/zhongzheng/controller/order/OrderController.java

@@ -5,7 +5,6 @@ import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
-import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.framework.web.service.WxTokenService;
 import com.zhongzheng.modules.base.vo.BaseFilterVo;
@@ -16,7 +15,6 @@ import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderListVo;
-import com.zhongzheng.modules.order.vo.OrderVo;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -110,6 +108,15 @@ public class OrderController extends BaseController {
         return AjaxResult.success(iOrderService.placeGzhOrder(bo));
     }
 
+    @ApiOperation("领取活动商品")
+    @PostMapping("/activity/goods")
+    public AjaxResult getActivityGoods(@RequestBody OrderAddBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        return AjaxResult.success(iOrderService.getActivityGoods(bo));
+    }
+
+
     @ApiOperation("继续支付小程序订单")
     @PostMapping("/resumeSmallOrder")
     public AjaxResult resumeSmallOrder(@RequestBody OrderAddBo bo) {

+ 18 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserController.java

@@ -4,7 +4,10 @@ import cn.hutool.core.lang.Validator;
 import com.zhongzheng.common.annotation.Log;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.domain.entity.SysUser;
+import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.framework.web.service.WxTokenService;
 import com.zhongzheng.modules.user.bo.*;
@@ -19,6 +22,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
@@ -139,4 +143,18 @@ public class UserController extends BaseController {
         bo.setUserId(loginUser.getUser().getUserId());
         return toAjax(iUserService.editShareActivityCode(bo) ? 1 : 0);
     }
+
+    @ApiOperation("检查密码修改时间")
+    @PreAuthorize("@ss.hasPermi('system:user:list')")
+    @GetMapping("/checkPwdTime")
+    public AjaxResult<Boolean> checkPwdTime()
+    {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        UserVo userVo = iUserService.queryById(loginUser.getUser().getUserId());
+        boolean needUpdate = false;
+        if(Validator.isNotEmpty(userVo.getPwdTime())&&(DateUtils.getNowTime().longValue()-userVo.getPwdTime().longValue())>90*24*3600){
+            needUpdate = true;
+        }
+        return AjaxResult.success(needUpdate);
+    }
 }

+ 1 - 0
zhongzheng-api/src/main/resources/application-trial.yml

@@ -150,6 +150,7 @@ oldStudySys:
     shareCanclePath: https://www.xyyxt.net/witsystem/dataapi/ordercance
     searchGradeCount: https://www.xyyxt.net/System/BussinessApi/OfficialGradeCount
     pushGradeCount: https://www.xyyxt.net/System/BussinessApi/OfficialGradeCountAuto
+    educationalInspector: https://zs.gdzzkj.net/EduSystem/BusinessApi/NewYxtUserPrompt
     classUserListPath: https://www.xyyxt.net/System/BussinessApi/UserCourseCategoryListcno
     classOpenPath: https://www.xyyxt.net/System/BussinessApi/OpenClass
 

+ 2 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/entity/SysUser.java

@@ -165,6 +165,8 @@ public class SysUser implements Serializable
     private String preLoginIp;
     /** 上一次登录时间 */
     private Date preLoginDate;
+    /** 密码最后修改时间 */
+    private Long pwdTime;
 
     public SysUser(Long userId)
     {

+ 5 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/model/LoginBody.java

@@ -40,4 +40,9 @@ public class LoginBody
     @ApiModelProperty(value ="验证码uuid",required = true)
     private String uuid = "";
 
+    @ApiModelProperty(value ="短信验证码")
+    private String smsCode;
+
+    @ApiModelProperty(value ="手机号码")
+    private String phonenumber;
 }

+ 3 - 2
zhongzheng-framework/src/main/java/com/zhongzheng/framework/mybatisplus/CustomTenantLineHandler.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.framework.mybatisplus;
 
+import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpStatus;
 import com.alibaba.fastjson.JSON;
@@ -66,10 +67,10 @@ public class CustomTenantLineHandler implements TenantLineHandler {
     @Override
     public Expression getTenantId() {
         String TenantId = ServletUtils.getRequest().getHeader("TenantId");
-        if(!StrUtil.isNotBlank(TenantId)||TenantId==null){
+        if(Validator.isEmpty(TenantId)){
             TenantId = ServletUtils.getResponse().getHeader("TenantId");
             if(enabledTenant){
-                if(!StrUtil.isNotBlank(TenantId)||TenantId==null){
+                if(Validator.isEmpty(TenantId)){
                     int code = HttpStatus.HTTP_UNAVAILABLE;
                     String msg = "企业非法访问";
                     ServletUtils.renderString( ServletUtils.getResponse(), JSON.toJSONString(AjaxResult.error(code, msg)));

+ 26 - 2
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/SysLoginService.java

@@ -8,10 +8,12 @@ import com.zhongzheng.common.core.domain.entity.SysUser;
 import com.zhongzheng.common.core.domain.model.LoginBody;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.framework.manager.factory.AsyncFactory;
+import com.zhongzheng.modules.system.service.ISysConfigService;
 import com.zhongzheng.modules.system.service.ISysUserService;
 import com.zhongzheng.common.utils.AES;
 import com.zhongzheng.framework.manager.factory.AsyncFactory;
 import com.zhongzheng.modules.user.bo.UserBusinessLoginBo;
+import com.zhongzheng.modules.user.service.IUserLoginErrorService;
 import org.apache.commons.compress.utils.IOUtils;
 import org.bouncycastle.jcajce.provider.asymmetric.rsa.RSAUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -53,8 +55,11 @@ public class SysLoginService
     @Autowired
     private ISysUserService iSysUserService;
 
+    @Autowired
+    private ISysConfigService configService;
 
-
+    @Autowired
+    private IUserLoginErrorService iUserLoginErrorService;
     /**
      * 登录验证
      *
@@ -64,7 +69,7 @@ public class SysLoginService
      * @param uuid 唯一标识
      * @return 结果
      */
-    public String login(String username, String password, String code, String uuid)
+    public String login(String username, String password, String code, String uuid,String smsCode,String tel)
     {
         String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
         String captcha = redisCache.getCacheObject(verifyKey);
@@ -79,6 +84,7 @@ public class SysLoginService
             AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
             throw new CaptchaException();
         }
+        iUserLoginErrorService.checkLimit(username);
         // 用户验证
         Authentication authentication = null;
         try
@@ -101,6 +107,7 @@ public class SysLoginService
         }
         catch (Exception e)
         {
+            iUserLoginErrorService.saveErrorLog(username);
             if (e instanceof BadCredentialsException)
             {
                 AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
@@ -115,6 +122,23 @@ public class SysLoginService
         AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
         LoginUser loginUser = (LoginUser) authentication.getPrincipal();
         SysUser user = iSysUserService.updateLoginTimeIp(loginUser.getUser().getUserId());
+        String dualAuth = configService.selectConfigByKey("login.dual.auth");
+        if(Validator.isNotEmpty(dualAuth)&&dualAuth.equals("1")){
+            if(Validator.isEmpty(tel)){
+                throw new CustomException("手机号码不能为空");
+            }
+            String key = Constants.LOGIN_SMS + tel;
+            String localSmsCode =  redisCache.getCacheObject(key);
+            if(smsCode==null){
+                throw new CustomException("验证码不能为空");
+            }
+            if(!localSmsCode.equals(smsCode)){
+                throw new CustomException("验证码错误");
+            }
+            if(!tel.equals(user.getPhonenumber())){
+                throw new CustomException("手机号码和登录账号不匹配");
+            }
+        }
         loginUser.setUser(user);
         // 生成token
         return tokenService.createToken(loginUser);

+ 15 - 5
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -676,7 +676,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
 
     @Override
     public Boolean registerUser(UserAppRegisterBo bo) {
-        if(StringUtils.isBlank(bo.getIdcard())){
+        if(StringUtils.isBlank(bo.getIdcard()) &&(ObjectUtils.isNull(bo.getIsActivity()) || bo.getIsActivity() == 0)){
             throw new CustomException("身份证不能为空");
         }
         if(bo.getTel()==null){
@@ -701,10 +701,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         if(Validator.isNotNull(user)){
             throw new CustomException("该手机号已注册");
         }
-        User userIdCard = getOne(new LambdaQueryWrapper<User>()
-                .eq(User::getIdCard,EncryptHandler.encrypt(bo.getIdcard())).last("limit 1"));
-        if(Validator.isNotNull(userIdCard)){
-            throw new CustomException("该身份证已注册");
+        if (ObjectUtils.isNull(bo.getIsActivity()) || bo.getIsActivity() == 0){
+            User userIdCard = getOne(new LambdaQueryWrapper<User>()
+                    .eq(User::getIdCard,EncryptHandler.encrypt(bo.getIdcard())).last("limit 1"));
+            if(Validator.isNotNull(userIdCard)){
+                throw new CustomException("该身份证已注册");
+            }
         }
         User inertData = new User();
         inertData.setTelphone(bo.getTel());
@@ -868,7 +870,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         {
             throw new BaseException("新密码格式错误");
         }
+        if(!ToolsUtils.verifPwd(bo.getNewPwd())){
+            throw new CustomException("密码应由8-16位数字、大小写字母、符号组成");
+        }
         user.setPassword(SecurityUtils.encryptPassword(bo.getNewPwd()));
+        user.setPwdTime(DateUtils.getNowTime());
         user.setUpdateTime(DateUtils.getNowTime());
         updateById(user);
         return true;
@@ -1041,6 +1047,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         if(bo.getPwd()==null){
             throw new CustomException("密码不能为空");
         }
+        if(!ToolsUtils.verifPwd(bo.getPwd())){
+            throw new CustomException("密码应由8-16位数字、大小写字母、符号组成");
+        }
         String key = Constants.FORGET_SMS + bo.getTel();
         String code =  redisCache.getCacheObject(key);
         if(code==null){
@@ -1056,6 +1065,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
             throw new CustomException("该手机号未注册");
         }
         user.setPassword(SecurityUtils.encryptPassword(bo.getPwd()));
+        user.setPwdTime(DateUtils.getNowTime());
         user.setUpdateTime(DateUtils.getNowTime());
         return userService.updateById(user);
     }

+ 4 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/domain/ActivityOrder.java

@@ -1,7 +1,5 @@
 package com.zhongzheng.modules.activity.domain;
 
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
@@ -30,6 +28,10 @@ private static final long serialVersionUID=1L;
     private Integer type;
     /** 订单编号 */
     private String orderSn;
+    /** 用户ID */
+    private Long userId;
+    /** 商品ID */
+    private Long goodsId;
     /** 备注 */
     private Integer status;
     /** 1有效 0无效 */

+ 3 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/service/impl/ActivityRecommendServiceImpl.java

@@ -3,13 +3,13 @@ package com.zhongzheng.modules.activity.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
 import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.activity.bo.*;
 import com.zhongzheng.modules.activity.domain.ActivityRecommend;
@@ -24,16 +24,16 @@ import com.zhongzheng.modules.course.service.ICourseSubjectService;
 import com.zhongzheng.modules.course.vo.CourseSubjectVo;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.domain.GoodsSpecAttributeRelation;
-import com.zhongzheng.modules.goods.domain.GoodsSpecTemplate;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.service.IGoodsSpecAttributeRelationService;
 import com.zhongzheng.modules.goods.service.IGoodsSpecTemplateService;
-import com.zhongzheng.modules.goods.vo.GoodsVo;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 

+ 4 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionService.java

@@ -8,10 +8,7 @@ import com.zhongzheng.modules.bank.bo.QuestionBatchDelBo;
 import com.zhongzheng.modules.bank.bo.QuestionEditBo;
 import com.zhongzheng.modules.bank.bo.QuestionQueryBo;
 import com.zhongzheng.modules.bank.domain.Question;
-import com.zhongzheng.modules.bank.vo.ExamVo;
-import com.zhongzheng.modules.bank.vo.QuestionImport;
-import com.zhongzheng.modules.bank.vo.QuestionImportV2;
-import com.zhongzheng.modules.bank.vo.QuestionVo;
+import com.zhongzheng.modules.bank.vo.*;
 import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.vo.BankGoodsExamVo;
 import com.zhongzheng.modules.goods.vo.GoodsExamTimeVo;
@@ -79,6 +76,9 @@ public interface IQuestionService extends IService<Question> {
 
 	Map<String,Object> importExcelQuestionV2NotInBank(List<QuestionImportV2> questionList, Boolean isUpdateSupport, String operName);
 
+
+	Map<String,Object> importExcelQuestionV3NotInBankFromOld(List<QuestionImportV3> questionList, Boolean isUpdateSupport, String operName);
+
     List<GoodsUserQuestionVo> listGoodsUserQuestionVo(GoodsQueryBo bo);
 
     String importWordQuestion(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId);

+ 132 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -856,6 +856,88 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         return map;
     }
 
+    @Override
+    public Map<String, Object> importExcelQuestionV3NotInBankFromOld(List<QuestionImportV3> questionList, Boolean isUpdateSupport, String operName) {
+        System.out.println(questionList);
+        Map<String, Object> map = new HashMap<>();
+        if (Validator.isNull(questionList) || questionList.size() == 0) {
+            throw new CustomException("导入数据不能为空!");
+        }
+        String errorLog = "";
+        String importNo = ServletUtils.getEncoded("IMPORT");
+        int i = 10;
+        Long nowTime = DateUtils.getNowTime();
+        List<QuestionImportV3> errorList = new ArrayList<>();
+        //案例附属题数组
+        List<QuestionAddBo> attList = new ArrayList<>();
+        List<QuestionAddBo> nqList = new ArrayList<>();
+        boolean isAnLi = false; // 是否案例题
+        Map<String,Object> idMap = new HashMap<>();
+        int startIndex = 0;
+        for (QuestionImportV3 question : questionList) {
+            boolean hasError = false;
+            QuestionAddBo bo = new QuestionAddBo();
+            Integer type = null; //题目类型
+            boolean isFirst = true;
+            type = findTypeV3(question.getType());
+            if(!idMap.containsKey(question.getId())){
+                idMap.put(question.getId(),question.getId());
+                //题目主体
+                bo.setType(type);
+                bo.setContent(question.getContent());
+                bo.setAnalysisContent(question.getAnalysisContent());
+                if(Validator.isEmpty(type)){
+                    question.setCause("题目类型错误");
+                    errorList.add(question);
+                    hasError = true;
+                    break;
+                }
+                if(type==1||type==2){ //单选或多选
+                    Map<String,Object> rs = getOptionsListV3(startIndex,questionList,type);
+                    bo.setOptionsList((List<QuestionChildAddBo>)rs.get("optionsList"));
+                    bo.setAnswerQuestion((String) rs.get("answerStr"));
+                }
+                if(type==3){ //判断题
+                    if(question.getOption().equals("正确")&&question.getAnswer().equals("是")){
+                        bo.setAnswerQuestion("1");
+                    }
+                    else if(question.getOption().equals("错误")&&question.getAnswer().equals("否")){
+                        bo.setAnswerQuestion("1");
+                    }
+                    else{
+                        bo.setAnswerQuestion("0");
+                    }
+                }
+                if(type==4){
+                    isAnLi = true;
+                }
+                if(hasError){
+                    continue;
+                }
+                if(isAnLi){
+                    bo.setJsonStr(JSON.toJSONString(attList));
+                }
+                bo.setStatus(1);
+                bo.setPrefixName(question.getPrefixName());
+                bo.setCreateBy(operName);
+                bo.setImportNo(importNo);
+                bo.setPublishStatus(1);
+                bo.setImportSort(nowTime + i); //导入时间从小到大排
+                bo.setCreateTime(nowTime); //从大到小排
+                nqList.add(bo);
+                attList.clear();
+                isFirst = true;
+                isAnLi = false;
+                i++;
+
+            }
+            startIndex++;
+        }
+        map.put("errorList",errorList);
+        map.put("questionList",nqList);
+        return map;
+    }
+
     private Map<String,Object> getOptionsList(int startIndex,List<QuestionImportContent> list,int type){
         Map<String,Object> map = new HashMap<>();
         String answerQuestion = "";
@@ -890,6 +972,41 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         return map;
     }
 
+    private Map<String,Object> getOptionsListV3(int startIndex,List<QuestionImportV3> list,int type){
+        Map<String,Object> map = new HashMap<>();
+        String answerQuestion = "";
+        List<QuestionChildAddBo> optionsList = new ArrayList<>(); //题目选项
+        List<Long> answerList = new ArrayList<>(); //答案选项
+        Long j = 1L;
+        String tempTxt = list.get(startIndex).getContent();
+        for(int i = startIndex;i<list.size();i++){
+            QuestionImportV3 entity = list.get(i);
+            if(Validator.isNotEmpty(entity.getContent())&&i>startIndex){
+                if(!tempTxt.equals(entity.getContent())){
+                    break;
+                }
+            }
+            if(Validator.isEmpty(entity.getOption())){
+                continue;
+            }
+            QuestionChildAddBo addBo = new QuestionChildAddBo();
+            addBo.setContent(entity.getOption());
+            addBo.setOptionsId(j);
+            optionsList.add(addBo);
+            if("是".equals(entity.getAnswer())){
+                answerList.add(j);
+                /*if(type==1){ //单选
+                    break;
+                }*/
+            }
+            j++;
+        }
+        map.put("optionsList",optionsList);
+        map.put("answerStr",ToolsUtils.join(",", answerList));
+        return map;
+    }
+
+
     @Override
     public List<GoodsUserQuestionVo> listGoodsUserQuestionVo(GoodsQueryBo bo) {
         return baseMapper.listGoodsUserQuestionVo(bo);
@@ -2240,6 +2357,21 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         return null;
     }
 
+    public Integer findTypeV3(String type) {
+        if ("单选题".equals(type)) {
+            return 1;
+        } else if ("多选题".equals(type)) {
+            return 2;
+        } else if ("判断题".equals(type)) {
+            return 3;
+        } else if ("问答题".equals(type)) {
+            return 5;
+        } else if ("案例题".equals(type)) {
+            return 4;
+        }
+        return null;
+    }
+
 
     private String dealImportAnswer(String Answer) {
         String[] itemArray = Answer.split("");

+ 25 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionImportContentV3.java

@@ -0,0 +1,25 @@
+package com.zhongzheng.modules.bank.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+
+/**
+ * 题库题目添加对象 question
+ *
+ * @author hjl
+ * @date 2021-10-22
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+public class QuestionImportContentV3 implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+}

+ 54 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionImportV3.java

@@ -0,0 +1,54 @@
+package com.zhongzheng.modules.bank.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import com.zhongzheng.modules.bank.bo.QuestionBusinessAddBo;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+ * 题库题目添加对象 question
+ *
+ * @author hjl
+ * @date 2021-10-22
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+public class QuestionImportV3 implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 前缀名称 */
+    @Excel(name = "指标名称")
+    private String prefixName;
+
+    /** 题目正文 */
+    @Excel(name = "*题目内容")
+    private String content;
+
+    @Excel(name = "*题型")
+    private String type;
+
+    @Excel(name = "描述")
+    private String analysisContent;
+
+    @Excel(name = "*题目选项")
+    private String option;
+
+    @Excel(name = "*是否正确选项")
+    private String answer;
+
+    @Excel(name = "失败原因")
+    private String cause;
+
+    @Excel(name = "编号")
+    private String id;
+
+    private List<QuestionBusinessAddBo> businessList;
+}

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java

@@ -87,4 +87,6 @@ public interface ICourseService extends IService<Course> {
 	List<GoodsUserVo> goodsProgressList(CourseQueryBo bo);
 
     Course getCourseByTenant(String code, Long newTenantId);
+
+	Boolean checkTime();
 }

+ 33 - 16
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -3,36 +3,39 @@ package com.zhongzheng.modules.course.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.zhongzheng.common.core.page.TableDataInfo;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.modules.bank.domain.ExamQuestion;
-import com.zhongzheng.modules.bank.domain.Question;
-import com.zhongzheng.modules.course.bo.*;
+import com.zhongzheng.modules.course.bo.CourseAddBo;
+import com.zhongzheng.modules.course.bo.CourseEditBo;
+import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.domain.Course;
-import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.domain.CoursePhotoLog;
 import com.zhongzheng.modules.course.mapper.CourseMapper;
-import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
 import com.zhongzheng.modules.course.service.ICoursePhotoLogService;
-import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
-import com.zhongzheng.modules.exam.domain.*;
-import com.zhongzheng.modules.exam.service.*;
+import com.zhongzheng.modules.exam.domain.ExamApplyUser;
+import com.zhongzheng.modules.exam.domain.ExamBefore;
+import com.zhongzheng.modules.exam.domain.ExamBeforeApply;
+import com.zhongzheng.modules.exam.service.IExamApplyGoodsService;
+import com.zhongzheng.modules.exam.service.IExamApplyUserService;
+import com.zhongzheng.modules.exam.service.IExamBeforeApplyService;
+import com.zhongzheng.modules.exam.service.IExamBeforeService;
 import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
 import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
-import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.domain.GoodsCourse;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo;
 import com.zhongzheng.modules.goods.vo.GoodsPeriodVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserVo;
-import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.bo.UserPeriodStatusAddBo;
@@ -56,16 +59,13 @@ import com.zhongzheng.modules.user.vo.SubjectStudyRecordVo;
 import com.zhongzheng.modules.user.vo.UserStudyRecordPhotoVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -580,6 +580,23 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
         return courseUserVos;
     }
 
+    @Override
+    public Boolean checkTime() {
+        try {
+            String startTime = "2023-3-16 00:00:00";
+            String endTime = "2023-4-01 00:00:00";
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Long startDate = sdf.parse(startTime).getTime()/1000;
+            Long endDate = sdf.parse(endTime).getTime()/1000;
+            if (DateUtils.getNowTime() < startDate || DateUtils.getNowTime() > endDate){
+                throw new CustomException("活动已过期");
+            }
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return true;
+    }
+
     private List<UserStudyRecordPhotoVo> entity2PhotoVo(Collection<UserStudyRecordPhoto> collection) {
         List<UserStudyRecordPhotoVo> voList = collection.stream()
                 .map(any -> BeanUtil.toBean(any, UserStudyRecordPhotoVo.class))

+ 15 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -23,10 +23,7 @@ import com.zhongzheng.modules.bank.mapper.QuestionMapper;
 import com.zhongzheng.modules.bank.service.*;
 import com.zhongzheng.modules.base.domain.*;
 import com.zhongzheng.modules.base.service.*;
-import com.zhongzheng.modules.course.bo.CourseMenuAddBo;
-import com.zhongzheng.modules.course.bo.CourseMenuListAddBo;
-import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
-import com.zhongzheng.modules.course.bo.CourseQueryBo;
+import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.domain.*;
 import com.zhongzheng.modules.course.mapper.CourseMapper;
 import com.zhongzheng.modules.course.service.*;
@@ -104,6 +101,8 @@ import static java.math.RoundingMode.HALF_UP;
 @Service
 public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements IGoodsService {
 
+    @Autowired
+    private ICourseBusinessService iCourseBusinessService;
 
     @Autowired
     private IGoodsCourseService iGoodsCourseService;
@@ -167,8 +166,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
     private ICourseSectionService iCourseSectionService;
     @Autowired
     private ICourseSectionBusinessService iCourseSectionBusinessService;
-    @Autowired
-    private ICourseBusinessService iCourseBusinessService;
+
 
     @Autowired
     private ICourseSubjectService iCourseSubjectService;
@@ -655,7 +653,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
             update(null, objectLambdaUpdateWrapper);
         }
         //试听列表
-        if (bo.getAuditionList() != null && bo.getAuditionList().size() > 0) {
+        if (bo.getAuditionList() != null) {
             update.setGoodsAuditionConfig(JSON.toJSONString(bo.getAuditionList()));
         }
         //播放设置
@@ -880,6 +878,15 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         if (Validator.isNotEmpty(classGradeVo)) {
             goodsVo.setGradeId(classGradeVo.getGradeId());
         }
+        CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
+        queryBo.setId(goodsVo.getBusinessId());
+        String fullName = iCourseBusinessService.queryFullName(queryBo);
+        goodsVo.setErJianErZao(false);
+        if(Validator.isNotEmpty(fullName)){
+            if(fullName.equals("继续教育二级建造师")||fullName.equals("继续教育二级造价师")){
+                goodsVo.setErJianErZao(true);
+            }
+        }
         return goodsVo;
     }
 
@@ -2421,7 +2428,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                 GoodsSpec goodsSpec = BeanUtil.toBean(x, GoodsSpec.class);
                 goodsSpec.setSpecId(null);
                 goodsSpec.setTenantId(newTenantId);
-                goodsSpec.setOId(x.getOId());
+                goodsSpec.setOId(x.getSpecId());
                 return goodsSpec;
             }).collect(Collectors.toList());
             goodsSpecService.saveBatch(newGoodsSpecList);

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java

@@ -359,5 +359,6 @@ public class GoodsVo {
 	@Excel(name = "提交官方审核备注说明")
 	@ApiModelProperty("提交官方审核备注说明")
 	private String commitPeriodRemark;
-
+	@ApiModelProperty("是否是二建二造")
+	private Boolean erJianErZao;
 }

+ 14 - 14
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java

@@ -241,18 +241,18 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
         SysOldOrg org = sysOldOrgService.list(new LambdaQueryWrapper<SysOldOrg>()
                 .eq(SysOldOrg::getTenantId, tenant)
                 .last("limit 1")).stream().findFirst().orElse(null);
-        //校验是否二建/二造商品创建班级
-        if (bo.getClassGradeGoodsAddBos() != null &&
-                (ObjectUtils.isNull(bo.getClassStatus()) || 1 == bo.getClassStatus()) && org.getShareClass() == 1) {
-            Long goodsId = bo.getClassGradeGoodsAddBos()[0];
-            Goods goods = iGoodsService.getById(goodsId);
-            CourseBusinessQueryBo businessQueryBo = new CourseBusinessQueryBo();
-            businessQueryBo.setId(goods.getBusinessId());
-            String fullName = iCourseBusinessService.queryFullName(businessQueryBo);
-            if (("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName))) {
-                throw new CustomException("二建/二造不允许直接创建开班班级!");
-            }
-        }
+//        //校验是否二建/二造商品创建班级
+//        if (bo.getClassGradeGoodsAddBos() != null &&
+//                (ObjectUtils.isNull(bo.getClassStatus()) || 1 == bo.getClassStatus()) && org.getShareClass() == 1) {
+//            Long goodsId = bo.getClassGradeGoodsAddBos()[0];
+//            Goods goods = iGoodsService.getById(goodsId);
+//            CourseBusinessQueryBo businessQueryBo = new CourseBusinessQueryBo();
+//            businessQueryBo.setId(goods.getBusinessId());
+//            String fullName = iCourseBusinessService.queryFullName(businessQueryBo);
+//            if (("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName))) {
+//                throw new CustomException("二建/二造不允许直接创建开班班级!");
+//            }
+//        }
 
         //是否创建官方班级编号
         if (bo.getClassGradeGoodsAddBos() != null &&
@@ -293,9 +293,9 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
                         //获取当前机构商品下的班级
                         List<ClassGradeGoods> gradeGoods = iClassGradeGoodsService.getGradeGoodsList(goods.getGoodsId());
                         if (gradeGoods.size() < listGrade.size()) {
-                            ClassGrade grade = list.get(gradeGoods.size());
+                            ClassGrade grade = listGrade.get(gradeGoods.size());
                             if (checkEjjjPeopleNumLimit(business.getId(), grade.getGradeId())) {
-                                add.setOfficialName(list.get(gradeGoods.size()).getOfficialName());
+                                add.setOfficialName(listGrade.get(gradeGoods.size()).getOfficialName());
                                 add.setClassStatus(0);
                             } else {
                                 add.setOfficialName(ServletUtils.getEncoded("PIY"));

+ 1 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderService.java

@@ -112,7 +112,5 @@ public interface IOrderService extends IService<Order> {
 
 	boolean arrangeGrade(String goodsName, Long goodsId, Long orderGoodsId, Long gradeId, Long userId, String orderSn, Long businessId);
 
-
-
-
+	Map<String, String> getActivityGoods(OrderAddBo bo);
 }

+ 127 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -1820,6 +1820,133 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         return true;
     }
 
+    @Override
+    public Map<String, String> getActivityGoods(OrderAddBo bo) {
+        String key = "ORDER-" + "-" + bo.getUserId();
+        Long value = redisCache.getCacheObject(key);
+        if (Validator.isNotEmpty(value)) {
+            throw new CustomException("请勿频繁提交订单");
+        }
+        redisCache.setCacheObject(key, 1L, 5, TimeUnit.SECONDS);//5秒
+        List<OrderGoodsAddBo> goodsList = bo.getGoodsList();
+        if (goodsList == null || goodsList.size() < 1) {
+            throw new CustomException("商品列表为空");
+        }
+        Order add = BeanUtil.toBean(bo, Order.class);
+        validEntityBeforeSave(add);
+        add.setCreateTime(DateUtils.getNowTime());
+        add.setUpdateTime(DateUtils.getNowTime());
+
+
+        //生成订单号
+        String out_trade_no = DateUtils.getDateOrderSn();
+        BigDecimal totalPrice = new BigDecimal(0);
+        BigDecimal payPrice = new BigDecimal(0);
+        List<OrderGoods> freeList = new ArrayList<>();
+        //生成订单
+        for (OrderGoodsAddBo g : goodsList) {
+            //订单商品
+            Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, g.getGoodsId()));
+            if (goods.getGoodsStatus() != 1) {
+                throw new CustomException(goods.getGoodsName() + "商品已下架,请重新选择商品下单");
+            }
+            OrderGoods orderGoods = BeanUtil.toBean(g, OrderGoods.class);
+            orderGoods.setOrderSn(out_trade_no);
+            if (g.getGoodsInputData() != null) {
+                orderGoods.setGoodsInputData(JSON.toJSONString(g.getGoodsInputData()));
+            }
+            //成交价
+            orderGoods.setStatus(1);
+            orderGoods.setGoodsRealPrice(goods.getStandPrice());
+            orderGoods.setGoodsPrice(goods.getStandPrice());
+            orderGoods.setCreateTime(DateUtils.getNowTime());
+            orderGoods.setUpdateTime(DateUtils.getNowTime());
+            //订单价格不计算优惠
+            totalPrice = totalPrice.add(goods.getStandPrice());
+            //暂不计算优惠券
+            payPrice = payPrice.add(goods.getStandPrice());
+            iOrderGoodsService.save(orderGoods);
+
+            boolean canRepeatBuy = false;
+            validUserBeforeBuy(goods, bo.getUserId());
+            //判断是否有购买过
+            Long oldOrderGoodsId = getHaveBuyGoods(g.getGoodsId(), bo.getUserId());
+            //视频商品安排班级
+            if (goods.getGoodsType() == 1) {
+                if (Validator.isNotEmpty(goods.getStudyCount())) {
+                    orderGoods.setStudyCount(goods.getStudyCount() - 1); //默认分班消耗一次学习机会
+                } else {
+                    orderGoods.setStudyCount(0L);//没配置则为0
+                }
+                Long gradeId = null;
+                //判断是否购买历史班级都过期
+                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId());
+                if (g.getGoodsInputData() != null) {
+                    gradeId = g.getGoodsInputData().getGradeId();
+                    if (Validator.isNotEmpty(oldOrderGoodsId)) {
+                        //有指定选班模板且视频商品班级已过期,记录复购状态
+                        orderGoods.setRebuyOrderGoodsId(oldOrderGoodsId);
+                    }
+                }
+                String requestId = IdUtil.simpleUUID();
+                RedisLockEntity redisLockEntity = new RedisLockEntity();
+                redisLockEntity.setLockKey(RedisLockEntity.KEY_LOCK_GRADE);
+                redisLockEntity.setRequestId(requestId);
+                if (redisCache.lock(redisLockEntity)) {
+                    arrangeGrade(goods.getGoodsName(), goods.getGoodsId(), orderGoods.getOrderGoodsId(), gradeId, add.getUserId(), out_trade_no, goods.getBusinessId());
+                    redisCache.unlockLua(redisLockEntity);
+                }
+                iOrderGoodsService.updateById(orderGoods);
+                newFreeBankGoods(goods.getGoodsId(), orderGoods.getOrderGoodsId());
+            }
+
+            if (!canRepeatBuy && goods.getGoodsType() != 3 && goods.getGoodsType() != 4) {
+                this.checkBuyGoods(g.getGoodsId(), bo.getUserId(), goods.getGoodsType());
+            }
+            if (goods.getGoodsType() == 6) {
+                //直播商品
+                if (Validator.isNotEmpty(oldOrderGoodsId) && oldOrderGoodsId.longValue() > 0) {
+                    throw new CustomException("直播商品不允许复购");
+                }
+            }
+            iShoppingCartService.deleteByGoodsId(g.getGoodsId(), bo.getUserId());
+            //商品0元加入免费商品列表
+            freeList.add(orderGoods);
+        }
+
+        add.setOrderSn(out_trade_no);
+        add.setOrderFrom(Order.FROM_SMALL);
+        add.setPayPrice(payPrice);
+        add.setPayType(Order.PAY_WECHAT);
+        add.setOrderPrice(totalPrice);
+        //订单0元
+        //完全收费
+        add.setOrderStatus(Order.ORDER_STATUS_PAY);
+        add.setPayStatus(Order.PAY_FREE);
+        add.setStatus(1);
+        this.save(add);
+        //处理免费商品
+        for (OrderGoods orderGoods : freeList) {
+            dealFreeGoods(orderGoods, add);
+        }
+
+        Map<String, String> payResult = new HashMap<>();
+        payResult.put("orderSn", out_trade_no);
+
+        //活动商品领取记录
+        ActivityOrder record = new ActivityOrder();
+        record.setOrderSn(out_trade_no);
+        record.setUserId(add.getUserId());
+        record.setGoodsId(goodsList.get(0).getGoodsId());
+        record.setStatus(1);
+        record.setRemark("真题领取活动");
+        record.setType(2);
+        record.setCreateTime(DateUtils.getNowTime());
+        record.setUpdateTime(DateUtils.getNowTime());
+        iActivityOrderService.save(record);
+        return payResult;
+    }
+
     private String createGradeCode(Long goodsId, CourseBusinessVo business) {
 
         Goods goods = iGoodsService.getById(goodsId);

+ 5 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/IScheduleService.java

@@ -2,18 +2,10 @@ package com.zhongzheng.modules.schedule.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.zhongzheng.modules.exam.bo.ExamApplyQueryBo;
-import com.zhongzheng.modules.polyv.bo.PolyvVideoAddBo;
-import com.zhongzheng.modules.polyv.bo.PolyvVideoEditBo;
-import com.zhongzheng.modules.polyv.bo.PolyvVideoQueryBo;
 import com.zhongzheng.modules.polyv.domain.PolyvVideo;
-import com.zhongzheng.modules.polyv.vo.PolyvVideoQuerVo;
-import com.zhongzheng.modules.polyv.vo.PolyvVideoVo;
-import com.zhongzheng.modules.polyv.vo.PolyvVo;
 import com.zhongzheng.modules.user.bo.UserQueryBo;
 
 import java.text.ParseException;
-import java.util.Collection;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -103,4 +95,9 @@ public interface IScheduleService extends IService<PolyvVideo> {
     void signTimeSend(UserQueryBo bo);
 
     void toDayExamNotRecordWarn();
+
+    void synchronizationGoodsByTenantId(String tenantId);
+
+    void goodsDispose();
+
 }

+ 16 - 37
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -3,36 +3,23 @@ package com.zhongzheng.modules.schedule.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.lang.Validator;
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.http.HttpStatus;
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.github.pagehelper.Page;
 import com.zhongzheng.common.core.domain.entity.SysUser;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
-import com.zhongzheng.common.utils.http.HttpUtils;
-import com.zhongzheng.common.utils.polyv.PolyvUtils;
 import com.zhongzheng.modules.alisms.vo.ResultBean;
-import com.zhongzheng.modules.bank.domain.Exam;
-import com.zhongzheng.modules.bank.domain.QuestionBusiness;
-import com.zhongzheng.modules.bank.mapper.QuestionMapper;
 import com.zhongzheng.modules.base.service.IProfileTpService;
 import com.zhongzheng.modules.base.vo.ProfileTpVo;
-import com.zhongzheng.modules.base.vo.UserProfileVo;
 import com.zhongzheng.modules.course.bo.CourseChapterSectionQueryBo;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.bo.CourseModuleChapterQueryBo;
 import com.zhongzheng.modules.course.bo.CourseSectionQueryBo;
-import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.domain.CourseSection;
 import com.zhongzheng.modules.course.domain.CourseSubject;
 import com.zhongzheng.modules.course.service.*;
@@ -51,9 +38,8 @@ import com.zhongzheng.modules.exam.mapper.ExamBeforeMapper;
 import com.zhongzheng.modules.exam.mapper.ExamNumberMapper;
 import com.zhongzheng.modules.exam.vo.ExamApplyVo;
 import com.zhongzheng.modules.exam.vo.ExamBeforeVo;
-import com.zhongzheng.modules.exam.vo.ExamNumberVo;
 import com.zhongzheng.modules.exam.vo.ExamUserApplyVo;
-import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
+import com.zhongzheng.modules.goods.bo.GoodsBatchCopyTenantBo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.domain.GoodsExamTime;
@@ -67,11 +53,12 @@ import com.zhongzheng.modules.grade.bo.ClassGradeQueryBo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.grade.domain.*;
 import com.zhongzheng.modules.grade.service.*;
-import com.zhongzheng.modules.grade.vo.*;
+import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
+import com.zhongzheng.modules.grade.vo.ClassGradeVo;
+import com.zhongzheng.modules.grade.vo.ClassPeriodVo;
 import com.zhongzheng.modules.inform.bo.InformQueryBo;
 import com.zhongzheng.modules.inform.bo.InformSysUserAddBo;
 import com.zhongzheng.modules.inform.bo.InformUserAddBo;
-import com.zhongzheng.modules.inform.domain.Inform;
 import com.zhongzheng.modules.inform.domain.InformUser;
 import com.zhongzheng.modules.inform.service.IInformRemindService;
 import com.zhongzheng.modules.inform.service.IInformService;
@@ -79,10 +66,8 @@ import com.zhongzheng.modules.inform.service.IInformSysUserService;
 import com.zhongzheng.modules.inform.service.IInformUserService;
 import com.zhongzheng.modules.inform.vo.InformRemindVo;
 import com.zhongzheng.modules.inform.vo.InformVo;
-import com.zhongzheng.modules.mock.bo.MockApplyEditBo;
 import com.zhongzheng.modules.mock.domain.MockApply;
 import com.zhongzheng.modules.mock.domain.MockMajorSubject;
-import com.zhongzheng.modules.mock.domain.MockMajorSubjectGoods;
 import com.zhongzheng.modules.mock.domain.MockMajorSubjectTime;
 import com.zhongzheng.modules.mock.service.IMockApplyService;
 import com.zhongzheng.modules.mock.service.IMockMajorSubjectGoodsService;
@@ -94,24 +79,14 @@ import com.zhongzheng.modules.order.domain.Order;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.mapper.OrderGoodsMapper;
 import com.zhongzheng.modules.order.mapper.OrderMapper;
-import com.zhongzheng.modules.order.service.IOrderBusinessService;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderListVo;
-import com.zhongzheng.modules.order.vo.OrderVo;
 import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
-import com.zhongzheng.modules.polyv.bo.PolyvVideoAddBo;
-import com.zhongzheng.modules.polyv.bo.PolyvVideoEditBo;
-import com.zhongzheng.modules.polyv.bo.PolyvVideoQueryBo;
-import com.zhongzheng.modules.polyv.domain.PolyvVideDo;
 import com.zhongzheng.modules.polyv.domain.PolyvVideo;
-import com.zhongzheng.modules.polyv.domain.TokenResponse;
 import com.zhongzheng.modules.polyv.mapper.PolyvVideoMapper;
 import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
-import com.zhongzheng.modules.polyv.vo.PolyvVideoQuerVo;
-import com.zhongzheng.modules.polyv.vo.PolyvVideoVo;
-import com.zhongzheng.modules.polyv.vo.PolyvVo;
 import com.zhongzheng.modules.schedule.service.IScheduleService;
 import com.zhongzheng.modules.system.service.ISysUserService;
 import com.zhongzheng.modules.user.bo.*;
@@ -122,29 +97,21 @@ import com.zhongzheng.modules.user.service.*;
 import com.zhongzheng.modules.user.vo.*;
 import com.zhongzheng.modules.wisdom.service.IWisdomService;
 import com.zhongzheng.modules.wx.service.IWxLoginService;
-import com.zhongzheng.modules.wx.service.IWxPayService;
 import net.polyv.common.v1.util.StringUtils;
 import net.polyv.live.v1.entity.channel.playback.LiveChannelVideoListResponse;
-import net.polyv.live.v1.entity.channel.playback.LiveListChannelSessionInfoResponse;
 import net.polyv.live.v1.entity.channel.playback.LiveListChannelVideoLibraryResponse;
 import org.apache.commons.lang3.time.DateFormatUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
-import java.io.IOException;
 import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
-import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
-import static com.alibaba.fastjson.JSONPatch.OperationType.add;
-import static com.squareup.okhttp.internal.Util.md5Hex;
-
 /**
  * 定时任务
  *
@@ -1082,6 +1049,18 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         }
     }
 
+    @Override
+    public void synchronizationGoodsByTenantId(String tenantId) {
+        GoodsBatchCopyTenantBo bo = new GoodsBatchCopyTenantBo();
+        bo.setTenantId(Long.valueOf(tenantId));
+        iGoodsService.goodsBatchCopyTenant(bo);
+    }
+
+    @Override
+    public void goodsDispose() {
+        iGoodsService.goodsBatchCopyDisposeTenant();
+    }
+
     @Override
     public void closeTimeOutOrder() {
         OrderQueryBo bo = new OrderQueryBo();

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/service/impl/SysUserServiceImpl.java

@@ -340,6 +340,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         return baseMapper.update(null,
                 new LambdaUpdateWrapper<SysUser>()
                         .set(SysUser::getPassword,password)
+                        .set(SysUser::getPwdTime,DateUtils.getNowTime())
                         .eq(SysUser::getUserName,userName));
     }
 

+ 5 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/service/impl/SysWebServiceImpl.java

@@ -324,6 +324,9 @@ public class SysWebServiceImpl implements ISysWebService {
         jsonObject24.put("h5Logo","https://"+bo.getLogoH5Url());
         jsonObject24.put("smallLogo","https://"+bo.getLogoSmallUrl());
         jsonObject24.put("hostLive","https://"+bo.getHostLive());
+        jsonObject24.put("hostH5","https://"+bo.getHostH5());
+        jsonObject24.put("hostPc","https://"+bo.getHostPc());
+        jsonObject24.put("smallQrCodeShow",false);
         config24.setConfigKey("home.mobile");
         config24.setConfigValue(jsonObject24.toJSONString());
         config24.setConfigType("N");
@@ -435,8 +438,8 @@ public class SysWebServiceImpl implements ISysWebService {
                 "    }\n" +
                 "\n" +
                 "    #SSL配置\n" +
-                "    ssl_certificate      /mydata/nginx/ssl/gdzzkj.net.pem; # 配置证书\n" +
-                "    ssl_certificate_key  /mydata/nginx/ssl/gdzzkj.net.key; # 配置证书私钥\n" +
+                "    ssl_certificate      /mydata/nginx/ssl/zzyxt.net.pem; # 配置证书\n" +
+                "    ssl_certificate_key  /mydata/nginx/ssl/zzyxt.net.key; # 配置证书私钥\n" +
                 "    ssl_protocols        TLSv1 TLSv1.1 TLSv1.2; # 配置SSL协议版本 # 配置SSL加密算法\n" +
                 "    ssl_ciphers          ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;\n" +
                 "    ssl_prefer_server_ciphers  on; # 优先采取服务器算法\n" +

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

@@ -155,4 +155,8 @@ public class UserAddBo {
     /** 分销邀请码 */
     @ApiModelProperty("分销邀请码")
     private String shareCode;
+
+    /** 密码最后修改时间 */
+    @ApiModelProperty("密码最后修改时间")
+    private Long pwdTime;
 }

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserAppRegisterBo.java

@@ -1,6 +1,5 @@
 package com.zhongzheng.modules.user.bo;
 
-import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -27,5 +26,7 @@ public class UserAppRegisterBo {
     private String shareActivityCode;
     @ApiModelProperty("身份证")
     private String idcard;
+    @ApiModelProperty("是否活动:1是,0否")
+    private Integer isActivity;
 
 }

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

@@ -199,4 +199,8 @@ public class UserEditBo {
     /** 活动分销邀请码 */
     @ApiModelProperty("活动分销邀请码")
     private String shareActivityCode;
+
+    /** 密码最后修改时间 */
+    @ApiModelProperty("密码最后修改时间")
+    private Long pwdTime;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/User.java

@@ -220,4 +220,6 @@ private static final long serialVersionUID=1L;
     private String shareCode;
     /** 分销活动邀请码 */
     private String shareActivityCode;
+    /** 密码最后修改时间 */
+    private Long pwdTime;
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserVo.java

@@ -289,6 +289,11 @@ public class UserVo {
 	@ApiModelProperty("活动分销邀请码")
 	private String shareActivityCode;
 
+	/** 密码最后修改时间 */
+	@Excel(name = "密码最后修改时间")
+	@ApiModelProperty("密码最后修改时间")
+	private Long pwdTime;
+
 	public void setNull(){
 		this.setOpenId(null);
 		this.setIdCardImg1(null);

+ 2 - 2
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml

@@ -228,7 +228,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           and up.chapter_id=#{chapterId}
           and up.section_id=#{typeId}
           and up.course_id=#{courseId}
-            <if test="examId != null ">
+            <if test="examId != null and examId > 0">
                 and up.exam_id=#{examId}
                 and up.`type` = 2
             </if>
@@ -250,7 +250,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           and up.chapter_id=#{chapterId}
           and up.course_id=#{courseId}
           and up.section_id=#{typeId}
-            <if test="examId != null ">
+            <if test="examId != null and examId > 0">
                 and up.exam_id=#{examId}
                 and up.`type` = 2
             </if>

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/system/SysUserMapper.xml

@@ -26,6 +26,7 @@
         <result property="code" column="code"/>
         <result property="preLoginIp" column="pre_login_ip"/>
         <result property="preLoginDate" column="pre_login_date"/>
+        <result property="pwdTime" column="pwd_time"/>
         <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult"/>
         <collection property="roles" column="user_id" select="findRolesList" javaType="java.util.List" />
     </resultMap>
@@ -77,6 +78,7 @@
                u.create_by,
                u.create_time,
                u.remark,
+               u.pwd_time,
                d.dept_id,
                d.parent_id,
                d.dept_name,

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

@@ -59,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="lastStudyTime" column="last_study_time"/>
         <result property="job" column="job"/>
         <result property="shareCode" column="share_code"/>
+        <result property="pwdTime" column="pwd_time"/>
     </resultMap>