Browse Source

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java
dzx 1 year ago
parent
commit
8c2a88c84f
19 changed files with 613 additions and 20 deletions
  1. 14 1
      src/main/java/com/xjrsoft/module/oa/controller/NewsController.java
  2. 94 0
      src/main/java/com/xjrsoft/module/room/controller/RoomStudentAppointController.java
  3. 58 0
      src/main/java/com/xjrsoft/module/room/dto/AddRoomStudentAppointDto.java
  4. 31 0
      src/main/java/com/xjrsoft/module/room/dto/RoomStudentAppointPageDto.java
  5. 32 0
      src/main/java/com/xjrsoft/module/room/dto/UpdateRoomStudentAppointDto.java
  6. 108 0
      src/main/java/com/xjrsoft/module/room/entity/RoomStudentAppoint.java
  7. 17 0
      src/main/java/com/xjrsoft/module/room/mapper/RoomStudentAppointMapper.java
  8. 17 0
      src/main/java/com/xjrsoft/module/room/service/IRoomStudentAppointService.java
  9. 25 0
      src/main/java/com/xjrsoft/module/room/service/impl/RoomStudentAppointServiceImpl.java
  10. 52 0
      src/main/java/com/xjrsoft/module/room/vo/HeadTeaRoomCadreAppointPageVo.java
  11. 0 1
      src/main/java/com/xjrsoft/module/room/vo/RoomPageVo.java
  12. 46 0
      src/main/java/com/xjrsoft/module/room/vo/RoomStudentAppointPageVo.java
  13. 59 0
      src/main/java/com/xjrsoft/module/room/vo/RoomStudentAppointVo.java
  14. 8 13
      src/main/java/com/xjrsoft/module/teacher/controller/AttendanceRecordController.java
  15. 5 2
      src/main/java/com/xjrsoft/module/teacher/service/impl/AttendanceRecordServiceImpl.java
  16. 14 0
      src/main/java/com/xjrsoft/module/teacher/vo/AttendanceRecordPageVo.java
  17. 1 1
      src/main/resources/mapper/textbook/TextbookStudentClaimMapper.xml
  18. 1 2
      src/main/resources/sqlScript/20231218_sql.sql
  19. 31 0
      src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

+ 14 - 1
src/main/java/com/xjrsoft/module/oa/controller/NewsController.java

@@ -311,7 +311,20 @@ public class NewsController {
             NewsCountTypeVo newsCountTypeVo = new NewsCountTypeVo();
             newsCountTypeVo.setTypeId(typeId);
             newsCountTypeVo.setTotal(totalType);
-            News news = newsService.getOne(Wrappers.<News>query().lambda().eq(News::getTypeId, typeId).orderByDesc(News::getReleaseTime).last("limit 1"));
+            News news = new News();
+            if(typeId == 1){
+                news = newsService.getOne(Wrappers.<News>query().lambda().eq(News::getTypeId, typeId).orderByDesc(News::getReleaseTime).last("limit 1"));
+            }
+            if(typeId == 2){
+                news = newsService.selectJoinOne(News.class,
+                        new MPJLambdaWrapper<News>()
+                                .disableSubLogicDel()
+                                .eq(News::getTypeId, typeId)
+                                .eq(NewsRelation::getUserId, StpUtil.getLoginIdAsLong())
+                                .orderByDesc(News::getReleaseTime)
+                                .last("limit 1")
+                                .innerJoin(NewsRelation.class, NewsRelation::getNewsId, News::getId));
+            }
             if (news != null) {
                 newsCountTypeVo.setTime(news.getReleaseTime());
                 newsCountTypeVo.setTitle(news.getBriefHead());

+ 94 - 0
src/main/java/com/xjrsoft/module/room/controller/RoomStudentAppointController.java

@@ -0,0 +1,94 @@
+package com.xjrsoft.module.room.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.room.dto.AddRoomStudentAppointDto;
+import com.xjrsoft.module.room.dto.RoomStudentAppointPageDto;
+import com.xjrsoft.module.room.dto.UpdateRoomStudentAppointDto;
+import com.xjrsoft.module.room.entity.RoomStudentAppoint;
+import com.xjrsoft.module.room.service.IRoomStudentAppointService;
+import com.xjrsoft.module.room.vo.RoomStudentAppointPageVo;
+import com.xjrsoft.module.room.vo.RoomStudentAppointVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+* @title: 寝室长任命
+* @Author dzx
+* @Date: 2023-12-30
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/room" + "/roomStudentAppoint")
+@Api(value = "/room"  + "/roomStudentAppoint",tags = "寝室干部任命代码")
+@AllArgsConstructor
+public class RoomStudentAppointController {
+
+
+    private final IRoomStudentAppointService roomStudentAppointService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="寝室干部任命列表(分页)")
+    @SaCheckPermission("roomstudentappoint:detail")
+    public RT<PageOutput<RoomStudentAppointPageVo>> page(@Valid RoomStudentAppointPageDto dto){
+
+        LambdaQueryWrapper<RoomStudentAppoint> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper
+                    .orderByDesc(RoomStudentAppoint::getId)
+                .select(RoomStudentAppoint.class,x -> VoToColumnUtil.fieldsToColumns(RoomStudentAppointPageVo.class).contains(x.getProperty()));
+        IPage<RoomStudentAppoint> page = roomStudentAppointService.page(ConventPage.getPage(dto), queryWrapper);
+        PageOutput<RoomStudentAppointPageVo> pageOutput = ConventPage.getPageOutput(page, RoomStudentAppointPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询寝室干部信息")
+    @SaCheckPermission("roomstudentappoint:detail")
+    public RT<RoomStudentAppointVo> info(@RequestParam Long id){
+        RoomStudentAppoint roomStudentAppoint = roomStudentAppointService.getById(id);
+        if (roomStudentAppoint == null) {
+           return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(roomStudentAppoint, RoomStudentAppointVo.class));
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增寝室干部任命")
+    @SaCheckPermission("roomstudentappoint:add")
+    public RT<Boolean> add(@Valid @RequestBody AddRoomStudentAppointDto dto){
+        RoomStudentAppoint roomStudentAppoint = BeanUtil.toBean(dto, RoomStudentAppoint.class);
+        boolean isSuccess = roomStudentAppointService.save(roomStudentAppoint);
+    return RT.ok(isSuccess);
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改寝室干部任命")
+    @SaCheckPermission("roomstudentappoint:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateRoomStudentAppointDto dto){
+
+        RoomStudentAppoint roomStudentAppoint = BeanUtil.toBean(dto, RoomStudentAppoint.class);
+        return RT.ok(roomStudentAppointService.updateById(roomStudentAppoint));
+
+    }
+
+    @DeleteMapping
+    @ApiOperation(value = "删除寝室干部任命")
+    @SaCheckPermission("roomstudentappoint:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(roomStudentAppointService.removeBatchByIds(ids));
+
+    }
+
+}

+ 58 - 0
src/main/java/com/xjrsoft/module/room/dto/AddRoomStudentAppointDto.java

@@ -0,0 +1,58 @@
+package com.xjrsoft.module.room.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+
+/**
+* @title: 寝室长任命
+* @Author dzx
+* @Date: 2023-12-30
+* @Version 1.0
+*/
+@Data
+public class AddRoomStudentAppointDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 寝室编号(room)
+    */
+    @ApiModelProperty("寝室编号(room)")
+    private Long roomId;
+    /**
+    * 寝室床位编号(room_bed)
+    */
+    @ApiModelProperty("寝室床位编号(room_bed)")
+    private Long roomBedId;
+    /**
+    * 学生用户编号
+    */
+    @ApiModelProperty("学生用户编号")
+    private Long studentUserId;
+    /**
+    * 职务编号【只取职位级别为寝室的,cadreLevel_room】(base_student_post)
+    */
+    @ApiModelProperty("职务编号【只取职位级别为寝室的,cadreLevel_room】(base_student_post)")
+    private Long postId;
+    /**
+    * 备注
+    */
+    @ApiModelProperty("备注")
+    private String remark;
+
+}

+ 31 - 0
src/main/java/com/xjrsoft/module/room/dto/RoomStudentAppointPageDto.java

@@ -0,0 +1,31 @@
+package com.xjrsoft.module.room.dto;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+/**
+* @title: 寝室长任命分页查询入参
+* @Author dzx
+* @Date: 2023-12-30
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class RoomStudentAppointPageDto extends PageInput {
+    /**
+     * 入住性别(xjr_dictionary_item[gender])
+     */
+    @ApiModelProperty("入住性别(xjr_dictionary_item[gender])")
+    private String gender;
+    /**
+     * 寝室主键编号
+     */
+    @ApiModelProperty("寝室主键编号")
+    @TableId
+    private Long roonId;
+
+}

+ 32 - 0
src/main/java/com/xjrsoft/module/room/dto/UpdateRoomStudentAppointDto.java

@@ -0,0 +1,32 @@
+package com.xjrsoft.module.room.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.List;
+import java.util.Date;
+
+
+
+/**
+* @title: 寝室长任命
+* @Author dzx
+* @Date: 2023-12-30
+* @Version 1.0
+*/
+@Data
+public class UpdateRoomStudentAppointDto extends AddRoomStudentAppointDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+}

+ 108 - 0
src/main/java/com/xjrsoft/module/room/entity/RoomStudentAppoint.java

@@ -0,0 +1,108 @@
+package com.xjrsoft.module.room.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.github.yulichang.annotation.EntityMapping;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+/**
+* @title: 寝室长任命
+* @Author dzx
+* @Date: 2023-12-30
+* @Version 1.0
+*/
+@Data
+@TableName("room_student_appoint")
+@ApiModel(value = "room_student_appoint", description = "寝室长任命")
+public class RoomStudentAppoint implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    @TableId
+    private Long id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+    * 修改时间
+    */
+    @ApiModelProperty("修改时间")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+    * 有效标志
+    */
+    @ApiModelProperty("有效标志")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 寝室编号(room)
+    */
+    @ApiModelProperty("寝室编号(room)")
+    private Long roomId;
+    /**
+    * 寝室床位编号(room_bed)
+    */
+    @ApiModelProperty("寝室床位编号(room_bed)")
+    private Long roomBedId;
+    /**
+    * 学生用户编号
+    */
+    @ApiModelProperty("学生用户编号")
+    private Long studentUserId;
+    /**
+    * 职务编号【只取职位级别为寝室的,cadreLevel_room】(base_student_post)
+    */
+    @ApiModelProperty("职务编号【只取职位级别为寝室的,cadreLevel_room】(base_student_post)")
+    private Long postId;
+    /**
+    * 备注
+    */
+    @ApiModelProperty("备注")
+    private String remark;
+
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/room/mapper/RoomStudentAppointMapper.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.room.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.room.entity.RoomStudentAppoint;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 寝室长任命
+* @Author dzx
+* @Date: 2023-12-30
+* @Version 1.0
+*/
+@Mapper
+public interface RoomStudentAppointMapper extends MPJBaseMapper<RoomStudentAppoint> {
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/room/service/IRoomStudentAppointService.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.room.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.room.entity.RoomStudentAppoint;
+import lombok.Data;
+import java.util.List;
+
+/**
+* @title: 寝室长任命
+* @Author dzx
+* @Date: 2023-12-30
+* @Version 1.0
+*/
+
+public interface IRoomStudentAppointService extends MPJBaseService<RoomStudentAppoint> {
+}

+ 25 - 0
src/main/java/com/xjrsoft/module/room/service/impl/RoomStudentAppointServiceImpl.java

@@ -0,0 +1,25 @@
+package com.xjrsoft.module.room.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.room.entity.RoomStudentAppoint;
+import com.xjrsoft.module.room.mapper.RoomStudentAppointMapper;
+import com.xjrsoft.module.room.service.IRoomStudentAppointService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+
+/**
+* @title: 寝室长任命
+* @Author dzx
+* @Date: 2023-12-30
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class RoomStudentAppointServiceImpl extends MPJBaseServiceImpl<RoomStudentAppointMapper, RoomStudentAppoint> implements IRoomStudentAppointService {
+}

+ 52 - 0
src/main/java/com/xjrsoft/module/room/vo/HeadTeaRoomCadreAppointPageVo.java

@@ -0,0 +1,52 @@
+package com.xjrsoft.module.room.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.xjrsoft.module.room.entity.RoomBed;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+* @title: 寝室长任命分页列表出参
+* @Author dzx
+* @Date: 2023-12-30
+* @Version 1.0
+*/
+@Data
+public class HeadTeaRoomCadreAppointPageVo {
+
+    /**
+    * 寝室编号(room)
+    */
+    @ApiModelProperty("寝室编号(room)")
+    private String roomId;
+    /**
+     * 入住性别(xjr_dictionary_item[gender])
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("入住性别")
+    @ApiModelProperty("入住性别")
+    private String genderCn;
+    /**
+     * 寝室名称
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("寝室名称")
+    @ApiModelProperty("寝室名称")
+    private String roomName;
+    /**
+     * 是否是混合寝室【一个寝室有多个班级的学生】(1:是 0:否)
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("是否是混合寝室【一个寝室有多个班级的学生】(1:是 0:否)")
+    @ApiModelProperty("是否是混合寝室【一个寝室有多个班级的学生】(1:是 0:否)")
+    private Integer isMax;
+    /**
+     * 寝室床位信息
+     */
+    @ApiModelProperty("寝室床位信息")
+    private List<RoomBed> roomBedList;
+
+}

+ 0 - 1
src/main/java/com/xjrsoft/module/room/vo/RoomPageVo.java

@@ -102,5 +102,4 @@ public class RoomPageVo {
     @ExcelProperty("备注")
     @ApiModelProperty("备注")
     private String remark;
-
 }

+ 46 - 0
src/main/java/com/xjrsoft/module/room/vo/RoomStudentAppointPageVo.java

@@ -0,0 +1,46 @@
+package com.xjrsoft.module.room.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 寝室长任命分页列表出参
+* @Author dzx
+* @Date: 2023-12-30
+* @Version 1.0
+*/
+@Data
+public class RoomStudentAppointPageVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private String id;
+    /**
+    * 寝室编号(room)
+    */
+    @ApiModelProperty("寝室编号(room)")
+    private Long roomId;
+    /**
+    * 寝室床位编号(room_bed)
+    */
+    @ApiModelProperty("寝室床位编号(room_bed)")
+    private Long roomBedId;
+    /**
+    * 学生用户编号
+    */
+    @ApiModelProperty("学生用户编号")
+    private Long studentUserId;
+    /**
+    * 职务编号【只取职位级别为寝室的,cadreLevel_room】(base_student_post)
+    */
+    @ApiModelProperty("职务编号【只取职位级别为寝室的,cadreLevel_room】(base_student_post)")
+    private Long postId;
+    /**
+    * 备注
+    */
+    @ApiModelProperty("备注")
+    private String remark;
+
+}

+ 59 - 0
src/main/java/com/xjrsoft/module/room/vo/RoomStudentAppointVo.java

@@ -0,0 +1,59 @@
+package com.xjrsoft.module.room.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+/**
+* @title: 寝室长任命表单出参
+* @Author dzx
+* @Date: 2023-12-30
+* @Version 1.0
+*/
+@Data
+public class RoomStudentAppointVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 寝室编号(room)
+    */
+    @ApiModelProperty("寝室编号(room)")
+    private Long roomId;
+    /**
+    * 寝室床位编号(room_bed)
+    */
+    @ApiModelProperty("寝室床位编号(room_bed)")
+    private Long roomBedId;
+    /**
+    * 学生用户编号
+    */
+    @ApiModelProperty("学生用户编号")
+    private Long studentUserId;
+    /**
+    * 职务编号【只取职位级别为寝室的,cadreLevel_room】(base_student_post)
+    */
+    @ApiModelProperty("职务编号【只取职位级别为寝室的,cadreLevel_room】(base_student_post)")
+    private Long postId;
+    /**
+    * 备注
+    */
+    @ApiModelProperty("备注")
+    private String remark;
+
+
+
+}

+ 8 - 13
src/main/java/com/xjrsoft/module/teacher/controller/AttendanceRecordController.java

@@ -11,11 +11,9 @@ import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.utils.VoToColumnUtil;
-import com.xjrsoft.module.teacher.dto.AddAttendanceRecordDto;
-import com.xjrsoft.module.teacher.dto.AttendanceRecordPageDto;
-import com.xjrsoft.module.teacher.dto.ClockInDto;
-import com.xjrsoft.module.teacher.dto.GetCheckInDayDto;
-import com.xjrsoft.module.teacher.dto.UpdateAttendanceRecordDto;
+import com.xjrsoft.module.organization.entity.Department;
+import com.xjrsoft.module.organization.entity.UserDeptRelation;
+import com.xjrsoft.module.teacher.dto.*;
 import com.xjrsoft.module.teacher.entity.AttendanceRecord;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.teacher.service.IAttendanceRecordService;
@@ -26,14 +24,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.DeleteMapping;
-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.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
@@ -65,8 +56,12 @@ public class AttendanceRecordController {
                 .disableSubLogicDel()
                 .select(AttendanceRecord::getId)
                 .selectAs(XjrUser::getName, AttendanceRecordPageVo::getUserName)
+                .selectAs(XjrUser::getUserName, AttendanceRecordPageVo::getOA)
+                .selectAs(Department::getName, AttendanceRecordPageVo::getDeptName)
                 .select(AttendanceRecord.class, x -> VoToColumnUtil.fieldsToColumns(AttendanceRecordPageVo.class).contains(x.getProperty()))
                 .leftJoin(XjrUser.class, XjrUser::getId, AttendanceRecord::getUserId)
+                .leftJoin(UserDeptRelation.class, UserDeptRelation::getUserId,AttendanceRecord::getUserId)
+                .leftJoin(Department.class, Department::getId,UserDeptRelation::getDeptId)
                 .like(ObjectUtil.isNotNull(dto.getUserName()) && !(dto.getUserName().equals("")),XjrUser::getName,dto.getUserName())
                 .between(ObjectUtil.isNotNull(dto.getCheckTimeStart()) && ObjectUtil.isNotNull(dto.getCheckTimeEnd()) && !dto.getCheckTimeStart().equals("") && !dto.getCheckTimeEnd().equals(""),
                         AttendanceRecord::getCheckTime,dto.getCheckTimeStart(),dto.getCheckTimeEnd())

+ 5 - 2
src/main/java/com/xjrsoft/module/teacher/service/impl/AttendanceRecordServiceImpl.java

@@ -23,6 +23,7 @@ import com.xjrsoft.module.teacher.vo.AttendanceConfigPageVo;
 import com.xjrsoft.module.teacher.vo.PresentUserCheckInfoVo;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.time.Instant;
 import java.time.LocalDate;
@@ -49,12 +50,13 @@ public class AttendanceRecordServiceImpl extends MPJBaseServiceImpl<AttendanceRe
 
     private final XjrUserMapper xjrUserMapper;
     @Override
+    @Transactional
     public Boolean addAttendanceRecordOfClockIn(AttendanceRecord attendanceRecord) {
         if(ObjectUtil.isNotNull(attendanceRecord.getLongitude())
                 && ObjectUtil.isNotNull(attendanceRecord.getLatitude())
                 && ObjectUtil.isNotNull(attendanceRecord.getAddress())
                 ){//上班打卡
-            Long userId = Long.parseLong(StpUtil.getLoginIdAsString());
+            Long userId = StpUtil.getLoginIdAsLong();
             attendanceRecord.setUserId(userId);
             long time = System.currentTimeMillis();
             Date date_now = new Date(time);
@@ -139,7 +141,7 @@ public class AttendanceRecordServiceImpl extends MPJBaseServiceImpl<AttendanceRe
     @Override
     public PresentUserCheckInfoVo getPresentUserCheckInfo() {
         AttendanceRecord dto = new AttendanceRecord();
-        Long userId = Long.parseLong(StpUtil.getLoginIdAsString());
+        Long userId = StpUtil.getLoginIdAsLong();
         dto.setUserId(userId);
         long time = System.currentTimeMillis();
         Date date_now = new Date(time);
@@ -153,6 +155,7 @@ public class AttendanceRecordServiceImpl extends MPJBaseServiceImpl<AttendanceRe
         //已经上班打卡
         MPJLambdaWrapper<AttendanceRecord> queryWrapper = new MPJLambdaWrapper<>();
         queryWrapper
+                .disableSubLogicDel()
                 .selectAs(XjrUser::getName, PresentUserCheckInfoVo::getUserName)
                 .selectAs(Post::getName, PresentUserCheckInfoVo::getPostName)
                 .select(AttendanceRecord.class, x -> VoToColumnUtil.fieldsToColumns(PresentUserCheckInfoVo.class).contains(x.getProperty()))

+ 14 - 0
src/main/java/com/xjrsoft/module/teacher/vo/AttendanceRecordPageVo.java

@@ -30,6 +30,20 @@ public class AttendanceRecordPageVo {
     @ExcelProperty("用户名")
     @ApiModelProperty("用户名")
     private String userName;
+    /**
+     * OA
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("OA")
+    @ApiModelProperty("OA")
+    private String OA;
+    /**
+     * 用户名
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("部门名")
+    @ApiModelProperty("部门名")
+    private String deptName;
     /**
     * 打卡时间
     */

+ 1 - 1
src/main/resources/mapper/textbook/TextbookStudentClaimMapper.xml

@@ -85,7 +85,7 @@
         </if>
         GROUP BY student_user_id)
         <if test="dto.studentUserId != null and dto.studentUserId != 0 and dto.studentUserId != ''">
-            t.id = #{dto.studentUserId}
+            and t.id = #{dto.studentUserId}
         </if>
     </select>
 

+ 1 - 2
src/main/resources/sqlScript/20231218_sql.sql

@@ -770,7 +770,6 @@ CREATE TABLE room_bed_record_item
     `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
     `room_bed_record_id` bigint NOT NULL COMMENT '寝室床位记录编号(room_bed_record)',
     `room_id` bigint NOT NULL COMMENT '寝室编号(room)',
-    `distribute_bed_number` int NULL DEFAULT 0 COMMENT '分配床位数',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '寝室床位记录项';
 
@@ -918,7 +917,7 @@ CREATE TABLE room_value_week
 -- 宿管值班管理(人员)
 -- ----------------------------
 DROP TABLE IF EXISTS room_value_week_item;
-CREATE TABLE room_value_week
+CREATE TABLE room_value_week_item
 (
     id BIGINT NOT NULL COMMENT '主键编号',
     `create_user_id` BIGINT NULL DEFAULT NULL COMMENT '创建人',

+ 31 - 0
src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

@@ -1673,4 +1673,35 @@ public class FreeMarkerGeneratorTest {
         apiGeneratorService.generateCodes(params);
     }
 
+
+    /**
+     * 寝室干部任命(任命学生)
+     * @throws IOException
+     */
+    @Test
+    public void gcRoomStudentAppoint() throws IOException {
+        List<TableConfig> tableConfigs = new ArrayList<>();
+        TableConfig mainTable = new TableConfig();
+        mainTable.setTableName("room_student_appoint");//init_sql中的表名
+        mainTable.setIsMain(true);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        tableConfigs.add(mainTable);
+
+        ApiGenerateCodesDto params = new ApiGenerateCodesDto();
+        params.setAuthor("dzx");//作者名称
+        params.setPackageName("room");//包名
+        params.setTableConfigs(tableConfigs);
+        params.setPage(true);//是否生成分页接口
+        params.setImport(false);//是否生成导入接口
+        params.setExport(false);//是否生成导出接口
+        params.setOutMainDir(true);//是否生成在主目录,前期测试可设置成false
+        params.setDs(ds);
+
+        IApiGeneratorService apiGeneratorService = new ApiGeneratorServiceImpl();
+
+        apiGeneratorService.generateCodes(params);
+    }
+
+
 }