日常计划添加
This commit is contained in:
parent
8032c1bfff
commit
f57b108027
|
@ -0,0 +1,40 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.rax</groupId>
|
||||||
|
<artifactId>rax</artifactId>
|
||||||
|
<version>3.7.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>daily-plan</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.rax</groupId>
|
||||||
|
<artifactId>common-swagger</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.rax</groupId>
|
||||||
|
<artifactId>common-mybatis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.rax</groupId>
|
||||||
|
<artifactId>common-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.rax</groupId>
|
||||||
|
<artifactId>common-log</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.rax.dailyplan.controller;
|
||||||
|
|
||||||
|
import com.rax.common.core.util.R;
|
||||||
|
import com.rax.dailyplan.dto.DailyPlanDTO;
|
||||||
|
import com.rax.dailyplan.service.DailyPlanService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/dailyPlan")
|
||||||
|
public class DailyPlanController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DailyPlanService dailyPlanService;
|
||||||
|
|
||||||
|
@PostMapping("/addDailyPlan")
|
||||||
|
public R addDailyPlan(DailyPlanDTO dailyPlanDTO) {
|
||||||
|
return dailyPlanService.addDailyPlan(dailyPlanDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.rax.dailyplan.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "日常计划")
|
||||||
|
public class DailyPlanDTO {
|
||||||
|
|
||||||
|
@Schema(description = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "计划类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "计划状态,已处理:1,未处理:0")
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
@Schema(description = "日期")
|
||||||
|
private String date;
|
||||||
|
|
||||||
|
@Schema(description = "时间")
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
@Schema(description = "内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||||
|
private String delFlag;
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.rax.dailyplan.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "日常计划")
|
||||||
|
public class DailyPlan implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "计划类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "计划状态,已处理:1,未处理:0")
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
@Schema(description = "日期")
|
||||||
|
private String date;
|
||||||
|
|
||||||
|
@Schema(description = "时间")
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
@Schema(description = "内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@Schema(description = "所属人id")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0-正常,1-删除
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.rax.dailyplan.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.rax.dailyplan.entity.DailyPlan;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface DailyPlanMapper extends BaseMapper<DailyPlan> {
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.rax.dailyplan.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.rax.common.core.util.R;
|
||||||
|
import com.rax.dailyplan.dto.DailyPlanDTO;
|
||||||
|
import com.rax.dailyplan.entity.DailyPlan;
|
||||||
|
|
||||||
|
public interface DailyPlanService extends IService<DailyPlan> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param dailyPlanDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R addDailyPlan(DailyPlanDTO dailyPlanDTO);
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.rax.dailyplan.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.rax.common.core.util.R;
|
||||||
|
import com.rax.dailyplan.dto.DailyPlanDTO;
|
||||||
|
import com.rax.dailyplan.entity.DailyPlan;
|
||||||
|
import com.rax.dailyplan.mapper.DailyPlanMapper;
|
||||||
|
import com.rax.dailyplan.service.DailyPlanService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DailyPlanServiceImpl extends ServiceImpl<DailyPlanMapper, DailyPlan> implements DailyPlanService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DailyPlanMapper dailyPlanMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R addDailyPlan(DailyPlanDTO dailyPlanDTO) {
|
||||||
|
DailyPlan dailyPlan = new DailyPlan();
|
||||||
|
BeanUtils.copyProperties(dailyPlanDTO, dailyPlan);
|
||||||
|
boolean status = save(dailyPlan);
|
||||||
|
return R.ok(status);
|
||||||
|
}
|
||||||
|
}
|
15
db/pig.sql
15
db/pig.sql
|
@ -747,4 +747,19 @@ CREATE TABLE `sys_hospital` (
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
INSERT INTO `sys_hospital` VALUES ('111', '111', '111', '111', '111', b'1', '111', '11', b'0', '111', '11', '111');
|
INSERT INTO `sys_hospital` VALUES ('111', '111', '111', '111', '111', b'1', '111', '11', b'0', '111', '11', '111');
|
||||||
|
|
||||||
|
----------------------------------------------
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `sys_daily_plan`;
|
||||||
|
CREATE TABLE `sys_daily_plan` (
|
||||||
|
`id` bigint NOT NULL COMMENT '主键',
|
||||||
|
`title` varchar(800) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '计划标题',
|
||||||
|
`type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '日常计划类型',
|
||||||
|
`status` bit(1) NULL DEFAULT NULL COMMENT '计划处理状态',
|
||||||
|
`date` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '计划处理时间',
|
||||||
|
`time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '计划处理时间',
|
||||||
|
`content` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '计划内容',
|
||||||
|
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '删除标记,0未删除,1已删除',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS = 1;
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user