Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
64
klp-ui/src/api/wms/employeeChange.js
Normal file
64
klp-ui/src/api/wms/employeeChange.js
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询员工异动(入职/离职)列表
|
||||||
|
export function listEmployeeChange(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/employeeChange/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询员工异动(入职/离职)详细
|
||||||
|
export function getEmployeeChange(changeId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/employeeChange/' + changeId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增员工异动(入职/离职)
|
||||||
|
export function addEmployeeChange(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/employeeChange',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改员工异动(入职/离职)
|
||||||
|
export function updateEmployeeChange(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/employeeChange',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除员工异动(入职/离职)
|
||||||
|
export function delEmployeeChange(changeId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/employeeChange/' + changeId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 员工入职
|
||||||
|
export function employeeEntry(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/employeeChange/entry',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工离职
|
||||||
|
*/
|
||||||
|
export function employeeLeave(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/employeeChange/leave',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -85,6 +85,10 @@ export function updatePendingAction(data) {
|
|||||||
if (payload.completeTime) {
|
if (payload.completeTime) {
|
||||||
payload.completeTime = parseDate(payload.completeTime)
|
payload.completeTime = parseDate(payload.completeTime)
|
||||||
}
|
}
|
||||||
|
if (payload.scanTime) {
|
||||||
|
// 扫码日期格式化为yyyy-MM-dd'T'HH:mm:ss.SSSX
|
||||||
|
payload.scanTime = parseDate(payload.scanTime).replace(' ', 'T') + '.000Z'
|
||||||
|
}
|
||||||
return request({
|
return request({
|
||||||
url: '/wms/coilPendingAction',
|
url: '/wms/coilPendingAction',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
|
|||||||
@@ -33,6 +33,10 @@
|
|||||||
<el-input v-model="materialQueryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable
|
<el-input v-model="materialQueryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable
|
||||||
@keyup.enter.native="handleMaterialQuery" style="width: 150px;" />
|
@keyup.enter.native="handleMaterialQuery" style="width: 150px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="逻辑库区" prop="warehouseId">
|
||||||
|
<warehouse-select v-model="materialQueryParams.warehouseId" placeholder="请选择逻辑库区" clearable
|
||||||
|
@keyup.enter.native="handleMaterialQuery" style="width: 150px;" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleMaterialQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleMaterialQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetMaterialQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetMaterialQuery">重置</el-button>
|
||||||
@@ -185,6 +189,8 @@
|
|||||||
</el-popover>
|
</el-popover>
|
||||||
|
|
||||||
<i class="el-icon-view param-icon" @click="handlePreviewLabel(item)" title="查看标签"></i>
|
<i class="el-icon-view param-icon" @click="handlePreviewLabel(item)" title="查看标签"></i>
|
||||||
|
|
||||||
|
<i class="el-icon-time param-icon" @click="handleTrace(item)" title="追溯"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -387,11 +393,16 @@
|
|||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 钢卷追溯对话框(使用封装的组件) -->
|
||||||
|
<el-dialog title="钢卷追溯" :visible.sync="traceOpen" width="90%" append-to-body>
|
||||||
|
<coil-trace-result v-loading="traceLoading" :trace-result="traceResult"></coil-trace-result>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listMaterialCoil, updateMaterialCoilSimple, checkCoilNo, delMaterialCoil, restoreMaterialCoil, addMaterialCoil } from '@/api/wms/coil'
|
import { listMaterialCoil, getMaterialCoilTrace, updateMaterialCoilSimple, checkCoilNo, delMaterialCoil, restoreMaterialCoil, addMaterialCoil } from '@/api/wms/coil'
|
||||||
import { listUser } from '@/api/system/user'
|
import { listUser } from '@/api/system/user'
|
||||||
import { listPendingAction, startProcess, cancelAction, delPendingAction } from '@/api/wms/pendingAction'
|
import { listPendingAction, startProcess, cancelAction, delPendingAction } from '@/api/wms/pendingAction'
|
||||||
import { parseTime } from '@/utils/klp'
|
import { parseTime } from '@/utils/klp'
|
||||||
@@ -403,6 +414,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
|||||||
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
||||||
import ProductSelect from "@/components/KLPService/ProductSelect";
|
import ProductSelect from "@/components/KLPService/ProductSelect";
|
||||||
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
||||||
|
import CoilTraceResult from "../panels/CoilTraceResult.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DoPage',
|
name: 'DoPage',
|
||||||
@@ -425,9 +437,14 @@ export default {
|
|||||||
ActualWarehouseSelect,
|
ActualWarehouseSelect,
|
||||||
ProductSelect,
|
ProductSelect,
|
||||||
RawMaterialSelect,
|
RawMaterialSelect,
|
||||||
|
CoilTraceResult,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
traceOpen: false,
|
||||||
|
traceLoading: false,
|
||||||
|
traceResult: null,
|
||||||
|
|
||||||
coilType: 'all',
|
coilType: 'all',
|
||||||
title: '钢卷信息修正',
|
title: '钢卷信息修正',
|
||||||
// 物料列表相关
|
// 物料列表相关
|
||||||
@@ -441,7 +458,8 @@ export default {
|
|||||||
// dataType: 1,
|
// dataType: 1,
|
||||||
// status: 0,
|
// status: 0,
|
||||||
enterCoilNo: null,
|
enterCoilNo: null,
|
||||||
currentCoilNo: null
|
currentCoilNo: null,
|
||||||
|
warehouseId: null,
|
||||||
},
|
},
|
||||||
labelRender: {
|
labelRender: {
|
||||||
visible: false,
|
visible: false,
|
||||||
@@ -629,6 +647,23 @@ export default {
|
|||||||
this.reset();
|
this.reset();
|
||||||
this.correctVisible = true;
|
this.correctVisible = true;
|
||||||
this.title = "添加钢卷物料";
|
this.title = "添加钢卷物料";
|
||||||
|
},
|
||||||
|
/** 追溯按钮操作 */
|
||||||
|
handleTrace(row) {
|
||||||
|
this.traceOpen = true;
|
||||||
|
this.traceLoading = true;
|
||||||
|
this.traceResult = null; // 清空历史数据
|
||||||
|
getMaterialCoilTrace({
|
||||||
|
coilId: row.coilId,
|
||||||
|
currentCoilNo: row.currentCoilNo,
|
||||||
|
}).then(res => {
|
||||||
|
this.traceResult = res.data; // 将结果传递给组件
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('溯源查询失败:', err);
|
||||||
|
this.$message.error('溯源查询失败,请重试');
|
||||||
|
}).finally(() => {
|
||||||
|
this.traceLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
|
|||||||
13
klp-ui/src/views/wms/coil/merge/acid.vue
Normal file
13
klp-ui/src/views/wms/coil/merge/acid.vue
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
酸轧合卷
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-tabs class="app-container" v-model="activeTab">
|
<el-tabs class="app-container" v-model="activeTab">
|
||||||
|
<el-tab-pane label="次品" name="third">
|
||||||
|
<BasePage :qrcode="qrcode" :querys="query3" :labelType="labelType" :hideWarehouseQuery="hideWarehouseQuery"
|
||||||
|
:hideType="hideType" />
|
||||||
|
</el-tab-pane>
|
||||||
<el-tab-pane label="待收卷" name="second">
|
<el-tab-pane label="待收卷" name="second">
|
||||||
<BasePage :qrcode="qrcode" :querys="querys2" :labelType="labelType" :hideWarehouseQuery="hideWarehouseQuery"
|
<BasePage :qrcode="qrcode" :querys="querys2" :labelType="labelType" :hideWarehouseQuery="hideWarehouseQuery"
|
||||||
:hideType="hideType" />
|
:hideType="hideType" />
|
||||||
@@ -8,10 +12,6 @@
|
|||||||
<BasePage :qrcode="qrcode" :querys="querys" :labelType="labelType" :hideWarehouseQuery="hideWarehouseQuery"
|
<BasePage :qrcode="qrcode" :querys="querys" :labelType="labelType" :hideWarehouseQuery="hideWarehouseQuery"
|
||||||
:hideType="hideType" />
|
:hideType="hideType" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="次品" name="third">
|
|
||||||
<BasePage :qrcode="qrcode" :querys="query3" :labelType="labelType" :hideWarehouseQuery="hideWarehouseQuery"
|
|
||||||
:hideType="hideType" />
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
qrcode: false,
|
qrcode: false,
|
||||||
activeTab: 'second',
|
activeTab: 'third',
|
||||||
querys: {
|
querys: {
|
||||||
dataType: 1,
|
dataType: 1,
|
||||||
status: 0,
|
status: 0,
|
||||||
|
|||||||
@@ -264,6 +264,7 @@ export default {
|
|||||||
rawMaterialFactory: coil.manufacturer,
|
rawMaterialFactory: coil.manufacturer,
|
||||||
coilNo: coil.currentCoilNo,
|
coilNo: coil.currentCoilNo,
|
||||||
specification: coil.specification,
|
specification: coil.specification,
|
||||||
|
settlementType: '卷重结算',
|
||||||
material: coil.material,
|
material: coil.material,
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
weight: coil.netWeight,
|
weight: coil.netWeight,
|
||||||
@@ -278,7 +279,7 @@ export default {
|
|||||||
productName: undefined,
|
productName: undefined,
|
||||||
edgeType: undefined,
|
edgeType: undefined,
|
||||||
packaging: undefined,
|
packaging: undefined,
|
||||||
settlementType: undefined,
|
settlementType: '卷重结算',
|
||||||
rawMaterialFactory: undefined,
|
rawMaterialFactory: undefined,
|
||||||
coilNo: undefined,
|
coilNo: undefined,
|
||||||
specification: undefined,
|
specification: undefined,
|
||||||
@@ -358,6 +359,7 @@ export default {
|
|||||||
coilId: coil.coilId,
|
coilId: coil.coilId,
|
||||||
productName: coil.itemName,
|
productName: coil.itemName,
|
||||||
edgeType: coil.trimmingRequirement,
|
edgeType: coil.trimmingRequirement,
|
||||||
|
settlementType: '卷重结算',
|
||||||
packaging: coil.packagingRequirement,
|
packaging: coil.packagingRequirement,
|
||||||
rawMaterialFactory: coil.manufacturer,
|
rawMaterialFactory: coil.manufacturer,
|
||||||
coilNo: coil.currentCoilNo,
|
coilNo: coil.currentCoilNo,
|
||||||
|
|||||||
@@ -1,53 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="60px">
|
||||||
<el-form-item label="部门" prop="dept">
|
<el-form-item label="部门" prop="deptId">
|
||||||
<el-input
|
<el-select v-model="queryParams.deptId" placeholder="请选择部门" clearable @keyup.enter.native="handleQuery">
|
||||||
v-model="queryParams.dept"
|
<el-option v-for="item in deptList" :value="item.deptName" :label="item.deptName" :key="item.deptId" />
|
||||||
placeholder="请输入部门"
|
</el-select>
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="姓名" prop="name">
|
<el-form-item label="姓名" prop="name">
|
||||||
<el-input
|
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.name"
|
|
||||||
placeholder="请输入姓名"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="身份证号" prop="idCard">
|
<el-form-item label="身份证号" prop="idCard">
|
||||||
<el-input
|
<el-input v-model="queryParams.idCard" placeholder="请输入身份证号" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.idCard"
|
|
||||||
placeholder="请输入身份证号"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="年龄" prop="age">
|
<el-form-item label="年龄" prop="age">
|
||||||
<el-input
|
<el-input v-model="queryParams.age" placeholder="请输入年龄" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.age"
|
|
||||||
placeholder="请输入年龄"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="性别" prop="gender">
|
<el-form-item label="性别" prop="gender">
|
||||||
<el-input
|
<el-select v-model="queryParams.gender" placeholder="请选择性别" clearable @change="handleQuery">
|
||||||
v-model="queryParams.gender"
|
<el-option label="男" value="男" />
|
||||||
placeholder="请输入性别"
|
<el-option label="女" value="女" />
|
||||||
clearable
|
</el-select>
|
||||||
@keyup.enter.native="handleQuery"
|
<!-- <el-input v-model="queryParams.gender" placeholder="请输入性别" clearable @keyup.enter.native="handleQuery" /> -->
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="学历" prop="education">
|
<el-form-item label="学历" prop="education">
|
||||||
<el-input
|
<el-select v-model="queryParams.education" placeholder="请选择学历" clearable @change="handleQuery">
|
||||||
v-model="queryParams.education"
|
<el-option v-for="item in dict.type.hrm_employee_education" :key="item.value" :label="item.label"
|
||||||
placeholder="请输入学历"
|
:value="item.value" />
|
||||||
clearable
|
</el-select>
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
@@ -57,49 +36,25 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">入职</el-button>
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||||||
type="success"
|
@click="handleUpdate">修改</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
||||||
type="danger"
|
@click="handleDelete">删除</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="employeeInfoList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="employeeInfoList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="主键ID" align="center" prop="infoId" v-if="false"/>
|
<el-table-column label="主键ID" align="center" prop="infoId" v-if="false" />
|
||||||
<el-table-column label="部门" align="center" prop="dept" />
|
<el-table-column label="部门" align="center" prop="dept" />
|
||||||
<el-table-column label="岗位工种" align="center" prop="jobType" />
|
<el-table-column label="岗位工种" align="center" prop="jobType" />
|
||||||
<el-table-column label="姓名" align="center" prop="name" />
|
<el-table-column label="姓名" align="center" prop="name" />
|
||||||
@@ -116,95 +71,208 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="紧急联系人" align="center" prop="emergencyContact" />
|
<el-table-column label="紧急联系人" align="center" prop="emergencyContact" />
|
||||||
<el-table-column label="关系" align="center" prop="relationship" />
|
<el-table-column label="关系" align="center" prop="relationship" />
|
||||||
<el-table-column label="紧急联系人电话" align="center" prop="emergencyContactPhone" />
|
<el-table-column label="紧急联系电话" align="center" prop="emergencyContactPhone" />
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="在职状态" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="scope.row.isLeave === 0 ? 'success' : 'danger'">
|
||||||
|
{{ scope.row.isLeave === 0 ? '在职' : '已离职' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||||
size="mini"
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
type="text"
|
<el-button v-if="scope.row.isLeave === 0" size="mini" type="text" icon="el-icon-switch-button"
|
||||||
icon="el-icon-edit"
|
@click="handleResignation(scope.row)">离职</el-button>
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||||
v-show="total>0"
|
@pagination="getList" />
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改员工信息对话框 -->
|
<!-- 添加或修改员工信息对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="部门" prop="dept">
|
<!-- 公司内信息 -->
|
||||||
<el-input v-model="form.dept" placeholder="请输入部门" />
|
<el-card class="mb-4" shadow="never">
|
||||||
|
<template slot="header">
|
||||||
|
<div class="card-header">
|
||||||
|
<span>在职信息</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="部门" prop="deptId">
|
||||||
|
<!-- <el-input v-model="form.dept" placeholder="请输入部门" /> -->
|
||||||
|
<el-select v-model="form.deptId" placeholder="请选择部门">
|
||||||
|
<el-option v-for="item in deptList" :value="item.deptName" :label="item.deptName"
|
||||||
|
:key="item.deptId" />
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
<el-form-item label="岗位工种" prop="jobType">
|
<el-form-item label="岗位工种" prop="jobType">
|
||||||
<el-input v-model="form.jobType" placeholder="请输入岗位工种" />
|
<el-input v-model="form.jobType" placeholder="请输入岗位工种" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="姓名" prop="name">
|
</el-col>
|
||||||
<el-input v-model="form.name" placeholder="请输入姓名" />
|
<el-col :span="12">
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="身份证号" prop="idCard">
|
|
||||||
<el-input v-model="form.idCard" placeholder="请输入身份证号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="年龄" prop="age">
|
|
||||||
<el-input v-model="form.age" placeholder="请输入年龄" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="性别" prop="gender">
|
|
||||||
<el-input v-model="form.gender" placeholder="请输入性别" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="学历" prop="education">
|
|
||||||
<el-input v-model="form.education" placeholder="请输入学历" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="家庭住址" prop="homeAddress">
|
|
||||||
<el-input v-model="form.homeAddress" placeholder="请输入家庭住址" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="联系电话" prop="phone">
|
|
||||||
<el-input v-model="form.phone" placeholder="请输入联系电话" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="入职时间" prop="entryTime">
|
<el-form-item label="入职时间" prop="entryTime">
|
||||||
<el-date-picker clearable
|
<el-date-picker clearable v-model="form.entryTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
v-model="form.entryTime"
|
placeholder="请选择入职时间" style="width: 100%;">
|
||||||
type="datetime"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
placeholder="请选择入职时间">
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="紧急联系人" prop="emergencyContact">
|
</el-col>
|
||||||
<el-input v-model="form.emergencyContact" placeholder="请输入紧急联系人" />
|
<el-col :span="12">
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="关系" prop="relationship">
|
|
||||||
<el-input v-model="form.relationship" placeholder="请输入关系" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="紧急联系人电话" prop="emergencyContactPhone">
|
|
||||||
<el-input v-model="form.emergencyContactPhone" placeholder="请输入紧急联系人电话" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 员工个人信息 -->
|
||||||
|
<el-card class="mb-4" shadow="never">
|
||||||
|
<template slot="header">
|
||||||
|
<div class="card-header">
|
||||||
|
<span>员工信息</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="姓名" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入姓名" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="身份证号" prop="idCard">
|
||||||
|
<el-input v-model="form.idCard" placeholder="请输入身份证号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="年龄" prop="age">
|
||||||
|
<el-input v-model="form.age" placeholder="请输入年龄" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="性别" prop="gender">
|
||||||
|
<!-- <el-input v-model="form.gender" placeholder="请输入性别" /> -->
|
||||||
|
<el-radio-group v-model="form.gender" size="small" mode="button">
|
||||||
|
<el-radio label="男">男</el-radio>
|
||||||
|
<el-radio label="女">女</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="学历" prop="education">
|
||||||
|
<!-- <el-input v-model="form.education" placeholder="请输入学历" /> -->
|
||||||
|
<el-select v-model="form.education" placeholder="请选择学历">
|
||||||
|
<el-option v-for="item in dict.type.hrm_employee_education" :key="item.value" :label="item.label"
|
||||||
|
:value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="联系电话" prop="phone">
|
||||||
|
<el-input v-model="form.phone" placeholder="请输入联系电话" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="家庭住址" prop="homeAddress">
|
||||||
|
<el-input v-model="form.homeAddress" placeholder="请输入家庭住址" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 紧急联系信息 -->
|
||||||
|
<el-card class="mb-4" shadow="never">
|
||||||
|
<template slot="header">
|
||||||
|
<div class="card-header">
|
||||||
|
<span>紧急联系信息</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="紧急联系人" prop="emergencyContact">
|
||||||
|
<el-input v-model="form.emergencyContact" placeholder="请输入紧急联系人" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="关系" prop="relationship">
|
||||||
|
<el-input v-model="form.relationship" placeholder="请输入关系" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="紧急联系电话" prop="emergencyContactPhone">
|
||||||
|
<el-input v-model="form.emergencyContactPhone" placeholder="请输入紧急联系人电话" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 备注和附件 -->
|
||||||
|
<!-- <el-card class="mb-4" shadow="hover">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" v-if="!form.infoId">
|
||||||
|
<el-form-item label="附件" prop="attachment">
|
||||||
|
<file-upload v-model="attachment"></file-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card> -->
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 员工离职对话框 -->
|
||||||
|
<el-dialog :title="resignationTitle" :visible.sync="resignationOpen" width="500px" append-to-body>
|
||||||
|
<el-form ref="resignationForm" :model="resignationForm" :rules="resignationRules" label-width="80px">
|
||||||
|
<el-form-item label="员工姓名" prop="name">
|
||||||
|
<el-input v-model="resignationForm.name" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="异动类型" prop="changeType">
|
||||||
|
<el-input v-model="resignationForm.changeType" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="离职时间" prop="changeTime">
|
||||||
|
<el-date-picker clearable v-model="resignationForm.changeTime" type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择离职时间" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="离职原因" prop="changeReason" required>
|
||||||
|
<el-input v-model="resignationForm.changeReason" type="textarea" placeholder="请输入离职原因" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="负责人" prop="changeHandler">
|
||||||
|
<el-input v-model="resignationForm.changeHandler" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="附件" prop="attachment">
|
||||||
|
<file-upload v-model="resignationAttachment"></file-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="resignationForm.remark" type="textarea" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitResignation">确 定</el-button>
|
||||||
|
<el-button @click="cancelResignation">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listEmployeeInfo, getEmployeeInfo, delEmployeeInfo, addEmployeeInfo, updateEmployeeInfo } from "@/api/wms/employeeInfo";
|
import { listEmployeeInfo, getEmployeeInfo, delEmployeeInfo, updateEmployeeInfo } from "@/api/wms/employeeInfo";
|
||||||
|
import { listDept } from "@/api/wms/dept";
|
||||||
|
import { employeeEntry, employeeLeave } from '@/api/wms/employeeChange'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "EmployeeInfo",
|
name: "EmployeeInfo",
|
||||||
@@ -246,11 +314,46 @@ export default {
|
|||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
|
},
|
||||||
|
// 附件
|
||||||
|
attachment: undefined,
|
||||||
|
// 部门列表
|
||||||
|
deptList: [],
|
||||||
|
// 离职对话框相关
|
||||||
|
resignationTitle: "员工离职",
|
||||||
|
resignationOpen: false,
|
||||||
|
resignationForm: {
|
||||||
|
infoId: undefined,
|
||||||
|
name: undefined,
|
||||||
|
changeType: "离职",
|
||||||
|
changeTime: undefined,
|
||||||
|
changeReason: undefined,
|
||||||
|
changeHandler: undefined,
|
||||||
|
remark: undefined
|
||||||
|
},
|
||||||
|
resignationRules: {
|
||||||
|
changeTime: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请选择离职时间",
|
||||||
|
trigger: "change"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
changeReason: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入离职原因",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
resignationAttachment: undefined
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
dicts: ['hrm_employee_education'],
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.getDeptList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询员工信息列表 */
|
/** 查询员工信息列表 */
|
||||||
@@ -262,6 +365,11 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getDeptList() {
|
||||||
|
listDept().then(response => {
|
||||||
|
this.deptList = response.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@@ -307,14 +415,14 @@ export default {
|
|||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.infoId)
|
this.ids = selection.map(item => item.infoId)
|
||||||
this.single = selection.length!==1
|
this.single = selection.length !== 1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加员工信息";
|
this.title = "员工入职";
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
@@ -342,8 +450,14 @@ export default {
|
|||||||
this.buttonLoading = false;
|
this.buttonLoading = false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addEmployeeInfo(this.form).then(response => {
|
employeeEntry({
|
||||||
this.$modal.msgSuccess("新增成功");
|
changeType: 0,
|
||||||
|
changeTime: this.form.entryTime,
|
||||||
|
changeHandler: this.$store.getters.nickName,
|
||||||
|
attachment: this.attachment,
|
||||||
|
...this.form
|
||||||
|
}).then(response => {
|
||||||
|
this.$modal.msgSuccess("员工入职成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
@@ -373,6 +487,64 @@ export default {
|
|||||||
this.download('wms/employeeInfo/export', {
|
this.download('wms/employeeInfo/export', {
|
||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `employeeInfo_${new Date().getTime()}.xlsx`)
|
}, `employeeInfo_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
/** 离职按钮操作 */
|
||||||
|
handleResignation(row) {
|
||||||
|
// 获取北京时间(UTC+8)
|
||||||
|
const now = new Date();
|
||||||
|
const formattedDate = this.parseTime(now, '{y}-{m}-{d} {h}:{i}:{s}')
|
||||||
|
|
||||||
|
this.resignationForm = {
|
||||||
|
infoId: row.infoId,
|
||||||
|
name: row.name,
|
||||||
|
changeType: "离职",
|
||||||
|
changeTime: formattedDate,
|
||||||
|
changeReason: undefined,
|
||||||
|
changeHandler: this.$store.getters.nickName,
|
||||||
|
remark: undefined
|
||||||
|
};
|
||||||
|
this.resignationAttachment = undefined;
|
||||||
|
this.resignationOpen = true;
|
||||||
|
},
|
||||||
|
/** 取消离职按钮操作 */
|
||||||
|
cancelResignation() {
|
||||||
|
this.resignationOpen = false;
|
||||||
|
this.resignationForm = {
|
||||||
|
infoId: undefined,
|
||||||
|
name: undefined,
|
||||||
|
changeType: "1",
|
||||||
|
changeTime: undefined,
|
||||||
|
changeReason: undefined,
|
||||||
|
changeHandler: undefined,
|
||||||
|
remark: undefined
|
||||||
|
};
|
||||||
|
this.resignationAttachment = undefined;
|
||||||
|
this.resetForm("resignationForm");
|
||||||
|
},
|
||||||
|
/** 提交离职表单 */
|
||||||
|
submitResignation() {
|
||||||
|
this.$refs["resignationForm"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.$modal.confirm('是否确认提交员工离职申请?').then(() => {
|
||||||
|
this.buttonLoading = true;
|
||||||
|
employeeLeave({
|
||||||
|
changeType: 1,
|
||||||
|
changeTime: this.resignationForm.changeTime,
|
||||||
|
changeReason: this.resignationForm.changeReason,
|
||||||
|
changeHandler: this.resignationForm.changeHandler,
|
||||||
|
attachment: this.resignationAttachment,
|
||||||
|
remark: this.resignationForm.remark,
|
||||||
|
infoId: this.resignationForm.infoId
|
||||||
|
}).then(response => {
|
||||||
|
this.$modal.msgSuccess("员工离职成功");
|
||||||
|
this.resignationOpen = false;
|
||||||
|
this.getList();
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package com.klp.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.klp.common.annotation.RepeatSubmit;
|
||||||
|
import com.klp.common.annotation.Log;
|
||||||
|
import com.klp.common.core.controller.BaseController;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.klp.common.core.domain.R;
|
||||||
|
import com.klp.common.core.validate.AddGroup;
|
||||||
|
import com.klp.common.core.validate.EditGroup;
|
||||||
|
import com.klp.common.enums.BusinessType;
|
||||||
|
import com.klp.common.utils.poi.ExcelUtil;
|
||||||
|
import com.klp.domain.vo.WmsEmployeeChangeVo;
|
||||||
|
import com.klp.domain.bo.WmsEmployeeChangeBo;
|
||||||
|
import com.klp.service.IWmsEmployeeChangeService;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工异动(入职/离职)
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wms/employeeChange")
|
||||||
|
public class WmsEmployeeChangeController extends BaseController {
|
||||||
|
|
||||||
|
private final IWmsEmployeeChangeService iWmsEmployeeChangeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工异动(入职/离职)列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<WmsEmployeeChangeVo> list(WmsEmployeeChangeBo bo, PageQuery pageQuery) {
|
||||||
|
return iWmsEmployeeChangeService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出员工异动(入职/离职)列表
|
||||||
|
*/
|
||||||
|
@Log(title = "员工异动(入职/离职)", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(WmsEmployeeChangeBo bo, HttpServletResponse response) {
|
||||||
|
List<WmsEmployeeChangeVo> list = iWmsEmployeeChangeService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "员工异动(入职/离职)", WmsEmployeeChangeVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取员工异动(入职/离职)详细信息
|
||||||
|
*
|
||||||
|
* @param changeId 主键
|
||||||
|
*/
|
||||||
|
@GetMapping("/{changeId}")
|
||||||
|
public R<WmsEmployeeChangeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long changeId) {
|
||||||
|
return R.ok(iWmsEmployeeChangeService.queryById(changeId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增员工异动(入职/离职)
|
||||||
|
*/
|
||||||
|
@Log(title = "员工异动(入职/离职)", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsEmployeeChangeBo bo) {
|
||||||
|
return toAjax(iWmsEmployeeChangeService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改员工异动(入职/离职)
|
||||||
|
*/
|
||||||
|
@Log(title = "员工异动(入职/离职)", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsEmployeeChangeBo bo) {
|
||||||
|
return toAjax(iWmsEmployeeChangeService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除员工异动(入职/离职)
|
||||||
|
*
|
||||||
|
* @param changeIds 主键串
|
||||||
|
*/
|
||||||
|
@Log(title = "员工异动(入职/离职)", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{changeIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] changeIds) {
|
||||||
|
return toAjax(iWmsEmployeeChangeService.deleteWithValidByIds(Arrays.asList(changeIds), true));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工入职
|
||||||
|
*/
|
||||||
|
@Log(title = "员工入职", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/entry")
|
||||||
|
public R<Void> entry(@Validated(AddGroup.class) @RequestBody WmsEmployeeChangeBo bo) {
|
||||||
|
return toAjax(iWmsEmployeeChangeService.employeeEntry(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工离职
|
||||||
|
*/
|
||||||
|
@Log(title = "员工离职", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/leave")
|
||||||
|
public R<Void> leave(@Validated(AddGroup.class) @RequestBody WmsEmployeeChangeBo bo) {
|
||||||
|
return toAjax(iWmsEmployeeChangeService.employeeLeave(bo));
|
||||||
|
}
|
||||||
|
}
|
||||||
63
klp-wms/src/main/java/com/klp/domain/WmsEmployeeChange.java
Normal file
63
klp-wms/src/main/java/com/klp/domain/WmsEmployeeChange.java
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
package com.klp.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工异动(入职/离职)对象 wms_employee_change
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("wms_employee_change")
|
||||||
|
public class WmsEmployeeChange extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异动记录主键ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "change_id")
|
||||||
|
private Long changeId;
|
||||||
|
/**
|
||||||
|
* 关联员工信息表的主键ID
|
||||||
|
*/
|
||||||
|
private Long infoId;
|
||||||
|
/**
|
||||||
|
* 异动类型:0=入职,1=离职
|
||||||
|
*/
|
||||||
|
private Integer changeType;
|
||||||
|
/**
|
||||||
|
* 异动时间(入职/离职时间)
|
||||||
|
*/
|
||||||
|
private Date changeTime;
|
||||||
|
/**
|
||||||
|
* 异动原因(离职必填,入职可选)
|
||||||
|
*/
|
||||||
|
private String changeReason;
|
||||||
|
/**
|
||||||
|
* 负责人
|
||||||
|
*/
|
||||||
|
private String changeHandler;
|
||||||
|
/**
|
||||||
|
* 附件
|
||||||
|
*/
|
||||||
|
private String attachment;
|
||||||
|
/**
|
||||||
|
* 逻辑删除标识:0=正常,1=已删
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -96,4 +96,6 @@ public class WmsEmployeeInfo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
// 是否离职
|
||||||
|
private Integer isLeave;
|
||||||
}
|
}
|
||||||
|
|||||||
142
klp-wms/src/main/java/com/klp/domain/bo/WmsEmployeeChangeBo.java
Normal file
142
klp-wms/src/main/java/com/klp/domain/bo/WmsEmployeeChangeBo.java
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工异动(入职/离职)业务对象 wms_employee_change
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class WmsEmployeeChangeBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异动记录主键ID
|
||||||
|
*/
|
||||||
|
private Long changeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联员工信息表的主键ID
|
||||||
|
*/
|
||||||
|
private Long infoId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异动类型:0=入职,1=离职
|
||||||
|
*/
|
||||||
|
private Integer changeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异动时间(入职/离职时间)
|
||||||
|
*/
|
||||||
|
private Date changeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异动原因(离职必填,入职可选)
|
||||||
|
*/
|
||||||
|
private String changeReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人
|
||||||
|
*/
|
||||||
|
private String changeHandler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件
|
||||||
|
*/
|
||||||
|
private String attachment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序号
|
||||||
|
*/
|
||||||
|
private Long serialNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门
|
||||||
|
*/
|
||||||
|
private String dept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位工种
|
||||||
|
*/
|
||||||
|
private String jobType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年龄
|
||||||
|
*/
|
||||||
|
private Long age;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别(男/女)
|
||||||
|
*/
|
||||||
|
private String gender;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学历
|
||||||
|
*/
|
||||||
|
private String education;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 家庭住址
|
||||||
|
*/
|
||||||
|
private String homeAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入职时间
|
||||||
|
*/
|
||||||
|
private Date entryTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 紧急联系人
|
||||||
|
*/
|
||||||
|
private String emergencyContact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关系
|
||||||
|
*/
|
||||||
|
private String relationship;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 紧急联系人电话
|
||||||
|
*/
|
||||||
|
private String emergencyContactPhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社保类型(三险/五险)
|
||||||
|
*/
|
||||||
|
private String socialInsuranceType;
|
||||||
|
|
||||||
|
// infoRemart
|
||||||
|
private String infoRemark;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -105,4 +105,8 @@ public class WmsEmployeeInfoBo extends BaseEntity {
|
|||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
// 是否离职
|
||||||
|
private Integer isLeave;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package com.klp.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.klp.common.annotation.ExcelDictFormat;
|
||||||
|
import com.klp.common.convert.ExcelDictConvert;
|
||||||
|
import com.klp.domain.WmsEmployeeInfo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工异动(入职/离职)视图对象 wms_employee_change
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class WmsEmployeeChangeVo {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异动记录主键ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "异动记录主键ID")
|
||||||
|
private Long changeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联员工信息表的主键ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "关联员工信息表的主键ID")
|
||||||
|
private Long infoId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异动类型:0=入职,1=离职
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "异动类型:0=入职,1=离职")
|
||||||
|
private Integer changeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异动时间(入职/离职时间)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "异动时间", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "入=职/离职时间")
|
||||||
|
private Date changeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异动原因(离职必填,入职可选)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "异动原因", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "离=职必填,入职可选")
|
||||||
|
private String changeReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "负责人")
|
||||||
|
private String changeHandler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "附件")
|
||||||
|
private String attachment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 员工信息
|
||||||
|
*/
|
||||||
|
private WmsEmployeeInfo wmsEmployeeInfo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -124,4 +124,6 @@ public class WmsEmployeeInfoVo {
|
|||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
// 是否离职
|
||||||
|
private Integer isLeave;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.klp.mapper;
|
||||||
|
|
||||||
|
import com.klp.domain.WmsEmployeeChange;
|
||||||
|
import com.klp.domain.vo.WmsEmployeeChangeVo;
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工异动(入职/离职)Mapper接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
public interface WmsEmployeeChangeMapper extends BaseMapperPlus<WmsEmployeeChangeMapper, WmsEmployeeChange, WmsEmployeeChangeVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.klp.service;
|
||||||
|
|
||||||
|
import com.klp.domain.WmsEmployeeChange;
|
||||||
|
import com.klp.domain.vo.WmsEmployeeChangeVo;
|
||||||
|
import com.klp.domain.bo.WmsEmployeeChangeBo;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工异动(入职/离职)Service接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
public interface IWmsEmployeeChangeService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工异动(入职/离职)
|
||||||
|
*/
|
||||||
|
WmsEmployeeChangeVo queryById(Long changeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工异动(入职/离职)列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<WmsEmployeeChangeVo> queryPageList(WmsEmployeeChangeBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工异动(入职/离职)列表
|
||||||
|
*/
|
||||||
|
List<WmsEmployeeChangeVo> queryList(WmsEmployeeChangeBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增员工异动(入职/离职)
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(WmsEmployeeChangeBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改员工异动(入职/离职)
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(WmsEmployeeChangeBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除员工异动(入职/离职)信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工入职
|
||||||
|
*/
|
||||||
|
Boolean employeeEntry(WmsEmployeeChangeBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工离职
|
||||||
|
*/
|
||||||
|
Boolean employeeLeave(WmsEmployeeChangeBo bo);
|
||||||
|
}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
package com.klp.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.klp.common.utils.StringUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import com.klp.domain.bo.WmsEmployeeChangeBo;
|
||||||
|
import com.klp.domain.vo.WmsEmployeeChangeVo;
|
||||||
|
import com.klp.domain.WmsEmployeeChange;
|
||||||
|
import com.klp.domain.WmsEmployeeInfo;
|
||||||
|
import com.klp.mapper.WmsEmployeeChangeMapper;
|
||||||
|
import com.klp.mapper.WmsEmployeeInfoMapper;
|
||||||
|
import com.klp.service.IWmsEmployeeChangeService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工异动(入职/离职)Service业务层处理
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-03-14
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WmsEmployeeChangeServiceImpl implements IWmsEmployeeChangeService {
|
||||||
|
|
||||||
|
private final WmsEmployeeChangeMapper baseMapper;
|
||||||
|
private final WmsEmployeeInfoMapper wmsEmployeeInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工异动(入职/离职)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmsEmployeeChangeVo queryById(Long changeId){
|
||||||
|
WmsEmployeeChangeVo vo = baseMapper.selectVoById(changeId);
|
||||||
|
if (vo != null && vo.getInfoId() != null) {
|
||||||
|
WmsEmployeeInfo employee = wmsEmployeeInfoMapper.selectById(vo.getInfoId());
|
||||||
|
vo.setWmsEmployeeInfo(employee);
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工异动(入职/离职)列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<WmsEmployeeChangeVo> queryPageList(WmsEmployeeChangeBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<WmsEmployeeChange> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<WmsEmployeeChangeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
for (WmsEmployeeChangeVo vo : result.getRecords()) {
|
||||||
|
WmsEmployeeInfo employee = wmsEmployeeInfoMapper.selectById(vo.getInfoId());
|
||||||
|
vo.setWmsEmployeeInfo(employee);
|
||||||
|
}
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工异动(入职/离职)列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<WmsEmployeeChangeVo> queryList(WmsEmployeeChangeBo bo) {
|
||||||
|
LambdaQueryWrapper<WmsEmployeeChange> lqw = buildQueryWrapper(bo);
|
||||||
|
List<WmsEmployeeChangeVo> list = baseMapper.selectVoList(lqw);
|
||||||
|
for (WmsEmployeeChangeVo vo : list) {
|
||||||
|
WmsEmployeeInfo employee = wmsEmployeeInfoMapper.selectById(vo.getInfoId());
|
||||||
|
vo.setWmsEmployeeInfo(employee);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<WmsEmployeeChange> buildQueryWrapper(WmsEmployeeChangeBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<WmsEmployeeChange> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getInfoId() != null, WmsEmployeeChange::getInfoId, bo.getInfoId());
|
||||||
|
lqw.eq(bo.getChangeType() != null, WmsEmployeeChange::getChangeType, bo.getChangeType());
|
||||||
|
lqw.eq(bo.getChangeTime() != null, WmsEmployeeChange::getChangeTime, bo.getChangeTime());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getChangeReason()), WmsEmployeeChange::getChangeReason, bo.getChangeReason());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getChangeHandler()), WmsEmployeeChange::getChangeHandler, bo.getChangeHandler());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getAttachment()), WmsEmployeeChange::getAttachment, bo.getAttachment());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增员工异动(入职/离职)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(WmsEmployeeChangeBo bo) {
|
||||||
|
WmsEmployeeChange add = BeanUtil.toBean(bo, WmsEmployeeChange.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setChangeId(add.getChangeId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改员工异动(入职/离职)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(WmsEmployeeChangeBo bo) {
|
||||||
|
WmsEmployeeChange update = BeanUtil.toBean(bo, WmsEmployeeChange.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(WmsEmployeeChange entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除员工异动(入职/离职)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工入职
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean employeeEntry(WmsEmployeeChangeBo bo) {
|
||||||
|
WmsEmployeeInfo employee = new WmsEmployeeInfo();
|
||||||
|
employee.setSerialNumber(bo.getSerialNumber());
|
||||||
|
employee.setDept(bo.getDept());
|
||||||
|
employee.setJobType(bo.getJobType());
|
||||||
|
employee.setName(bo.getName());
|
||||||
|
employee.setIdCard(bo.getIdCard());
|
||||||
|
employee.setAge(bo.getAge());
|
||||||
|
employee.setGender(bo.getGender());
|
||||||
|
employee.setEducation(bo.getEducation());
|
||||||
|
employee.setHomeAddress(bo.getHomeAddress());
|
||||||
|
employee.setPhone(bo.getPhone());
|
||||||
|
employee.setEntryTime(bo.getEntryTime());
|
||||||
|
employee.setEmergencyContact(bo.getEmergencyContact());
|
||||||
|
employee.setRelationship(bo.getRelationship());
|
||||||
|
employee.setEmergencyContactPhone(bo.getEmergencyContactPhone());
|
||||||
|
employee.setSocialInsuranceType(bo.getSocialInsuranceType());
|
||||||
|
employee.setRemark(bo.getInfoRemark());
|
||||||
|
employee.setIsLeave(0);
|
||||||
|
boolean flag = wmsEmployeeInfoMapper.insert(employee) > 0;
|
||||||
|
if (!flag) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Long infoId = employee.getInfoId();
|
||||||
|
|
||||||
|
WmsEmployeeChange change = new WmsEmployeeChange();
|
||||||
|
change.setInfoId(infoId);
|
||||||
|
change.setChangeType(0);
|
||||||
|
change.setChangeTime(bo.getChangeTime());
|
||||||
|
change.setChangeHandler(bo.getChangeHandler());
|
||||||
|
change.setAttachment(bo.getAttachment());
|
||||||
|
change.setCreateBy(bo.getCreateBy());
|
||||||
|
change.setRemark(bo.getRemark());
|
||||||
|
return baseMapper.insert(change) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工离职
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean employeeLeave(WmsEmployeeChangeBo bo) {
|
||||||
|
if (bo.getInfoId() == null) {
|
||||||
|
throw new RuntimeException("员工ID不能为空");
|
||||||
|
}
|
||||||
|
WmsEmployeeInfo employee = wmsEmployeeInfoMapper.selectById(bo.getInfoId());
|
||||||
|
if (employee == null) {
|
||||||
|
throw new RuntimeException("员工不存在");
|
||||||
|
}
|
||||||
|
if (employee.getIsLeave() != null && employee.getIsLeave() == 1) {
|
||||||
|
throw new RuntimeException("员工已离职");
|
||||||
|
}
|
||||||
|
|
||||||
|
employee.setIsLeave(1);
|
||||||
|
boolean flag = wmsEmployeeInfoMapper.updateById(employee) > 0;
|
||||||
|
if (!flag) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
WmsEmployeeChange change = new WmsEmployeeChange();
|
||||||
|
change.setInfoId(bo.getInfoId());
|
||||||
|
change.setChangeType(1);
|
||||||
|
change.setChangeTime(bo.getChangeTime());
|
||||||
|
change.setChangeReason(bo.getChangeReason());
|
||||||
|
change.setChangeHandler(bo.getChangeHandler());
|
||||||
|
change.setAttachment(bo.getAttachment());
|
||||||
|
change.setCreateBy(bo.getCreateBy());
|
||||||
|
change.setRemark(bo.getRemark());
|
||||||
|
return baseMapper.insert(change) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -76,6 +76,8 @@ public class WmsEmployeeInfoServiceImpl implements IWmsEmployeeInfoService {
|
|||||||
lqw.eq(StringUtils.isNotBlank(bo.getRelationship()), WmsEmployeeInfo::getRelationship, bo.getRelationship());
|
lqw.eq(StringUtils.isNotBlank(bo.getRelationship()), WmsEmployeeInfo::getRelationship, bo.getRelationship());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getEmergencyContactPhone()), WmsEmployeeInfo::getEmergencyContactPhone, bo.getEmergencyContactPhone());
|
lqw.eq(StringUtils.isNotBlank(bo.getEmergencyContactPhone()), WmsEmployeeInfo::getEmergencyContactPhone, bo.getEmergencyContactPhone());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getSocialInsuranceType()), WmsEmployeeInfo::getSocialInsuranceType, bo.getSocialInsuranceType());
|
lqw.eq(StringUtils.isNotBlank(bo.getSocialInsuranceType()), WmsEmployeeInfo::getSocialInsuranceType, bo.getSocialInsuranceType());
|
||||||
|
// 是否离职
|
||||||
|
lqw.eq(bo.getIsLeave() != null, WmsEmployeeInfo::getIsLeave, bo.getIsLeave());
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.klp.mapper.WmsEmployeeChangeMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.klp.domain.WmsEmployeeChange" id="WmsEmployeeChangeResult">
|
||||||
|
<result property="changeId" column="change_id"/>
|
||||||
|
<result property="infoId" column="info_id"/>
|
||||||
|
<result property="changeType" column="change_type"/>
|
||||||
|
<result property="changeTime" column="change_time"/>
|
||||||
|
<result property="changeReason" column="change_reason"/>
|
||||||
|
<result property="changeHandler" column="change_handler"/>
|
||||||
|
<result property="attachment" column="attachment"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
<result property="updateTime" column="update_time"/>
|
<result property="updateTime" column="update_time"/>
|
||||||
<result property="delFlag" column="del_flag"/>
|
<result property="delFlag" column="del_flag"/>
|
||||||
<result property="remark" column="remark"/>
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="isLeave" column="is_leave"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user