diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DepartController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DepartController.java index 30ca3f6..bb62c8b 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DepartController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DepartController.java @@ -186,6 +186,8 @@ public class DepartController { lymsLogsCrud.setHname(depart.getHname()); lymsLogsCrud.setHdname(depart.getDname()); lymsLogsCrud.setCreatdata(new Date()); + lymsLogsCrud.setCreatdata(new Date()); + lymsLogsCrud.setType(1); lymsLogsCrudService.save(lymsLogsCrud); } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java index 127ff84..c27b369 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.lyms.talkonlineweb.domain.LymsDict; import com.lyms.talkonlineweb.domain.LymsDoctor; import com.lyms.talkonlineweb.domain.LymsHdepart; +import com.lyms.talkonlineweb.domain.LymsLogsCrud; import com.lyms.talkonlineweb.result.BaseResponse; import com.lyms.talkonlineweb.service.*; import com.lyms.talkonlineweb.util.Constant; @@ -36,6 +37,9 @@ public class DoctorController { @Autowired private LymsDictService lymsDictService; + @Autowired + private LymsLogsCrudService lymsLogsCrudService; + /** * 获取医生列表 @@ -86,6 +90,8 @@ public class DoctorController { public BaseResponse saveDoctor(@Validated LymsDoctor doctor, BindingResult result){ BaseResponse baseResponse=new BaseResponse(); baseResponse.setErrormsg(""); + //操作记录标识 + Integer did=0; if(doctor.getDid()==null){ doctor.setCreatedtime(new Date()); LymsDoctor depart2=new LymsDoctor(); @@ -97,6 +103,7 @@ public class DoctorController { return baseResponse; } }else{ + did=1; doctor.setUpdatedTime(new Date()); } if(result.hasErrors()){ @@ -109,6 +116,7 @@ public class DoctorController { } boolean f=lymsDoctorService.saveOrUpdate(doctor); + lymsLogsCrud(doctor,did); baseResponse.setErrorcode(f==true?0:1); return baseResponse; } @@ -121,7 +129,11 @@ public class DoctorController { @GetMapping("delDoctor") public BaseResponse delDoctor(int did){ BaseResponse baseResponse=new BaseResponse(); + //操作记保存参数 + LymsDoctor doctor=lymsDoctorService.getById(did); boolean f=lymsDoctorService.removeById(did); + //保存操作记录 + lymsLogsCrud(doctor,null); baseResponse.setErrorcode(f==true?0:1); return baseResponse; } @@ -161,4 +173,27 @@ public class DoctorController { baseResponse.setObject(stat); return baseResponse; } + + /** + * 操作记录 + * @param doctor + * @param did + */ + public void lymsLogsCrud(LymsDoctor doctor,Integer did){ + LymsLogsCrud lymsLogsCrud=new LymsLogsCrud(); + if(null!=did){ + lymsLogsCrud.setCrudtype(did==1?"新增科室":"编辑科室"); + }else { + lymsLogsCrud.setCrudtype("删除科室"); + } + lymsLogsCrud.setCreatedbyname(doctor.getCreatedbyname()); + lymsLogsCrud.setUpdatedbyname(doctor.getUpdatedbyname()); + lymsLogsCrud.setHname(doctor.getHname()); + lymsLogsCrud.setHdname(doctor.getDname()); + lymsLogsCrud.setCreatdata(new Date()); + lymsLogsCrud.setCreatdata(new Date()); + lymsLogsCrud.setType(2); + lymsLogsCrudService.save(lymsLogsCrud); + + } } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsDoctor.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsDoctor.java index e2d78fc..1db61b3 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsDoctor.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsDoctor.java @@ -128,6 +128,19 @@ public class LymsDoctor implements Serializable { @TableField(exist = false) private String lname;//职位 + /** + * 创建人姓名 + */ + @TableField(value = "createdbyname") + private String createdbyname; + + /** + * 更新人姓名 + */ + @TableField(value = "updatedbyname") + private String updatedbyname; + + @Override public boolean equals(Object that) { if (this == that) { diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsLogsCrud.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsLogsCrud.java index 9a293cc..da982a2 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsLogsCrud.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsLogsCrud.java @@ -51,6 +51,24 @@ public class LymsLogsCrud implements Serializable { @TableField(value = "creatdata") private Date creatdata; + /** + * 1:科室管理,2:医生管理 + */ + @TableField(value = "type") + private Integer type; + + /** + * 创建人姓名,医生管理用 + */ + @TableField(value = "createdbyname") + private String createdbyname; + + /** + * 更新人姓名,医生管理用 + */ + @TableField(value = "updatedbyname") + private String updatedbyname; + @TableField(exist = false) private static final long serialVersionUID = 1L; @@ -71,7 +89,10 @@ public class LymsLogsCrud implements Serializable { && (this.getCrudtype() == null ? other.getCrudtype() == null : this.getCrudtype().equals(other.getCrudtype())) && (this.getHname() == null ? other.getHname() == null : this.getHname().equals(other.getHname())) && (this.getHdname() == null ? other.getHdname() == null : this.getHdname().equals(other.getHdname())) - && (this.getCreatdata() == null ? other.getCreatdata() == null : this.getCreatdata().equals(other.getCreatdata())); + && (this.getCreatdata() == null ? other.getCreatdata() == null : this.getCreatdata().equals(other.getCreatdata())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getCreatedbyname() == null ? other.getCreatedbyname() == null : this.getCreatedbyname().equals(other.getCreatedbyname())) + && (this.getUpdatedbyname() == null ? other.getUpdatedbyname() == null : this.getUpdatedbyname().equals(other.getUpdatedbyname())); } @Override @@ -84,6 +105,9 @@ public class LymsLogsCrud implements Serializable { result = prime * result + ((getHname() == null) ? 0 : getHname().hashCode()); result = prime * result + ((getHdname() == null) ? 0 : getHdname().hashCode()); result = prime * result + ((getCreatdata() == null) ? 0 : getCreatdata().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getCreatedbyname() == null) ? 0 : getCreatedbyname().hashCode()); + result = prime * result + ((getUpdatedbyname() == null) ? 0 : getUpdatedbyname().hashCode()); return result; } @@ -99,6 +123,9 @@ public class LymsLogsCrud implements Serializable { sb.append(", hname=").append(hname); sb.append(", hdname=").append(hdname); sb.append(", creatdata=").append(creatdata); + sb.append(", type=").append(type); + sb.append(", createdbyname=").append(createdbyname); + sb.append(", updatedbyname=").append(updatedbyname); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); diff --git a/talkonlineweb/src/main/resources/mapper/LymsLogsCrudMapper.xml b/talkonlineweb/src/main/resources/mapper/LymsLogsCrudMapper.xml index e77b99b..ca66ae6 100644 --- a/talkonlineweb/src/main/resources/mapper/LymsLogsCrudMapper.xml +++ b/talkonlineweb/src/main/resources/mapper/LymsLogsCrudMapper.xml @@ -11,10 +11,14 @@ + + + id,uname,crudtype, - hname,hdname,creatdata + hname,hdname,creatdata, + type,createdbyname,updatedbyname