Browse Source

Merge remote-tracking branch 'origin/master'

sangwenwei 1 year ago
parent
commit
4d8bfc5a7f

+ 8 - 1
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/calendar/controller/MyCalendarController.java

@@ -11,6 +11,7 @@ import com.jeeplus.calendar.service.dto.MyCalendarDTO;
 import com.jeeplus.calendar.service.mapstruct.MyCalendarWrapper;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.logging.annotation.ApiLog;
+import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.UserUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
@@ -46,7 +47,8 @@ public class MyCalendarController {
     @ApiLog("查询日历")
     @GetMapping("queryById")
     public ResponseEntity queryById(String id) {
-        return ResponseEntity.ok ( myCalendarService.getById ( id ) );
+        MyCalendar myCalendar = myCalendarService.queryById(id);
+        return ResponseEntity.ok ( myCalendar );
     }
 
     /**
@@ -74,6 +76,11 @@ public class MyCalendarController {
     @PostMapping("save")
     public ResponseEntity save(@Valid @RequestBody MyCalendarDTO myCalendarDTO) {
         myCalendarDTO.setUserDTO ( UserUtils.getCurrentUserDTO ( ) );
+        if (null == myCalendarDTO.getUserDTO()) {
+            UserDTO userDTO = new UserDTO();
+            userDTO.setId(myCalendarDTO.getUserId());
+            myCalendarDTO.setUserDTO(userDTO);
+        }
         myCalendarService.saveOrUpdate ( myCalendarWrapper.toEntity ( myCalendarDTO ) );
         return ResponseEntity.ok ( "保存成功!" );
     }

+ 2 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/calendar/mapper/MyCalendarMapper.java

@@ -3,6 +3,7 @@
  */
 package com.jeeplus.calendar.mapper;
 
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
@@ -19,6 +20,7 @@ import java.util.List;
  * @author liugf
  * @version 2021-06-11
  */
+@InterceptorIgnore(tenantLine = "true")
 public interface MyCalendarMapper extends BaseMapper <MyCalendar> {
 
     List <MyCalendarDTO> findList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper);

+ 3 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/calendar/service/MyCalendarService.java

@@ -30,5 +30,8 @@ public class MyCalendarService extends ServiceImpl <MyCalendarMapper, MyCalendar
         return baseMapper.findList ( queryWrapper );
     }
 
+    public MyCalendar queryById(String id) {
+        return baseMapper.selectById(id);
+    }
 
 }

+ 5 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/calendar/service/dto/MyCalendarDTO.java

@@ -22,6 +22,11 @@ public class MyCalendarDTO {
     private static final long serialVersionUID = 1L;
 
     /**
+     * 移动端用
+     */
+    private String userId;
+
+    /**
      * 实体主键
      */
     private String id;