yangdamao 2 years ago
parent
commit
26b373e643

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

@@ -273,10 +273,11 @@ public class CommonController extends BaseController {
     @ApiOperation("获取某场考试信息")
     @PostMapping("common/apply/detail")
     public AjaxResult examApplyDetail(@RequestBody ExamApplyDetailBo bo) {
-        List<ExamApplyDetailVo> voList = iExamApplyService.examApplyDetail(bo);                                                                                                                                                                                                                                                                                                examApplyDetail(bo);
+        List<ExamApplyDetailVo> voList = iExamApplyService.examApplyDetail(bo);
         return AjaxResult.success(voList);
     }
 
+
     @ApiOperation("旧系统获取商品学习中心路径")
     @PostMapping("common/get/goods/studyUrl")
     public AjaxResult getGoodsStudyUrl(@RequestBody GoodsStudyUrlBo bo) {

+ 22 - 31
zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsController.java

@@ -1,47 +1,29 @@
 package com.zhongzheng.controller.goods;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Arrays;
-
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
-import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.modules.bank.bo.ExamQuestionQueryBo;
+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.common.utils.poi.ExcelUtil;
 import com.zhongzheng.modules.bank.service.IQuestionService;
-import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
-import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.goods.bo.*;
-import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
-import com.zhongzheng.modules.goods.service.IGoodsAuditionConfigService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.*;
-import com.zhongzheng.modules.grade.vo.StudyAccountStatusExportVo;
-import com.zhongzheng.modules.order.vo.OrderVo;
-import com.zhongzheng.modules.user.bo.UserExamRecordQueryBo;
-import com.zhongzheng.modules.user.entity.ClientLoginUser;
-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.List;
 
 /**
  * 商品Controller
@@ -339,6 +321,15 @@ public class GoodsController extends BaseController {
         return toAjax(iGoodsService.goodsBatchCopyIncrementTenant(bo) ? 1 : 0);
     }
 
+    /**
+     * 商品节点复制
+     */
+    @ApiOperation("商品节点复制")
+    @PostMapping("/node/copy/add")
+    public AjaxResult<Void> goodsNodeCopyAddTenant(@RequestBody GoodsNodeCopyTenantBo bo) {
+        return toAjax(iGoodsService.goodsNodeCopyAddTenant(bo) ? 1 : 0);
+    }
+
     /**
      * 商品关系ID处理(全量复制后的处理方法)
      */

+ 6 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamApplyDetailBo.java

@@ -12,10 +12,12 @@ import java.io.Serializable;
 @Data
 public class ExamApplyDetailBo implements Serializable {
 
-    @ApiModelProperty("考试日期")
-    private Long examTime;
-    @ApiModelProperty("开始时间")
+    @ApiModelProperty("考试开始日期")
+    private Long examStartTime;
+    @ApiModelProperty("考试结束日期")
+    private Long examEndTime;
+    @ApiModelProperty("考点开始时间")
     private String startTime;
-    @ApiModelProperty("结束时间")
+    @ApiModelProperty("考点结束时间")
     private String endTime;
 }

+ 4 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamApplyMapper.java

@@ -83,5 +83,8 @@ public interface ExamApplyMapper extends BaseMapper<ExamApply> {
     UserSubscribe getExamApplyByUser(@Param("userId") Long userId,@Param("majorName") String majorName);
 
     @InterceptorIgnore(tenantLine = "true")
-    List<ExamApplyDetailVo> getExamUserInfo(ExamApplyDetailBo bo);
+    List<ExamApplyDetailVo> getExamInfo(ExamApplyDetailBo bo);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<ExamApplyUserDetailVo> getExamUserInfo(ExamApplyDetailVo bo);
 }

+ 12 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java

@@ -863,16 +863,22 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
 
     @Override
     public List<ExamApplyDetailVo> examApplyDetail(ExamApplyDetailBo bo) {
-        List<ExamApplyDetailVo> vo = baseMapper.getExamUserInfo(bo);
+        List<ExamApplyDetailVo> vo = baseMapper.getExamInfo(bo);
         if (CollectionUtils.isEmpty(vo)){
             return new ArrayList<>();
         }
-        //身份证处理
+        //获取考试学员
         vo.forEach(item -> {
-            //身份证隐藏
-            String decrypt = EncryptHandler.decrypt(item.getIdCard());
-            String content = decrypt.replaceAll("(\\d{4})\\d{10}(\\w{4})", "$1****$2");
-            item.setIdCard(content);
+            List<ExamApplyUserDetailVo> examUserInfo = baseMapper.getExamUserInfo(item);
+            if (CollectionUtils.isNotEmpty(examUserInfo)){
+                examUserInfo.forEach(user -> {
+                    //身份证隐藏
+                    String decrypt = EncryptHandler.decrypt(user.getIdCard());
+                    String content = decrypt.replaceAll("(\\d{4})\\d{10}(\\w{4})", "$1****$2");
+                    user.setIdCard(content);
+                });
+                item.setUserDetailVos(examUserInfo);
+            }
         });
         return vo;
     }

+ 11 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyDetailVo.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * @author yangdamao
@@ -11,11 +12,15 @@ import java.io.Serializable;
  */
 @Data
 public class ExamApplyDetailVo implements Serializable {
+    private Long applyId;
+    private Long siteId;
+    @ApiModelProperty("考试日期")
+    private Long examTime;
+    @ApiModelProperty("开始时间")
+    private String startTime;
+    @ApiModelProperty("结束时间")
+    private String endTime;
+    @ApiModelProperty("学员信息")
+    private List<ExamApplyUserDetailVo> userDetailVos;
 
-    @ApiModelProperty("学员姓名")
-    private String userName;
-    @ApiModelProperty("座位号")
-    private Integer seatNum;
-    @ApiModelProperty("身份证")
-    private String idCard;
 }

+ 20 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyUserDetailVo.java

@@ -0,0 +1,20 @@
+package com.zhongzheng.modules.exam.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年06月26日 15:13
+ */
+@Data
+public class ExamApplyUserDetailVo implements Serializable {
+    @ApiModelProperty("学员姓名")
+    private String userName;
+    @ApiModelProperty("座位号")
+    private Integer seatNum;
+    @ApiModelProperty("身份证")
+    private String idCard;
+}

+ 25 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsNodeCopyTenantBo.java

@@ -0,0 +1,25 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yangdamao
+ * @date 2022年12月28日 9:28
+ */
+@Data
+public class GoodsNodeCopyTenantBo implements Serializable {
+
+    @ApiModelProperty("机构ID")
+    private Long tenantId;
+
+    @ApiModelProperty("标识ID")
+    private Long signId;
+
+    @ApiModelProperty("类型:1课程 2模块 3章 4节")
+    private Integer type;
+
+}

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java

@@ -132,4 +132,6 @@ public interface IGoodsService extends IService<Goods> {
 	Goods getGoodsByIdNotTenant(Long goodsId);
 
     Goods getGoodsByTenantTwo(String goodsName, String code, Long tenantId);
+
+    boolean goodsNodeCopyAddTenant(GoodsNodeCopyTenantBo bo);
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -4392,6 +4392,13 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return baseMapper.getGoodsByTenantTwo(goodsName,code,tenantId);
     }
 
+    @Override
+    public boolean goodsNodeCopyAddTenant(GoodsNodeCopyTenantBo bo) {
+
+
+        return false;
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean updateGoodsRepair(UpdateGoodsRepairBo bo) {

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

@@ -1902,23 +1902,23 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         payStatusList.add(4);
         orderGoodsQueryBo.setPayStatusList(payStatusList);
         List<OrderGoodsVo> list1 = iOrderGoodsService.selectList(orderGoodsQueryBo);
-        for (OrderGoodsVo goodsVo : list1) {
-            if (Validator.isNotEmpty(goodsVo.getServiceEndTime()) && (goodsVo.getServiceEndTime().longValue() > (System.currentTimeMillis() / 1000))) {
-                if (goodsVo.getGoodsType() == 1) {
-                    if (Validator.isNotEmpty(goodsVo.getGradeId())) {
-                        ClassGrade grade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>()
-                                .eq(ClassGrade::getGradeId, goodsVo.getGradeId()));
-                        //不存在班级有效期才校验服务期是否过期
-                        if (Validator.isEmpty(grade.getClassEndTime())) {
-                            throw new CustomException("存在已购买【学习服务期未过期】的视频商品,不可以重复购买商品", 511);
-                        }
-                    }
-                }
-                if (goodsVo.getGoodsType() == 2) {
-                    throw new CustomException("存在已购买【学习服务期未过期】的题库商品,不可以重复购买商品", 511);
-                }
-            }
-        }
+//        for (OrderGoodsVo goodsVo : list1) {
+//            if (Validator.isNotEmpty(goodsVo.getServiceEndTime()) && (goodsVo.getServiceEndTime().longValue() > (System.currentTimeMillis() / 1000))) {
+//                if (goodsVo.getGoodsType() == 1) {
+//                    if (Validator.isNotEmpty(goodsVo.getGradeId())) {
+//                        ClassGrade grade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>()
+//                                .eq(ClassGrade::getGradeId, goodsVo.getGradeId()));
+//                        //不存在班级有效期才校验服务期是否过期
+//                        if (Validator.isEmpty(grade.getClassEndTime())) {
+//                            throw new CustomException("存在已购买【学习服务期未过期】的视频商品,不可以重复购买商品", 511);
+//                        }
+//                    }
+//                }
+//                if (goodsVo.getGoodsType() == 2) {
+//                    throw new CustomException("存在已购买【学习服务期未过期】的题库商品,不可以重复购买商品", 511);
+//                }
+//            }
+//        }
         if (list1 != null && list1.size() > 0) {
             return list1.get(0).getOrderGoodsId();
         }

+ 38 - 4
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyMapper.xml

@@ -541,18 +541,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             LIMIT 1
     </select>
 
-    <select id="getExamUserInfo" parameterType="com.zhongzheng.modules.exam.bo.ExamApplyDetailBo" resultType="com.zhongzheng.modules.exam.vo.ExamApplyDetailVo">
+    <select id="getExamInfo" parameterType="com.zhongzheng.modules.exam.bo.ExamApplyDetailBo" resultType="com.zhongzheng.modules.exam.vo.ExamApplyDetailVo">
         SELECT
-            us.seat_number as seatNum,
-            u.realname as userName,
-            u.id_card as idCard
+        us.apply_id AS apply_id,
+        us.site_id AS site_id,
+        us.apply_site_exam_time AS exam_time,
+        us.apply_site_start_time AS start_time,
+        us.apply_site_end_time AS end_time
+        FROM
+        user_subscribe us
+        WHERE
+        us.subscribe_status = 1
+        <if test="examStartTime != null and examStartTime != ''">
+            AND us.apply_site_exam_time <![CDATA[ >= ]]> #{examStartTime}
+        </if>
+        <if test="examEndTime != null and examEndTime != ''">
+            AND us.apply_site_exam_time <![CDATA[ <= ]]> #{examEndTime}
+        </if>
+        <if test="startTime != null and startTime != ''">
+            AND us.apply_site_start_time = #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND us.apply_site_end_time = #{endTime}
+        </if>
+        AND us.tenant_id = 867735392558919680
+        GROUP BY
+        us.apply_id,
+        us.apply_site_exam_time,
+        us.site_id,
+        us.apply_site_start_time,
+        us.apply_site_end_time
+    </select>
+
+    <select id="getExamUserInfo" parameterType="com.zhongzheng.modules.exam.vo.ExamApplyDetailVo" resultType="com.zhongzheng.modules.exam.vo.ExamApplyUserDetailVo">
+        SELECT
+            us.seat_number AS seatNum,
+            u.realname AS userName,
+            u.id_card AS idCard
         FROM
             user_subscribe us
                 LEFT JOIN `user` u ON us.user_id = u.user_id
                 AND u.tenant_id = 867735392558919680
         WHERE
             us.subscribe_status = 1
+          AND us.apply_id = #{applyId}
           AND us.apply_site_exam_time = #{examTime}
+          AND us.site_id = #{siteId}
           AND us.apply_site_start_time = #{startTime}
           AND us.apply_site_end_time = #{endTime}
           AND us.tenant_id = 867735392558919680