医案添加删除修改
This commit is contained in:
@@ -64,12 +64,6 @@ public class BookMedicalRecordsController {
|
|||||||
@RequestMapping("/saveOrUpdate")
|
@RequestMapping("/saveOrUpdate")
|
||||||
public R save(@RequestBody BookMedicalRecordsEntity entity){
|
public R save(@RequestBody BookMedicalRecordsEntity entity){
|
||||||
try {
|
try {
|
||||||
if (entity.getSort()==null){
|
|
||||||
entity.setSort(1);
|
|
||||||
}
|
|
||||||
if (entity.getDelFlag()==null){
|
|
||||||
entity.setDelFlag(0);
|
|
||||||
}
|
|
||||||
bookMedicalRecordsService.saveOrUpdate(entity);
|
bookMedicalRecordsService.saveOrUpdate(entity);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
@@ -82,11 +76,7 @@ public class BookMedicalRecordsController {
|
|||||||
@RequestMapping("/del")
|
@RequestMapping("/del")
|
||||||
public R del(Integer medicalRecordsId){
|
public R del(Integer medicalRecordsId){
|
||||||
try {
|
try {
|
||||||
BookMedicalRecordsEntity entity = bookMedicalRecordsService.getOne(
|
bookMedicalRecordsService.removeById(medicalRecordsId);
|
||||||
new QueryWrapper<BookMedicalRecordsEntity>()
|
|
||||||
.eq("medical_records_id", medicalRecordsId));
|
|
||||||
entity.setDelFlag(1);
|
|
||||||
bookMedicalRecordsService.updateById(entity);
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
return R.error("删除失败:"+e.getMessage());
|
return R.error("删除失败:"+e.getMessage());
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package com.peanut.modules.book.entity;
|
package com.peanut.modules.book.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -44,6 +41,7 @@ public class BookMedicalRecordsEntity implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 删除标志
|
* 删除标志
|
||||||
*/
|
*/
|
||||||
|
@TableLogic
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user