9.16员工出入场记录功能开发
parent
82a5ebd371
commit
1996c60781
|
@ -70,6 +70,17 @@ public class ProUserInoutRecord extends BaseEntity
|
|||
@Excel(name = "工种类型")
|
||||
private String craftType;
|
||||
|
||||
@Excel(name = "用户岗位")
|
||||
private String userPost;
|
||||
|
||||
public String getUserPost() {
|
||||
return userPost;
|
||||
}
|
||||
|
||||
public void setUserPost(String userPost) {
|
||||
this.userPost = userPost;
|
||||
}
|
||||
|
||||
/** 工种岗位 */
|
||||
@Excel(name = "工种岗位")
|
||||
private String craftPost;
|
||||
|
|
|
@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="useStatus" column="use_status" />
|
||||
<result property="subDeptId" column="sub_dept_id" />
|
||||
<result property="subDeptName" column="sub_dept_name" />
|
||||
<result property="userPost" column="user_post" />
|
||||
<result property="subDeptType" column="sub_dept_type" />
|
||||
<result property="subDeptGroup" column="sub_dept_group" />
|
||||
<result property="subDeptGroupName" column="sub_dept_group_name" />
|
||||
|
@ -30,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectProUserInoutRecordVo">
|
||||
select id, project_id, user_id, user_name, user_phone, user_picture, user_sex, use_status, sub_dept_id, sub_dept_name, sub_dept_type, sub_dept_group, sub_dept_group_name, craft_type, craft_post, is_del, remark, state, create_by, create_time, update_by, update_time from pro_user_inout_record
|
||||
select id, project_id, user_id, user_name, user_phone,user_post, user_picture, user_sex, use_status, sub_dept_id, sub_dept_name, sub_dept_type, sub_dept_group, sub_dept_group_name, craft_type, craft_post, is_del, remark, state, create_by, create_time, update_by, update_time from pro_user_inout_record
|
||||
</sql>
|
||||
|
||||
<select id="selectProUserInoutRecordList" parameterType="ProUserInoutRecord" resultMap="ProUserInoutRecordResult">
|
||||
|
@ -69,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="userPhone != null">user_phone,</if>
|
||||
<if test="userPicture != null">user_picture,</if>
|
||||
<if test="userSex != null">user_sex,</if>
|
||||
<if test="userPost != null">user_post,</if>
|
||||
<if test="useStatus != null">use_status,</if>
|
||||
<if test="subDeptId != null">sub_dept_id,</if>
|
||||
<if test="subDeptName != null">sub_dept_name,</if>
|
||||
|
@ -92,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="userPhone != null">#{userPhone},</if>
|
||||
<if test="userPicture != null">#{userPicture},</if>
|
||||
<if test="userSex != null">#{userSex},</if>
|
||||
<if test="userPost != null">#{userPost},</if>
|
||||
<if test="useStatus != null">#{useStatus},</if>
|
||||
<if test="subDeptId != null">#{subDeptId},</if>
|
||||
<if test="subDeptName != null">#{subDeptName},</if>
|
||||
|
@ -119,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="userPhone != null">user_phone = #{userPhone},</if>
|
||||
<if test="userPicture != null">user_picture = #{userPicture},</if>
|
||||
<if test="userSex != null">user_sex = #{userSex},</if>
|
||||
<if test="userPost != null">user_post = #{userPost},</if>
|
||||
<if test="useStatus != null">use_status = #{useStatus},</if>
|
||||
<if test="subDeptId != null">sub_dept_id = #{subDeptId},</if>
|
||||
<if test="subDeptName != null">sub_dept_name = #{subDeptName},</if>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.yanzhu.manage.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
|
||||
import com.yanzhu.manage.domain.ProUserInoutRecord;
|
||||
|
||||
/**
|
||||
|
@ -58,4 +60,11 @@ public interface IProUserInoutRecordService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteProUserInoutRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 新增员工出入场记录
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public int addRecord(ProProjectInfoSubdeptsUsers user);
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ import com.yanzhu.manage.domain.*;
|
|||
import com.yanzhu.manage.enums.*;
|
||||
import com.yanzhu.manage.mapper.*;
|
||||
import com.yanzhu.manage.service.IProProjectInfoSubdeptsUsersService;
|
||||
import com.yanzhu.manage.service.IProUserInoutRecordService;
|
||||
import com.yanzhu.manage.service.IUniService;
|
||||
import com.yanzhu.manage.utils.pdf.FileUtil;
|
||||
import com.yanzhu.manage.utils.pdf.PdfImageSignetUtil;
|
||||
|
@ -86,6 +87,9 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
@Autowired
|
||||
private ProProjectInfoMapper proProjectInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private IProUserInoutRecordService iProUserInoutRecordService;
|
||||
|
||||
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ProProjectInfoSubdeptsUsersServiceImpl.class);
|
||||
|
@ -745,6 +749,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
uniService.syncUserRevoke(id);
|
||||
}
|
||||
user.setUseStatus(status);
|
||||
iProUserInoutRecordService.addRecord(user);
|
||||
return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(user);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package com.yanzhu.manage.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.yanzhu.common.core.context.SecurityContextHolder;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.manage.mapper.ProUserInoutRecordMapper;
|
||||
|
@ -16,7 +18,7 @@ import com.yanzhu.manage.service.IProUserInoutRecordService;
|
|||
* @date 2025-09-16
|
||||
*/
|
||||
@Service
|
||||
public class ProUserInoutRecordServiceImpl implements IProUserInoutRecordService
|
||||
public class ProUserInoutRecordServiceImpl implements IProUserInoutRecordService
|
||||
{
|
||||
@Autowired
|
||||
private ProUserInoutRecordMapper proUserInoutRecordMapper;
|
||||
|
@ -96,4 +98,27 @@ public class ProUserInoutRecordServiceImpl implements IProUserInoutRecordService
|
|||
{
|
||||
return proUserInoutRecordMapper.deleteProUserInoutRecordById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addRecord(ProProjectInfoSubdeptsUsers user) {
|
||||
ProUserInoutRecord record = new ProUserInoutRecord();
|
||||
record.setUserId(user.getId());
|
||||
record.setUseStatus(user.getUseStatus());
|
||||
record.setUserName(user.getUserName());
|
||||
record.setUserPhone(user.getUserPhone());
|
||||
record.setUserPicture(user.getUserPicture());
|
||||
record.setProjectId(user.getProjectId());
|
||||
record.setUserSex(user.getUserSex());
|
||||
record.setSubDeptId(user.getSubDeptId());
|
||||
record.setSubDeptName(user.getSubDeptName());
|
||||
record.setCraftPost(user.getCraftPost());
|
||||
record.setSubDeptName(user.getSubDeptName());
|
||||
record.setSubDeptType(user.getSubDeptType());
|
||||
record.setSubDeptGroup(user.getSubDeptGroup());
|
||||
record.setUserPost(user.getUserPost());
|
||||
record.setSubDeptGroupName(user.getSubDeptGroupName());
|
||||
record.setCraftType(user.getCraftType());
|
||||
record.setIsDel(0L);
|
||||
return insertProUserInoutRecord(record);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,93 +1,18 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="${comment}" prop="projectId">
|
||||
<el-input
|
||||
v-model="queryParams.projectId"
|
||||
placeholder="请输入${comment}"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户ID" prop="userId">
|
||||
<el-input
|
||||
v-model="queryParams.userId"
|
||||
placeholder="请输入用户ID"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="用户名" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入用户名"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户手机" prop="userPhone">
|
||||
<el-input
|
||||
v-model="queryParams.userPhone"
|
||||
placeholder="请输入用户手机"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.userPhone" placeholder="请输入用户手机" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分包单位ID" prop="subDeptId">
|
||||
<el-input
|
||||
v-model="queryParams.subDeptId"
|
||||
placeholder="请输入分包单位ID"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分包单位" prop="subDeptName">
|
||||
<el-input
|
||||
v-model="queryParams.subDeptName"
|
||||
placeholder="请输入分包单位"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组编号" prop="subDeptGroup">
|
||||
<el-input
|
||||
v-model="queryParams.subDeptGroup"
|
||||
placeholder="请输入班组编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组名称" prop="subDeptGroupName">
|
||||
<el-input
|
||||
v-model="queryParams.subDeptGroupName"
|
||||
placeholder="请输入班组名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种岗位" prop="craftPost">
|
||||
<el-input
|
||||
v-model="queryParams.craftPost"
|
||||
placeholder="请输入工种岗位"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input
|
||||
v-model="queryParams.isDel"
|
||||
placeholder="请输入${comment}"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="state">
|
||||
<el-input
|
||||
v-model="queryParams.state"
|
||||
placeholder="请输入${comment}"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<el-form-item label="类型" prop="useStatus">
|
||||
<el-select v-model="queryParams.useStatus" placeholder="请选择类型" clearable>
|
||||
<el-option label="进场" :value="0" />
|
||||
<el-option label="离场" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
|
@ -95,47 +20,25 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['manage:userInOutRecord:add']"
|
||||
>新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['manage:userInOutRecord:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['manage:userInOutRecord:edit']"
|
||||
>修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['manage:userInOutRecord:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['manage:userInOutRecord:remove']"
|
||||
>删除</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['manage:userInOutRecord:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['manage:userInOutRecord:export']"
|
||||
>导出</el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['manage:userInOutRecord:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
|
||||
<el-table v-loading="loading" :data="userInOutRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
|
@ -159,19 +62,16 @@
|
|||
<el-table-column label="${comment}" align="center" prop="state" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:userInOutRecord:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:userInOutRecord:remove']">删除</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['manage:userInOutRecord:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['manage:userInOutRecord:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改员工出入场记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
|
@ -227,7 +127,13 @@
|
|||
</template>
|
||||
|
||||
<script setup name="UserInOutRecord">
|
||||
import { listUserInOutRecord, getUserInOutRecord, delUserInOutRecord, addUserInOutRecord, updateUserInOutRecord } from "@/api/manage/userInOutRecord";
|
||||
import {
|
||||
listUserInOutRecord,
|
||||
getUserInOutRecord,
|
||||
delUserInOutRecord,
|
||||
addUserInOutRecord,
|
||||
updateUserInOutRecord,
|
||||
} from "@/api/manage/userInOutRecord";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
|
@ -263,8 +169,7 @@ const data = reactive({
|
|||
isDel: null,
|
||||
state: null,
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
rules: {},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
@ -272,7 +177,7 @@ const { queryParams, form, rules } = toRefs(data);
|
|||
/** 查询员工出入场记录列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listUserInOutRecord(queryParams.value).then(response => {
|
||||
listUserInOutRecord(queryParams.value).then((response) => {
|
||||
userInOutRecordList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
|
@ -309,7 +214,7 @@ function reset() {
|
|||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
updateTime: null,
|
||||
};
|
||||
proxy.resetForm("userInOutRecordRef");
|
||||
}
|
||||
|
@ -328,7 +233,7 @@ function resetQuery() {
|
|||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
@ -343,8 +248,8 @@ function handleAdd() {
|
|||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getUserInOutRecord(_id).then(response => {
|
||||
const _id = row.id || ids.value;
|
||||
getUserInOutRecord(_id).then((response) => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改员工出入场记录";
|
||||
|
@ -353,16 +258,16 @@ function handleUpdate(row) {
|
|||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["userInOutRecordRef"].validate(valid => {
|
||||
proxy.$refs["userInOutRecordRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateUserInOutRecord(form.value).then(response => {
|
||||
updateUserInOutRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addUserInOutRecord(form.value).then(response => {
|
||||
addUserInOutRecord(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
|
@ -375,19 +280,27 @@ function submitForm() {
|
|||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除员工出入场记录编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delUserInOutRecord(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除员工出入场记录编号为"' + _ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delUserInOutRecord(_ids);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('manage/userInOutRecord/export', {
|
||||
...queryParams.value
|
||||
}, `userInOutRecord_${new Date().getTime()}.xlsx`)
|
||||
proxy.download(
|
||||
"manage/userInOutRecord/export",
|
||||
{
|
||||
...queryParams.value,
|
||||
},
|
||||
`userInOutRecord_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
|
||||
getList();
|
||||
|
|
Loading…
Reference in New Issue