Commit 1153dec7 by zhanghj

V1.0.0--修改部分字典数据,字典管理,操作日志相关的create_by,update_by为整数类型

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@19451 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 5f50f7ab
......@@ -112,8 +112,8 @@ public class LogAspect {
// 处理完请求,返回内容
OperateLog optLog = tlocal.get();
String username = UserUtils.getUserName(request);
optLog.setCreateBy(username);
Integer userId = UserUtils.getUserId(request);
optLog.setCreateBy(userId);
optLog.setOperateStatus(res.getCode());
optLog.setRemark(res.getMessage());
logger.debug("uri=" + optLog.getUri() + "; methodName="
......
......@@ -52,7 +52,7 @@ public class OperateLog implements Serializable{
/**
* 创建人
*/
private String createBy;
private Integer createBy;
/**
* 创建时间
*/
......@@ -60,7 +60,7 @@ public class OperateLog implements Serializable{
/**
* 更新人
*/
private String updateBy;
private Integer updateBy;
/**
* 更新时间
*/
......@@ -101,6 +101,11 @@ public class OperateLog implements Serializable{
private List<Integer> ids;
/**
* 用户名,搜索时使用
*/
private String username;
public Integer getId() {
return id;
}
......@@ -137,22 +142,23 @@ public class OperateLog implements Serializable{
public void setAddress(String address) {
this.address = address;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
......@@ -221,5 +227,11 @@ public class OperateLog implements Serializable{
public void setOrgName(String orgName) {
this.orgName = orgName;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
......@@ -80,7 +80,7 @@ public class DictionaryDataController extends BaseController{
if (data != null) {
return new ResultObject(ResultCodeEnum.DATA_KEY_EXISTS.getCode(), ResultCodeEnum.DATA_KEY_EXISTS.getMsg());
}
dictionaryData.setCreateBy(UserUtils.getUserName(request));
dictionaryData.setCreateBy(UserUtils.getUserId(request));
dictionaryData.setCreateTime(new Date());
int num = dictionaryDataService.save(dictionaryData);
if (num > 0) {
......@@ -122,7 +122,7 @@ public class DictionaryDataController extends BaseController{
}
}
dictionaryData.setUpdateBy(UserUtils.getUserName(request));
dictionaryData.setUpdateBy(UserUtils.getUserId(request));
dictionaryData.setUpdateTime(new Date());
int num = dictionaryDataService.update(dictionaryData);
if (num > 0) {
......@@ -154,7 +154,7 @@ public class DictionaryDataController extends BaseController{
for (int id : ids) {
DictionaryData dictionaryData = new DictionaryData();
dictionaryData.setId(id);
dictionaryData.setUpdateBy(UserUtils.getUserName(request));
dictionaryData.setUpdateBy(UserUtils.getUserId(request));
dictionaryData.setUpdateTime(new Date());
dictionaryDatas.add(dictionaryData);
}
......
......@@ -73,7 +73,7 @@ public class DictionaryTypeController extends BaseController{
return new ResultObject(ResultCodeEnum.DICT_TYPE_KEY_EXISTS.getCode(), ResultCodeEnum.DICT_TYPE_KEY_EXISTS.getMsg());
}
dictionaryType.setCreateBy(UserUtils.getUserName(request));
dictionaryType.setCreateBy(UserUtils.getUserId(request));
dictionaryType.setCreateTime(new Date());
int num = dictionaryTypeService.save(dictionaryType);
if (num > 0) {
......@@ -108,7 +108,7 @@ public class DictionaryTypeController extends BaseController{
return new ResultObject(ResultCodeEnum.DICT_TYPE_KEY_EXISTS.getCode(), ResultCodeEnum.DICT_TYPE_KEY_EXISTS.getMsg());
}
dictionaryType.setUpdateBy(UserUtils.getUserName(request));
dictionaryType.setUpdateBy(UserUtils.getUserId(request));
dictionaryType.setUpdateTime(new Date());
int num = dictionaryTypeService.update(dictionaryType);
if (num > 0) {
......@@ -139,7 +139,7 @@ public class DictionaryTypeController extends BaseController{
for (int id : ids) {
DictionaryType dictionaryType = new DictionaryType();
dictionaryType.setId(id);
dictionaryType.setUpdateBy(UserUtils.getUserName(request));
dictionaryType.setUpdateBy(UserUtils.getUserId(request));
dictionaryType.setUpdateTime(new Date());
dictionaryTypes.add(dictionaryType);
}
......
......@@ -83,8 +83,8 @@ public class OperateLogController extends BaseController{
for (int id : ids) {
OperateLog operateLog = new OperateLog();
operateLog.setId(id);
String username = UserUtils.getUserName(request);
operateLog.setUpdateBy(username);
Integer userId = UserUtils.getUserId(request);
operateLog.setUpdateBy(userId);
operateLog.setLogStatus(Constants.LOG_STATUS_DELETE);
operateLog.setUpdateTime(new Date());
OperateLogs.add(operateLog);
......
......@@ -10,17 +10,19 @@ import java.util.Date;
public class BaseModel {
/**
* 创建人
* 创建人
* V1.1.0--改成存用户id
*/
private String createBy;
private Integer createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新人
* V1.1.0--改成存用户id
*/
private String updateBy;
private Integer updateBy;
/**
* 更新时间
*/
......@@ -30,14 +32,22 @@ public class BaseModel {
*/
private String remark;
public String getCreateBy() {
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public Date getCreateTime() {
return createTime;
}
......@@ -46,13 +56,7 @@ public class BaseModel {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
......
......@@ -9,9 +9,9 @@
<result column="data_status" jdbcType="INTEGER" property="dataStatus" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
......@@ -124,13 +124,13 @@
#{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
#{createBy},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
#{updateBy},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
......@@ -146,7 +146,7 @@
data_status = #{dataStatus,jdbcType=TINYINT},
sort = #{sort},
remark = #{remark,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR},
update_by = #{updateBy},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
......
......@@ -7,9 +7,9 @@
<result column="dict_type" jdbcType="VARCHAR" property="dictType" />
<result column="dict_status" jdbcType="TINYINT" property="dictStatus" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
......@@ -104,13 +104,13 @@
#{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
#{createBy},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
#{updateBy},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
......@@ -124,7 +124,7 @@
dict_type = #{dictType,jdbcType=VARCHAR},
dict_status = #{dictStatus,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR},
update_by = #{updateBy},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
......
......@@ -10,12 +10,13 @@
<result column="ip" jdbcType="VARCHAR" property="ip" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="operateTypeName" jdbcType="VARCHAR" property="operateTypeName" />
<result column="orgName" jdbcType="VARCHAR" property="orgName" />
<result column="username" jdbcType="VARCHAR" property="username" />
</resultMap>
<sql id="base_Column">
......@@ -27,12 +28,13 @@
<if test="menuName != null and menuName != ''">
<bind name="menuName" value="'%' + menuName + '%'"/>
</if>
<if test="createBy != null and createBy != ''">
<bind name="createBy" value="'%' + createBy + '%'"/>
<if test="username != null">
<bind name="username" value="'%' + username + '%'"/>
</if>
select
<include refid="base_Column" />
,sdd.data_value as operateTypeName, so.name as orgName
,sdd.data_value as operateTypeName, so.name as orgName,
su.username
from sys_operate_log sol
left join sys_dict_data sdd on sol.operate_type = sdd.data_key
left join sys_user su on sol.create_by = su.id
......@@ -42,8 +44,8 @@
<if test="menuName != null and menuName != ''">
and menu_name like #{menuName}
</if>
<if test="createBy != null and createBy != ''">
and sol.create_by like #{createBy}
<if test="username != null and username != ''">
and su.username like #{username}
</if>
<if test="operateType != null and operateType != ''">
and operate_type = #{operateType}
......@@ -118,13 +120,13 @@
#{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
#{createBy},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
#{updateBy},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
......
......@@ -2,4 +2,17 @@ ALTER TABLE `sys_dict_type`
MODIFY COLUMN `create_by` int(11) DEFAULT NULL COMMENT '创建人'
ALTER TABLE `sys_dict_type`
MODIFY COLUMN `update_by` int(11) DEFAULT NULL COMMENT '更新人'
\ No newline at end of file
MODIFY COLUMN `update_by` int(11) DEFAULT NULL COMMENT '更新人'
ALTER TABLE `sys_dict_data`
MODIFY COLUMN `create_by` int(11) DEFAULT NULL COMMENT '创建人',
MODIFY COLUMN `update_by` int(11) DEFAULT NULL COMMENT '更新人';
ALTER TABLE sys_operate_log modify COLUMN create_by int(11) default null COMMENT '创建人';
ALTER TABLE sys_operate_log MODIFY column update_by int(11) default null COMMENT '更新人';
ALTER TABLE `sys_user`
MODIFY COLUMN `create_by` int(11) DEFAULT NULL COMMENT '创建人',
MODIFY COLUMN `update_by` int(11) DEFAULT NULL COMMENT '更新人';
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!