Commit e21e813d7e3c0b82d4b4d41fad7e941c6801f468

Authored by shiyang
1 parent 7dbacaec00
Exists in master

update

Showing 5 changed files with 83 additions and 2 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DepartController.java View file @ e21e813
... ... @@ -186,6 +186,8 @@
186 186 lymsLogsCrud.setHname(depart.getHname());
187 187 lymsLogsCrud.setHdname(depart.getDname());
188 188 lymsLogsCrud.setCreatdata(new Date());
  189 + lymsLogsCrud.setCreatdata(new Date());
  190 + lymsLogsCrud.setType(1);
189 191 lymsLogsCrudService.save(lymsLogsCrud);
190 192  
191 193 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java View file @ e21e813
... ... @@ -5,6 +5,7 @@
5 5 import com.lyms.talkonlineweb.domain.LymsDict;
6 6 import com.lyms.talkonlineweb.domain.LymsDoctor;
7 7 import com.lyms.talkonlineweb.domain.LymsHdepart;
  8 +import com.lyms.talkonlineweb.domain.LymsLogsCrud;
8 9 import com.lyms.talkonlineweb.result.BaseResponse;
9 10 import com.lyms.talkonlineweb.service.*;
10 11 import com.lyms.talkonlineweb.util.Constant;
11 12  
... ... @@ -36,7 +37,10 @@
36 37 @Autowired
37 38 private LymsDictService lymsDictService;
38 39  
  40 + @Autowired
  41 + private LymsLogsCrudService lymsLogsCrudService;
39 42  
  43 +
40 44 /**
41 45 * 获取医生列表
42 46 * @param doctor
... ... @@ -86,6 +90,8 @@
86 90 public BaseResponse saveDoctor(@Validated LymsDoctor doctor, BindingResult result){
87 91 BaseResponse baseResponse=new BaseResponse();
88 92 baseResponse.setErrormsg("");
  93 + //操作记录标识
  94 + Integer did=0;
89 95 if(doctor.getDid()==null){
90 96 doctor.setCreatedtime(new Date());
91 97 LymsDoctor depart2=new LymsDoctor();
... ... @@ -97,6 +103,7 @@
97 103 return baseResponse;
98 104 }
99 105 }else{
  106 + did=1;
100 107 doctor.setUpdatedTime(new Date());
101 108 }
102 109 if(result.hasErrors()){
... ... @@ -109,6 +116,7 @@
109 116 }
110 117  
111 118 boolean f=lymsDoctorService.saveOrUpdate(doctor);
  119 + lymsLogsCrud(doctor,did);
112 120 baseResponse.setErrorcode(f==true?0:1);
113 121 return baseResponse;
114 122 }
115 123  
... ... @@ -121,7 +129,11 @@
121 129 @GetMapping("delDoctor")
122 130 public BaseResponse delDoctor(int did){
123 131 BaseResponse baseResponse=new BaseResponse();
  132 + //操作记保存参数
  133 + LymsDoctor doctor=lymsDoctorService.getById(did);
124 134 boolean f=lymsDoctorService.removeById(did);
  135 + //保存操作记录
  136 + lymsLogsCrud(doctor,null);
125 137 baseResponse.setErrorcode(f==true?0:1);
126 138 return baseResponse;
127 139 }
... ... @@ -160,6 +172,29 @@
160 172 Map<String,Object> stat=lymsDoctorService.statDoctor();
161 173 baseResponse.setObject(stat);
162 174 return baseResponse;
  175 + }
  176 +
  177 + /**
  178 + * 操作记录
  179 + * @param doctor
  180 + * @param did
  181 + */
  182 + public void lymsLogsCrud(LymsDoctor doctor,Integer did){
  183 + LymsLogsCrud lymsLogsCrud=new LymsLogsCrud();
  184 + if(null!=did){
  185 + lymsLogsCrud.setCrudtype(did==1?"新增科室":"编辑科室");
  186 + }else {
  187 + lymsLogsCrud.setCrudtype("删除科室");
  188 + }
  189 + lymsLogsCrud.setCreatedbyname(doctor.getCreatedbyname());
  190 + lymsLogsCrud.setUpdatedbyname(doctor.getUpdatedbyname());
  191 + lymsLogsCrud.setHname(doctor.getHname());
  192 + lymsLogsCrud.setHdname(doctor.getDname());
  193 + lymsLogsCrud.setCreatdata(new Date());
  194 + lymsLogsCrud.setCreatdata(new Date());
  195 + lymsLogsCrud.setType(2);
  196 + lymsLogsCrudService.save(lymsLogsCrud);
  197 +
163 198 }
164 199 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsDoctor.java View file @ e21e813
... ... @@ -128,6 +128,19 @@
128 128 @TableField(exist = false)
129 129 private String lname;//职位
130 130  
  131 + /**
  132 + * 创建人姓名
  133 + */
  134 + @TableField(value = "createdbyname")
  135 + private String createdbyname;
  136 +
  137 + /**
  138 + * 更新人姓名
  139 + */
  140 + @TableField(value = "updatedbyname")
  141 + private String updatedbyname;
  142 +
  143 +
131 144 @Override
132 145 public boolean equals(Object that) {
133 146 if (this == that) {
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsLogsCrud.java View file @ e21e813
... ... @@ -51,6 +51,24 @@
51 51 @TableField(value = "creatdata")
52 52 private Date creatdata;
53 53  
  54 + /**
  55 + * 1:科室管理,2:医生管理
  56 + */
  57 + @TableField(value = "type")
  58 + private Integer type;
  59 +
  60 + /**
  61 + * 创建人姓名,医生管理用
  62 + */
  63 + @TableField(value = "createdbyname")
  64 + private String createdbyname;
  65 +
  66 + /**
  67 + * 更新人姓名,医生管理用
  68 + */
  69 + @TableField(value = "updatedbyname")
  70 + private String updatedbyname;
  71 +
54 72 @TableField(exist = false)
55 73 private static final long serialVersionUID = 1L;
56 74  
... ... @@ -71,7 +89,10 @@
71 89 && (this.getCrudtype() == null ? other.getCrudtype() == null : this.getCrudtype().equals(other.getCrudtype()))
72 90 && (this.getHname() == null ? other.getHname() == null : this.getHname().equals(other.getHname()))
73 91 && (this.getHdname() == null ? other.getHdname() == null : this.getHdname().equals(other.getHdname()))
74   - && (this.getCreatdata() == null ? other.getCreatdata() == null : this.getCreatdata().equals(other.getCreatdata()));
  92 + && (this.getCreatdata() == null ? other.getCreatdata() == null : this.getCreatdata().equals(other.getCreatdata()))
  93 + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
  94 + && (this.getCreatedbyname() == null ? other.getCreatedbyname() == null : this.getCreatedbyname().equals(other.getCreatedbyname()))
  95 + && (this.getUpdatedbyname() == null ? other.getUpdatedbyname() == null : this.getUpdatedbyname().equals(other.getUpdatedbyname()));
75 96 }
76 97  
77 98 @Override
... ... @@ -84,6 +105,9 @@
84 105 result = prime * result + ((getHname() == null) ? 0 : getHname().hashCode());
85 106 result = prime * result + ((getHdname() == null) ? 0 : getHdname().hashCode());
86 107 result = prime * result + ((getCreatdata() == null) ? 0 : getCreatdata().hashCode());
  108 + result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
  109 + result = prime * result + ((getCreatedbyname() == null) ? 0 : getCreatedbyname().hashCode());
  110 + result = prime * result + ((getUpdatedbyname() == null) ? 0 : getUpdatedbyname().hashCode());
87 111 return result;
88 112 }
89 113  
... ... @@ -99,6 +123,9 @@
99 123 sb.append(", hname=").append(hname);
100 124 sb.append(", hdname=").append(hdname);
101 125 sb.append(", creatdata=").append(creatdata);
  126 + sb.append(", type=").append(type);
  127 + sb.append(", createdbyname=").append(createdbyname);
  128 + sb.append(", updatedbyname=").append(updatedbyname);
102 129 sb.append(", serialVersionUID=").append(serialVersionUID);
103 130 sb.append("]");
104 131 return sb.toString();
talkonlineweb/src/main/resources/mapper/LymsLogsCrudMapper.xml View file @ e21e813
... ... @@ -11,11 +11,15 @@
11 11 <result property="hname" column="hname" jdbcType="VARCHAR"/>
12 12 <result property="hdname" column="hdname" jdbcType="VARCHAR"/>
13 13 <result property="creatdata" column="creatdata" jdbcType="TIMESTAMP"/>
  14 + <result property="type" column="type" jdbcType="INTEGER"/>
  15 + <result property="createdbyname" column="createdbyname" jdbcType="VARCHAR"/>
  16 + <result property="updatedbyname" column="updatedbyname" jdbcType="VARCHAR"/>
14 17 </resultMap>
15 18  
16 19 <sql id="Base_Column_List">
17 20 id,uname,crudtype,
18   - hname,hdname,creatdata
  21 + hname,hdname,creatdata,
  22 + type,createdbyname,updatedbyname
19 23 </sql>
20 24 </mapper>