This commit is contained in:
xd 2024-03-19 15:59:39 +08:00
parent 61039d98da
commit 2cff2ab897
5 changed files with 38 additions and 10 deletions

View File

@ -113,6 +113,8 @@ public class storageLocationController extends BaseController
public AjaxResult add(@RequestBody StorageLocation storageLocation)
{
String user_name = getLoginUser().getUsername();//当前登陆者
String nick_name = getLoginUser().getUser().getNickName();//当前登陆者姓名
String materialBh = storageLocation.getMaterialBh();
String kw_user_name = redisCache.getCacheObject(getLocationZyCacheKey(materialBh));
@ -128,6 +130,7 @@ public class storageLocationController extends BaseController
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Operlog operlog = new Operlog();
operlog.setOperlog_user_name(user_name);
operlog.setOperlog_nick_name(nick_name);
operlog.setOperlog_date(format.format(new Date()));
operlog.setOperlog_event("录入库位信息");
operlog.setOperlog_kw(storageLocation.getMaterialBh());
@ -152,6 +155,7 @@ public class storageLocationController extends BaseController
public AjaxResult addUpdStorageLocation(@RequestBody StorageLocation storageLocation)
{
String user_name = getLoginUser().getUsername();//当前登陆者
String nick_name = getLoginUser().getUser().getNickName();//当前登陆者姓名
String materialBh = storageLocation.getMaterialBh();
String kw_user_name = redisCache.getCacheObject(getLocationZyCacheKey(materialBh));
@ -167,6 +171,7 @@ public class storageLocationController extends BaseController
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Operlog operlog = new Operlog();
operlog.setOperlog_user_name(user_name);
operlog.setOperlog_nick_name(nick_name);
operlog.setOperlog_date(format.format(new Date()));
operlog.setOperlog_event("修改库位信息");
operlog.setOperlog_kw(storageLocation.getMaterialBh());
@ -336,6 +341,7 @@ public class storageLocationController extends BaseController
public AjaxResult clearLocationLyCacheKey(@RequestBody StorageLocation storageLocation)
{
String user_name = getLoginUser().getUsername();//当前登陆者
String nick_name = getLoginUser().getUser().getNickName();//当前登陆者姓名
String materialBh = storageLocation.getMaterialBh();
String kw_user_name = redisCache.getCacheObject(getLocationLyCacheKey(materialBh));
@ -356,6 +362,7 @@ public class storageLocationController extends BaseController
for(StorageLocation sl:selectedList){
operlog = new Operlog();
operlog.setOperlog_user_name(user_name);
operlog.setOperlog_nick_name(nick_name);
operlog.setOperlog_date(date);
operlog.setOperlog_event("删除已选库位信息");
operlog.setOperlog_kw(sl.getMaterialBh());
@ -379,6 +386,7 @@ public class storageLocationController extends BaseController
public AjaxResult confirmStorageLocation(@RequestBody String [] materialBhArr)
{
String user_name = getLoginUser().getUsername();//当前登陆者
String nick_name = getLoginUser().getUser().getNickName();//当前登陆者姓名
List<String> materialBhList = Arrays.asList(materialBhArr);
//批量插入操作记录表
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -390,6 +398,7 @@ public class storageLocationController extends BaseController
for(StorageLocation sl:selectedList){
operlog = new Operlog();
operlog.setOperlog_user_name(user_name);
operlog.setOperlog_nick_name(nick_name);
operlog.setOperlog_date(date);
operlog.setOperlog_event("确认完成领用");
operlog.setOperlog_kw(sl.getMaterialBh());

View File

@ -7,6 +7,7 @@ public class Operlog extends BaseEntity {
private String operlog_kw;
private String operlog_date;
private String operlog_user_name;
private String operlog_nick_name;
private String operlog_event;
private String operlog_zlh;
private String operlog_xingh;
@ -46,6 +47,10 @@ public class Operlog extends BaseEntity {
this.operlog_user_name = operlog_user_name;
}
public String getOperlog_nick_name() {return operlog_nick_name;}
public void setOperlog_nick_name(String operlog_nick_name) {this.operlog_nick_name = operlog_nick_name;}
public String getOperlog_event() {
return operlog_event;
}

View File

@ -108,8 +108,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<insert id="addOperlog" parameterType="Operlog">
insert into operlog (operlog_kw,operlog_date,operlog_user_name,operlog_event,operlog_zlh,operlog_xingh,operlog_guig,operlog_diany,operlog_ms)
values (#{operlog_kw},#{operlog_date},#{operlog_user_name},#{operlog_event},#{operlog_zlh},#{operlog_xingh},#{operlog_guig},#{operlog_diany},#{operlog_ms})
insert into operlog (operlog_kw,operlog_date,operlog_user_name,operlog_nick_name,operlog_event,operlog_zlh,operlog_xingh,operlog_guig,operlog_diany,operlog_ms)
values (#{operlog_kw},#{operlog_date},#{operlog_user_name},#{operlog_nick_name},#{operlog_event},#{operlog_zlh},#{operlog_xingh},#{operlog_guig},#{operlog_diany},#{operlog_ms})
</insert>
<select id="selectStorageLocation" resultType="StorageLocation">
@ -124,12 +124,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="addBatchOperlog">
insert into operlog (operlog_kw,operlog_date,operlog_user_name,operlog_event,operlog_zlh,operlog_xingh,operlog_guig,operlog_diany,operlog_ms)
insert into operlog (operlog_kw,operlog_date,operlog_user_name,operlog_nick_name,operlog_event,operlog_zlh,operlog_xingh,operlog_guig,operlog_diany,operlog_ms)
values
<foreach collection="list" index="" item="item" separator=",">
(#{item.operlog_kw,jdbcType=VARCHAR},
#{item.operlog_date,jdbcType=VARCHAR},
#{item.operlog_user_name,jdbcType=VARCHAR},
#{item.operlog_nick_name,jdbcType=VARCHAR},
#{item.operlog_event,jdbcType=VARCHAR},
#{item.operlog_zlh,jdbcType=VARCHAR},
#{item.operlog_xingh,jdbcType=VARCHAR},
@ -140,7 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<select id="selectOperlogs" parameterType="Operlog" resultType="Operlog">
select operlog_date,operlog_user_name,operlog_event,operlog_zlh,operlog_xingh
select operlog_date,operlog_user_name,operlog_nick_name,operlog_event,operlog_zlh,operlog_xingh
,operlog_guig,operlog_diany,operlog_ms
from operlog
<where>
@ -148,7 +149,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND operlog_kw = #{operlog_kw}
</if>
<if test="operlog_user_name != null and operlog_user_name != ''">
AND operlog_user_name like concat('%', #{operlog_user_name}, '%')
AND operlog_user_name = #{operlog_user_name}
</if>
<if test="operlog_nick_name != null and operlog_nick_name != ''">
AND operlog_nick_name like concat('%', #{operlog_nick_name}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and datediff(d, operlog_date, #{params.beginTime}) <![CDATA[<=]]> 0

View File

@ -221,7 +221,7 @@
</div>
</el-dialog>
<!-- 操作详情对话框 -->
<el-dialog :title="operlogTitle" :visible.sync="operlogOpen" width="1000px" append-to-body>
<el-dialog :title="operlogTitle" :visible.sync="operlogOpen" width="1200px" append-to-body>
<operlog :materialBhProp="materialBhProp"></operlog>
</el-dialog>
</div>

View File

@ -18,8 +18,11 @@
:default-time="['00:00:00', '23:59:59']"
></el-date-picker>
</el-form-item>
<el-form-item label="操作账号">
<el-input v-model="queryParams.operlog_user_name" placeholder="操作账号"></el-input>
</el-form-item>
<el-form-item label="操作人">
<el-input v-model="queryParams.operlog_user_name" placeholder="操作人"></el-input>
<el-input v-model="queryParams.operlog_nick_name" placeholder="操作人"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="search()">查询</el-button>
@ -28,16 +31,22 @@
<el-table
:data="operlogData"
v-loading="loading"
height="500"
height="400"
style="width: 100%">
<el-table-column
prop="operlog_date"
label="操作时间"
width="200"
width="180"
fixed>
</el-table-column>
<el-table-column
prop="operlog_user_name"
label="操作账号"
width="100"
fixed>
</el-table-column>
<el-table-column
prop="operlog_nick_name"
label="操作人"
width="100"
fixed>
@ -99,7 +108,8 @@ import { listOperlog } from "@/api/storageLocation/operlog";
pageSize: 10,
operlog_kw: null,
operlog_date: null,
operlog_user_name: null
operlog_user_name: null,
operlog_nick_name: null
},
//
loading: true,