dzx 1 anno fa
parent
commit
11e2dcfbe8

+ 3 - 0
src/main/java/com/xjrsoft/module/activity/vo/ActivityInfoPageVo.java

@@ -52,6 +52,9 @@ public class ActivityInfoPageVo {
     */
     @ApiModelProperty("组织部门(xjr_department)")
     private Long orgId;
+
+    @ApiModelProperty("组织部门名称")
+    private String orgCn;
     /**
     * 报名结束时间
     */

+ 11 - 1
src/main/java/com/xjrsoft/module/courseTable/controller/SecondCourseController.java

@@ -17,6 +17,7 @@ import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.activity.dto.ChangeStatusDto;
+import com.xjrsoft.module.courseTable.dto.UserEnrollDto;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.concat.service.IXjrUserService;
@@ -86,6 +87,15 @@ public class SecondCourseController {
             if(record.getEnrollStatus() > 0){
                 record.setEnrollStatus(1);
             }
+            if(record.getCoverId() != null){
+                File file = fileService.getOne(
+                        new QueryWrapper<File>().lambda()
+                                .select(File::getId)
+                                .select(File.class, x -> VoToColumnUtil.fieldsToColumns(File.class).contains(x.getProperty()))
+                                .eq(File::getFolderId, record.getCoverId())
+                );
+                record.setCoverUrl(file.getFileUrl());
+            }
         }
         PageOutput<SecondCoursePageVo> pageOutput = ConventPage.getPageOutput(page, SecondCoursePageVo.class);
         return RT.ok(pageOutput);
@@ -227,7 +237,7 @@ public class SecondCourseController {
     @PostMapping(value = "/enroll")
     @ApiOperation(value="报名")
     @SaCheckPermission("secondcourse:detail")
-    public RT<Boolean> enroll(@Valid ChangeStatusDto dto){
+    public RT<Boolean> enroll(@Valid UserEnrollDto dto){
         Boolean enroll = secondCourseService.enroll(dto);
         return RT.ok(enroll);
     }

+ 26 - 0
src/main/java/com/xjrsoft/module/courseTable/dto/UserEnrollDto.java

@@ -0,0 +1,26 @@
+package com.xjrsoft.module.courseTable.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+* @title: 活动信息
+* @Author dzx
+* @Date: 2024-07-19
+* @Version 1.0
+*/
+@Data
+public class UserEnrollDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("课程id")
+    private Long id;
+    /**
+    */
+    @ApiModelProperty("手机号")
+    private String mobile;
+}

+ 2 - 3
src/main/java/com/xjrsoft/module/courseTable/service/ISecondCourseService.java

@@ -2,7 +2,7 @@ package com.xjrsoft.module.courseTable.service;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseService;
-import com.xjrsoft.module.activity.dto.ChangeStatusDto;
+import com.xjrsoft.module.courseTable.dto.UserEnrollDto;
 import com.xjrsoft.module.courseTable.dto.AddSecondCourseDto;
 import com.xjrsoft.module.courseTable.dto.SecondCourseEnrollPageDto;
 import com.xjrsoft.module.courseTable.dto.SecondCoursePageDto;
@@ -10,7 +10,6 @@ import com.xjrsoft.module.courseTable.dto.UpdateSecondCourseDto;
 import com.xjrsoft.module.courseTable.entity.SecondCourse;
 import com.xjrsoft.module.courseTable.vo.SecondCourseEnrollVo;
 import com.xjrsoft.module.courseTable.vo.SecondCoursePageVo;
-import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -49,7 +48,7 @@ public interface ISecondCourseService extends MPJBaseService<SecondCourse> {
 
     List<SecondCourseEnrollVo> getEnrollList( SecondCourseEnrollPageDto dto);
 
-    Boolean enroll(ChangeStatusDto dto);
+    Boolean enroll(UserEnrollDto dto);
 
     Page<SecondCoursePageVo> getMyPage(Page<SecondCoursePageVo> page, SecondCoursePageDto dto);
 }

+ 12 - 5
src/main/java/com/xjrsoft/module/courseTable/service/impl/SecondCourseServiceImpl.java

@@ -2,13 +2,15 @@ package com.xjrsoft.module.courseTable.service.impl;
 
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.xjrsoft.common.exception.MyException;
-import com.xjrsoft.module.activity.dto.ChangeStatusDto;
+import com.xjrsoft.module.concat.service.IXjrUserService;
+import com.xjrsoft.module.courseTable.dto.UserEnrollDto;
 import com.xjrsoft.module.courseTable.dto.AddSecondCourseDto;
 import com.xjrsoft.module.courseTable.dto.SecondCourseEnrollPageDto;
 import com.xjrsoft.module.courseTable.dto.SecondCoursePageDto;
@@ -24,6 +26,7 @@ import com.xjrsoft.module.courseTable.mapper.SecondCourseTimeMapper;
 import com.xjrsoft.module.courseTable.service.ISecondCourseService;
 import com.xjrsoft.module.courseTable.vo.SecondCourseEnrollVo;
 import com.xjrsoft.module.courseTable.vo.SecondCoursePageVo;
+import com.xjrsoft.module.teacher.entity.XjrUser;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -46,7 +49,7 @@ public class SecondCourseServiceImpl extends MPJBaseServiceImpl<SecondCourseMapp
     private final SecondCourseTimeMapper courseTimeMapper;
     private final SecondCourseEnrollRangeMapper enrollRangeMapper;
     private final SecondCourseEnrollMapper enrollMapper;
-
+    private final IXjrUserService xjrUserService;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -172,14 +175,14 @@ public class SecondCourseServiceImpl extends MPJBaseServiceImpl<SecondCourseMapp
     }
 
     @Override
-    public Boolean enroll(ChangeStatusDto dto) {
+    public Boolean enroll(UserEnrollDto dto) {
         List<SecondCourseEnroll> enrollList = enrollMapper.selectList(
                 new QueryWrapper<SecondCourseEnroll>().lambda()
                         .eq(SecondCourseEnroll::getUserId, StpUtil.getLoginIdAsLong())
                         .eq(SecondCourseEnroll::getSecondCourseId, dto.getId())
         );
         if(!enrollList.isEmpty()){
-            throw new MyException("已报名,无需重复报名");
+            throw  new MyException("已报名,无需重复报名");
         }
         SecondCourseEnroll enroll = new SecondCourseEnroll() {{
             setUserId(StpUtil.getLoginIdAsLong());
@@ -187,7 +190,11 @@ public class SecondCourseServiceImpl extends MPJBaseServiceImpl<SecondCourseMapp
         }};
         enrollMapper.insert(enroll);
 
-
+        XjrUser xjrUser = xjrUserService.getById(StpUtil.getLoginIdAsLong());
+        if(StrUtil.isNotEmpty(dto.getMobile()) && !dto.getMobile().equals(xjrUser.getMobile())){
+            xjrUser.setMobile(dto.getMobile());
+            xjrUserService.updateById(xjrUser);
+        }
         return true;
     }
 

+ 6 - 0
src/main/java/com/xjrsoft/module/courseTable/vo/SecondCoursePageVo.java

@@ -60,4 +60,10 @@ public class SecondCoursePageVo {
     @ApiModelProperty("是否报名(0:否 1:是)")
     private Integer enrollStatus;
 
+    @ApiModelProperty("封面id")
+    private Long coverId;
+
+    @ApiModelProperty("封面url")
+    private String coverUrl;
+
 }

+ 1 - 1
src/main/resources/mapper/activity/ActivityInfoMapper.xml

@@ -6,7 +6,7 @@
     <select id="getPage" parameterType="com.xjrsoft.module.activity.dto.ActivityInfoPageDto" resultType="com.xjrsoft.module.activity.vo.ActivityInfoPageVo">
         SELECT t1.id,t2.name AS type_cn,t3.company_name AS enterprise_name,t1.name,t1.place,t1.start_date,t1.end_date,
         t1.type, t4.name AS org_name, t1.enroll_end_time, t1.duty_person,t1.duty_person_mobile, t1.cover_file_id,
-        t1.enroll_range, t1.status,t1.content,t1.category,t4.name as org_name,t1.org_id,
+        t1.enroll_range, t1.status,t1.content,t1.category,t4.name as org_cn,t1.org_id,
         (SELECT COUNT(*) FROM activity_enroll WHERE delete_mark = 0 AND activity_info_id = t1.id) as enroll_count FROM activity_info t1
         LEFT JOIN xjr_dictionary_detail t2 ON t1.type = t2.code
         LEFT JOIN company_coop t3 ON t1.enterprise_id = t3.id

+ 1 - 1
src/main/resources/mapper/banding/BandingTaskMajorConditionMapper.xml

@@ -15,7 +15,7 @@
             </foreach>
         </if>
         <if test="dto.majorSetName != null and dto.majorSetName != ''">
-            and t1.name like concat('', #{dto.majorSetName},'')
+            and t.name like concat('', #{dto.majorSetName},'')
         </if>
     </select>
     <select id="getStudentMajorId" parameterType="com.xjrsoft.module.banding.dto.BandingTaskClassPageDto" resultType="com.xjrsoft.module.student.entity.BaseNewStudent">