update code 增加劳务工资管理功能
parent
cfb7c312bc
commit
ddf8ffb418
|
@ -49,7 +49,7 @@ spring:
|
|||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://62.234.3.186:3306/yanzhu_jh_test?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://62.234.3.186:3306/yanzhu_jh_2024?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Sxyanzhu@cf123
|
||||
#url: jdbc:mysql://192.168.126.19:3306/yanzhu_jh_test2024?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||
|
|
|
@ -9,6 +9,24 @@ export function listUnitpay(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询劳资管理列表
|
||||
export function listByDay(query) {
|
||||
return request({
|
||||
url: '/project/unitpay/listByDay',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询劳资管理列表
|
||||
export function listByMonth(query) {
|
||||
return request({
|
||||
url: '/project/unitpay/listByMonth',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询劳资管理详细
|
||||
export function getUnitpay(id) {
|
||||
return request({
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
/** 表格布局 **/
|
||||
.pagination-container {
|
||||
position: relative;
|
||||
height: 25px;
|
||||
height: 40px;
|
||||
margin-bottom: 10px;
|
||||
margin-top: 15px;
|
||||
padding: 10px 20px !important;
|
||||
|
@ -294,4 +294,4 @@
|
|||
line-height: 20px;
|
||||
font-size: 13px;
|
||||
background: url("https://szgcwx.jhncidg.com/staticFiles/img/WEB_345B9059DAD1492EB37EC4814EB340F0.png") no-repeat center/100% 100%;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
<el-table-column label="父级项目" align="left" prop="paretProjectName" width="200" show-overflow-tooltip />
|
||||
<el-table-column label="项目简称" align="left" prop="simpleName" width="200" show-overflow-tooltip />
|
||||
<el-table-column label="项目分类" align="center" prop="projectType">
|
||||
<template slot-scope="scope">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.project_category" :value="scope.row.projectType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -193,6 +193,8 @@
|
|||
v-hasPermi="['project:materialSeal:list']">材料封样管理</el-dropdown-item>
|
||||
<el-dropdown-item command="handleAttendanceData" icon="el-icon-s-grid"
|
||||
v-hasPermi="['project:attendance:list']">劳务实名管理</el-dropdown-item>
|
||||
<el-dropdown-item command="handleUnitPay" icon="el-icon-bangzhu"
|
||||
v-hasPermi="['project:unitpay:list']">工资管理</el-dropdown-item>
|
||||
<el-dropdown-item command="handleVideoConfig" icon="el-icon-video-camera-solid"
|
||||
v-hasPermi="['video:videoConfig:list']">视频配置</el-dropdown-item>
|
||||
<el-dropdown-item command="handleAiBoxVideoConfig" icon="el-icon-camera"
|
||||
|
@ -398,6 +400,7 @@
|
|||
<projectDesignDrawer ref="designDrawer"></projectDesignDrawer>
|
||||
<CommitteeDrawer ref="committeeDrawer"></CommitteeDrawer>
|
||||
<pitImageDrawer ref="pigImgDrawer"></pitImageDrawer>
|
||||
<UnitPayDrawer ref="unitPayDrawer"></UnitPayDrawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -433,6 +436,7 @@ import aiBoxVideoConfigDrawer from '@/views/video/aiBoxProjectConfig/aiBoxVideoC
|
|||
import prjPhotographyDrawer from '@/views/video/prjphotography/prjPhotographyDrawer.vue'
|
||||
import projectDesignDrawer from '@/views/project/projectDesign/projectDesignDrawer.vue';
|
||||
import CommitteeDrawer from '@/views/project/projectCommittee/projectCommitteeDrawer.vue'
|
||||
import UnitPayDrawer from '@/views/project/unitpay/unitpayDrawer.vue';
|
||||
import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
|
||||
import pitImageDrawer from '@/views/device/pitSurveyPoint/pitImageDrawer.vue'
|
||||
|
||||
|
@ -461,7 +465,8 @@ export default {
|
|||
prjPhotographyDrawer,
|
||||
projectDesignDrawer,
|
||||
CommitteeDrawer,
|
||||
pitImageDrawer
|
||||
pitImageDrawer,
|
||||
UnitPayDrawer
|
||||
},
|
||||
dicts: [
|
||||
"sur_project_xmjd",
|
||||
|
@ -732,6 +737,9 @@ export default {
|
|||
case "handlePitImage":
|
||||
this.$refs.pigImgDrawer.show(row);
|
||||
break;
|
||||
case "handleUnitPay":
|
||||
this.$refs.unitPayDrawer.show(row);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,81 +1,45 @@
|
|||
<template>
|
||||
<div class="projectect-attendance-drawer">
|
||||
<el-drawer
|
||||
v-if="isOpen"
|
||||
:visible.sync="isOpen"
|
||||
direction="rtl"
|
||||
size="30%"
|
||||
style="padding-left: 20px"
|
||||
>
|
||||
<el-drawer v-if="isOpen" :visible.sync="isOpen" direction="rtl" size="30%" style="padding-left: 20px">
|
||||
<template slot="title">
|
||||
<div>{{ title + " 【今日出勤】" }}</div>
|
||||
</template>
|
||||
<el-tabs type="card" v-model="activeName" style="padding-left: 20px" @tab-click="loadData">
|
||||
<el-tab-pane
|
||||
v-for="(it, idx) in nodes"
|
||||
:label="it.unitName + ''"
|
||||
:name="it.unitId + ''"
|
||||
:key="idx"
|
||||
></el-tab-pane>
|
||||
<el-tab-pane v-for="(it, idx) in nodes" :label="it.unitName + ''" :name="it.unitId + ''"
|
||||
:key="idx"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-form label-width="120px" ref="form" :rules="rules">
|
||||
<div
|
||||
style="
|
||||
<div style="
|
||||
padding: 8px 16px;
|
||||
background-color: #ecf8ff;
|
||||
border-radius: 4px;
|
||||
border-left: 5px solid #50bfff;
|
||||
margin: 20px;
|
||||
"
|
||||
>
|
||||
">
|
||||
<el-form-item label="在册劳务人员" prop="servicePersonnel">
|
||||
<el-input style="width: 80%" v-model="vform.servicePersonnel" :disabled="true"
|
||||
><i slot="suffix">人</i></el-input
|
||||
>
|
||||
<el-input style="width: 80%" v-model="vform.servicePersonnel" :disabled="true"><i
|
||||
slot="suffix">人</i></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="在册监理人员" prop="supervisorPersonnel">
|
||||
<el-input
|
||||
style="width: 80%"
|
||||
v-model="vform.supervisorPersonnel"
|
||||
:disabled="true"
|
||||
><i slot="suffix">人</i></el-input
|
||||
>
|
||||
<el-input style="width: 80%" v-model="vform.supervisorPersonnel" :disabled="true"><i
|
||||
slot="suffix">人</i></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="在册总包人员" prop="contractorPersonnel">
|
||||
<el-input
|
||||
style="width: 80%"
|
||||
v-model="vform.contractorPersonnel"
|
||||
:disabled="true"
|
||||
><i slot="suffix">人</i></el-input
|
||||
>
|
||||
<el-input style="width: 80%" v-model="vform.contractorPersonnel" :disabled="true"><i
|
||||
slot="suffix">人</i></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item label="劳务人员" prop="servicePersonnel">
|
||||
<el-input-number
|
||||
style="width: 80%"
|
||||
v-model="form.servicePersonnel"
|
||||
:min="0"
|
||||
:max="vform.servicePersonnel"
|
||||
label="请输入劳务人员"
|
||||
></el-input-number>
|
||||
<el-input-number style="width: 80%" v-model="form.servicePersonnel" :min="0" :max="vform.servicePersonnel"
|
||||
label="请输入劳务人员"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="监理人员" prop="supervisorPersonnel">
|
||||
<el-input-number
|
||||
style="width: 80%"
|
||||
v-model="form.supervisorPersonnel"
|
||||
:min="0"
|
||||
:max="vform.supervisorPersonnel"
|
||||
label="请输入监理人员"
|
||||
></el-input-number>
|
||||
<el-input-number style="width: 80%" v-model="form.supervisorPersonnel" :min="0"
|
||||
:max="vform.supervisorPersonnel" label="请输入监理人员"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="总包人员" prop="contractorPersonnel">
|
||||
<el-input-number
|
||||
style="width: 80%"
|
||||
v-model="form.contractorPersonnel"
|
||||
:min="0"
|
||||
:max="vform.contractorPersonnel"
|
||||
label="请输入总包人员"
|
||||
></el-input-number>
|
||||
<el-input-number style="width: 80%" v-model="form.contractorPersonnel" :min="0"
|
||||
:max="vform.contractorPersonnel" label="请输入总包人员"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="text-align: center" v-if="isUnit">
|
||||
|
@ -123,7 +87,7 @@ export default {
|
|||
computed: {
|
||||
...mapGetters(["dept"]),
|
||||
},
|
||||
mounted() {},
|
||||
mounted() { },
|
||||
|
||||
methods: {
|
||||
doOk() {
|
||||
|
|
|
@ -0,0 +1,141 @@
|
|||
<template>
|
||||
<div class="day-pay">
|
||||
<span>请选择日期:</span>
|
||||
<el-date-picker v-model="queryParams.attendanceTime"
|
||||
style="margin:0px 10px;" type="date" placeholder="选择日期" @change="doQuery">
|
||||
</el-date-picker>
|
||||
<el-button type="primary" @click="doQuery">搜索</el-button>
|
||||
<div>
|
||||
<el-table v-loading="loading" :data="attendanceList" height="60vh" class="my-table">
|
||||
<el-table-column label="照片" align="center" prop="id">
|
||||
<template slot-scope="{ row }">
|
||||
<el-image :src="row.scanPhoto || row.workerPhoto" :preview-src-list="[row.scanPhoto || row.workerPhoto]"
|
||||
style="height: 60px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" align="center" prop="workerName" />
|
||||
<el-table-column label="籍贯" align="center" prop="nativePlace" />
|
||||
<el-table-column label="性别" align="center" prop="attendanceType">
|
||||
<template slot-scope="{ row }">{{
|
||||
row.workerGender == 1 ? "女" : "男"
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="分包商名称" align="center" prop="companyName" />
|
||||
<el-table-column label="所属班组" align="center" prop="groupName" />
|
||||
<el-table-column label="工种" align="center" prop="workTypeName" />
|
||||
<el-table-column label="日工资" align="center" prop="pay">
|
||||
<template slot-scope="{ row }">{{(row.pay/100.0).toFixed(2)}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listByDay} from '@/api/project/unitpay'
|
||||
export default {
|
||||
props:{
|
||||
getPrjInfo:{
|
||||
type:Function
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
attendanceList:[],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
vendorsCode: "huazhu",
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: null,
|
||||
workerName: "",
|
||||
deptId: null,
|
||||
companyTypeId: "0",
|
||||
attendanceTime: new Date(),
|
||||
attendanceOutTime: undefined
|
||||
},
|
||||
cfgList: [],
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.$api.publics.findAttendanceCfgList({}).then((response) => {
|
||||
this.cfgList = response.data || [];
|
||||
this.doQuery();
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
doQuery(){
|
||||
this.queryParams.pageNum=1;
|
||||
this.getList();
|
||||
},
|
||||
initMe(){
|
||||
this.doQuery();
|
||||
},
|
||||
getList(){
|
||||
this.loading = true;
|
||||
let postData = {};
|
||||
if (this.queryParams.attendanceTime) {
|
||||
postData.attendanceTime = this.$dt(this.queryParams.attendanceTime).format(
|
||||
"YYYY-MM-DD"
|
||||
);
|
||||
}
|
||||
let prj=this.getPrjInfo();
|
||||
let tmps = this.cfgList.filter(
|
||||
(d) =>
|
||||
d.projectId == prj.id &&
|
||||
d.subDeptId == prj.deptId
|
||||
);
|
||||
postData.cfgid = tmps.length > 0?tmps[0].id:0;
|
||||
postData.pageNum = this.queryParams.pageNum;
|
||||
postData.pageSize = this.queryParams.pageSize;
|
||||
if (this.queryParams.workerName) {
|
||||
postData.workerName = this.queryParams.workerName;
|
||||
}
|
||||
if (this.queryParams.companyTypeId && this.queryParams.companyTypeId > 0) {
|
||||
postData.companyTypeId = this.queryParams.companyTypeId;
|
||||
}
|
||||
listByDay(postData).then((response) => {
|
||||
this.attendanceList = (response.rows || []).map((it) => {
|
||||
if (it.vendorsCode != "yanzhu") {
|
||||
let dt1 = it.attendanceTime;
|
||||
let dt2 = it.attendanceOutTime;
|
||||
if (!dt1 || !dt2 || dt1 == dt2) {
|
||||
let dt = dt1 || dt2;
|
||||
if (it.remark == "E") {
|
||||
it.attendanceTime = dt;
|
||||
it.attendanceOutTime = "";
|
||||
} else {
|
||||
it.attendanceTime = "";
|
||||
it.attendanceOutTime = dt;
|
||||
}
|
||||
}
|
||||
}
|
||||
it.scanPhoto =
|
||||
it.scanPhoto && it.scanPhoto.indexOf("/profile") == 0
|
||||
? "/jhapi" + it.scanPhoto
|
||||
: it.scanPhoto;
|
||||
return it;
|
||||
});
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.day-pay{
|
||||
font-size: 12px;
|
||||
.el-table.my-table{
|
||||
height: calc(100vh - 290px) !important;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -2,60 +2,26 @@
|
|||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="配置ID" prop="cfgId">
|
||||
<el-input
|
||||
v-model="queryParams.cfgId"
|
||||
placeholder="请输入配置ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.cfgId" placeholder="请输入配置ID" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班组ID" prop="groupId">
|
||||
<el-input
|
||||
v-model="queryParams.groupId"
|
||||
placeholder="请输入班组ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.groupId" placeholder="请输入班组ID" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班组名称" prop="groupName">
|
||||
<el-input
|
||||
v-model="queryParams.groupName"
|
||||
placeholder="请输入班组名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.groupName" placeholder="请输入班组名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工种编码" prop="workTypeCode">
|
||||
<el-input
|
||||
v-model="queryParams.workTypeCode"
|
||||
placeholder="请输入工种编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.workTypeCode" placeholder="请输入工种编码" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工种" prop="workTypeName">
|
||||
<el-input
|
||||
v-model="queryParams.workTypeName"
|
||||
placeholder="请输入工种"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.workTypeName" placeholder="请输入工种" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工资" prop="unitPay">
|
||||
<el-input
|
||||
v-model="queryParams.unitPay"
|
||||
placeholder="请输入工资"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.unitPay" placeholder="请输入工资" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input
|
||||
v-model="queryParams.isDel"
|
||||
placeholder="请输入${comment}"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.isDel" placeholder="请输入${comment}" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
@ -65,46 +31,20 @@
|
|||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['project:unitpay:add']"
|
||||
>新增</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['project:unitpay:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['project:unitpay:edit']"
|
||||
>修改</el-button>
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['project:unitpay:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['project:unitpay:remove']"
|
||||
>删除</el-button>
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['project:unitpay:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['project:unitpay:export']"
|
||||
>导出</el-button>
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['project:unitpay:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
@ -122,31 +62,16 @@
|
|||
<el-table-column label="${comment}" align="center" prop="isDel" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['project:unitpay:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['project:unitpay:remove']"
|
||||
>删除</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['project:unitpay:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['project:unitpay:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改劳资管理对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
|
@ -314,7 +239,7 @@ export default {
|
|||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
|
@ -356,12 +281,12 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除劳资管理编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal.confirm('是否确认删除劳资管理编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delUnitpay(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
|
|
@ -0,0 +1,146 @@
|
|||
<template>
|
||||
<div class="month-pay">
|
||||
<span class="label">请选择月份:</span>
|
||||
<el-date-picker v-model="queryParams.attendanceTime" style="margin:0px 10px;" type="month"
|
||||
placeholder="请选择月份" @change="doQuery">
|
||||
</el-date-picker>
|
||||
<el-button type="primary" @click="doQuery">搜索</el-button>
|
||||
<div>
|
||||
<el-table v-loading="loading" :data="attendanceList" height="60vh" class="my-table">
|
||||
<el-table-column label="照片" align="center" prop="id">
|
||||
<template slot-scope="{ row }">
|
||||
<el-image :src="row.scanPhoto || row.workerPhoto" :preview-src-list="[row.scanPhoto || row.workerPhoto]"
|
||||
style="height: 60px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" align="center" prop="workerName" />
|
||||
<el-table-column label="籍贯" align="center" prop="nativePlace" />
|
||||
<el-table-column label="性别" align="center" prop="attendanceType">
|
||||
<template slot-scope="{ row }">{{
|
||||
row.workerGender == 1 ? "女" : "男"
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="分包商名称" align="center" prop="companyName" />
|
||||
<el-table-column label="所属班组" align="center" prop="groupName" />
|
||||
<el-table-column label="工种" align="center" prop="workTypeName" />
|
||||
<el-table-column label="月工资" align="center" prop="pay">
|
||||
<template slot-scope="{ row }">
|
||||
<span v-if="false">{{(row.pay/100.0).toFixed(2)}}</span>
|
||||
<span >
|
||||
{{(row.unitPay/100.0).toFixed(2)}}*{{row.days}}={{(row.pay/100.0).toFixed(2)}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listByMonth} from '@/api/project/unitpay'
|
||||
export default {
|
||||
props:{
|
||||
getPrjInfo:{
|
||||
type:Function
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
attendanceList:[],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
vendorsCode: "huazhu",
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: null,
|
||||
workerName: "",
|
||||
deptId: null,
|
||||
companyTypeId: "0",
|
||||
attendanceTime: new Date(),
|
||||
attendanceOutTime: undefined
|
||||
},
|
||||
cfgList: [],
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.$api.publics.findAttendanceCfgList({}).then((response) => {
|
||||
this.cfgList = response.data || [];
|
||||
this.doQuery();
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
doQuery(){
|
||||
this.queryParams.pageNum=1;
|
||||
this.getList();
|
||||
},
|
||||
initMe(){
|
||||
this.doQuery();
|
||||
},
|
||||
getList(){
|
||||
this.loading = true;
|
||||
let postData = {};
|
||||
if (this.queryParams.attendanceTime) {
|
||||
postData.attendanceTime = this.$dt(this.queryParams.attendanceTime).format(
|
||||
"YYYY-MM-DD"
|
||||
);
|
||||
}
|
||||
let prj=this.getPrjInfo();
|
||||
let tmps = this.cfgList.filter(
|
||||
(d) =>
|
||||
d.projectId == prj.id &&
|
||||
d.subDeptId == prj.deptId
|
||||
);
|
||||
postData.cfgid = tmps.length > 0?tmps[0].id:0;
|
||||
postData.pageNum = this.queryParams.pageNum;
|
||||
postData.pageSize = this.queryParams.pageSize;
|
||||
if (this.queryParams.workerName) {
|
||||
postData.workerName = this.queryParams.workerName;
|
||||
}
|
||||
if (this.queryParams.companyTypeId && this.queryParams.companyTypeId > 0) {
|
||||
postData.companyTypeId = this.queryParams.companyTypeId;
|
||||
}
|
||||
listByMonth(postData).then((response) => {
|
||||
this.attendanceList = (response.rows || []).map((it) => {
|
||||
if (it.vendorsCode != "yanzhu") {
|
||||
let dt1 = it.attendanceTime;
|
||||
let dt2 = it.attendanceOutTime;
|
||||
if (!dt1 || !dt2 || dt1 == dt2) {
|
||||
let dt = dt1 || dt2;
|
||||
if (it.remark == "E") {
|
||||
it.attendanceTime = dt;
|
||||
it.attendanceOutTime = "";
|
||||
} else {
|
||||
it.attendanceTime = "";
|
||||
it.attendanceOutTime = dt;
|
||||
}
|
||||
}
|
||||
}
|
||||
it.scanPhoto =
|
||||
it.scanPhoto && it.scanPhoto.indexOf("/profile") == 0
|
||||
? "/jhapi" + it.scanPhoto
|
||||
: it.scanPhoto;
|
||||
return it;
|
||||
});
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.month-pay{
|
||||
font-size: 12px;
|
||||
.el-table.my-table{
|
||||
height: calc(100vh - 290px) !important;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,89 @@
|
|||
<template>
|
||||
<div class="pay-setting">
|
||||
<div style="text-align:right;">
|
||||
<el-button type="success" @click="doSave" v-loading="loading">保存</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table v-loading="loading" :data="payList" height="60vh" class="my-table">
|
||||
<el-table-column label="所属班组" align="center" prop="groupName" />
|
||||
<el-table-column label="工种" align="center" prop="workTypeName" />
|
||||
<el-table-column label="岗位工资" align="center" prop="pay">
|
||||
<template slot-scope="{ row }">
|
||||
<el-input v-model="row.unitPay" placeholder="请输入岗位工资" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listUnitpay,addUnitpay} from '@/api/project/unitpay'
|
||||
export default {
|
||||
props:{
|
||||
getPrjInfo:{
|
||||
type:Function
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
loading:false,
|
||||
cfgList: [],
|
||||
payList:[],
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.$api.publics.findAttendanceCfgList({}).then((response) => {
|
||||
this.cfgList = response.data || [];
|
||||
this.doQuery();
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
doSave(){
|
||||
let postData=this.payList.map(it=>{
|
||||
let obj={...it};
|
||||
obj.unitPay=obj.unitPay*100;
|
||||
return obj;
|
||||
})
|
||||
this.loading=true;
|
||||
addUnitpay(postData).then(d=>{
|
||||
this.loading=false;
|
||||
if(d.code==200){
|
||||
this.$modal.msgSuccess("保存成功!");
|
||||
this.doQuery();
|
||||
}else{
|
||||
this.$message.error("保存失败!");
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
doQuery(){
|
||||
let postData = {};
|
||||
let prj=this.getPrjInfo();
|
||||
let tmps = this.cfgList.filter(
|
||||
(d) =>
|
||||
d.projectId == prj.id &&
|
||||
d.subDeptId == prj.deptId
|
||||
);
|
||||
postData.cfgId = tmps.length > 0?tmps[0].id:0;
|
||||
this.loading=true;
|
||||
listUnitpay(postData).then(d=>{
|
||||
this.payList=(d.data||[]).map(it=>{
|
||||
it.unitPay=it.unitPay?(it.unitPay/100.0).toFixed(2):''
|
||||
return it;
|
||||
});
|
||||
this.loading=false;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.pay-setting{
|
||||
.el-table.my-table{
|
||||
height: calc(100vh - 240px) !important;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,90 @@
|
|||
<template>
|
||||
<div class="unitpay-main-drawer" v-if="isOpen">
|
||||
<el-drawer v-if="isOpen" :visible.sync="isOpen" direction="rtl" size="70%" style="padding-left: 20px">
|
||||
<template slot="title">
|
||||
<div>{{ title + " 【劳务实名管理】" }}</div>
|
||||
</template>
|
||||
|
||||
<el-tabs type="card" v-model="unitActiveName" style="margin-left: 20px; margin-right: 20px" @tab-click="getList">
|
||||
<el-tab-pane v-for="(it, idx) in nodes" :label="it.unitName + ''" :name="it.unitId + ''"
|
||||
:key="idx"></el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<div style="margin-left: 20px; margin-right: 20px">
|
||||
<el-tabs type="card" v-model="activeName" @tab-click="handleClick" :key="elKey">
|
||||
<el-tab-pane label="日工资列表" name="day">
|
||||
<DayPay ref="day" :getPrjInfo="getPrjInfo" v-if="activeName=='day'"></DayPay>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="月工资列表" name="month">
|
||||
<MonthPay ref="month" :getPrjInfo="getPrjInfo" v-if="activeName=='month'"></MonthPay>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="薪资设置" name="set">
|
||||
<PaySetting ref="setting" :getPrjInfo="getPrjInfo" v-if="activeName=='set'"></PaySetting>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DayPay from './dayPay.vue'
|
||||
import MonthPay from './monthPay.vue'
|
||||
import PaySetting from './paySetting.vue'
|
||||
export default {
|
||||
components:{
|
||||
DayPay,MonthPay,PaySetting
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'day',
|
||||
isOpen: false,
|
||||
title: '',
|
||||
nodes: [],
|
||||
unitActiveName:"",
|
||||
elKey:0,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getPrjInfo(){
|
||||
return {
|
||||
id:this.prj.id,
|
||||
deptId:this.unitActiveName
|
||||
};
|
||||
},
|
||||
show(prj) {
|
||||
this.prj = prj;
|
||||
this.activeName = 'day';
|
||||
this.title = prj.projectName || ""
|
||||
this.isOpen = true;
|
||||
this.handleClick();
|
||||
this.$api.publics.queryUnitList({
|
||||
projectId: prj.id,
|
||||
unitTypes: [2, 4],
|
||||
})
|
||||
.then((d) => {
|
||||
this.nodes = d.rows;
|
||||
if (d.rows.length > 0) {
|
||||
this.unitActiveName = this.nodes[0].unitId + "";
|
||||
}
|
||||
});
|
||||
},
|
||||
handleClick() {
|
||||
setTimeout(() => {
|
||||
if (this.activeName == 'first') {
|
||||
//this.$refs.main.init(this.prj);
|
||||
} else {
|
||||
// this.$refs.workerMain.initMe(this.prj);
|
||||
}
|
||||
}, 400);
|
||||
},
|
||||
getList() {
|
||||
this.activeName = 'day';
|
||||
this.elKey++;
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
|
@ -1,7 +1,15 @@
|
|||
package com.yanzhu.jh.project.controller;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import com.yanzhu.jh.project.service.ISurProjectAttendanceDataService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -33,16 +41,73 @@ public class SurProjectAttendanceUnitpayController extends BaseController
|
|||
{
|
||||
@Autowired
|
||||
private ISurProjectAttendanceUnitpayService surProjectAttendanceUnitpayService;
|
||||
|
||||
@Autowired
|
||||
private ISurProjectAttendanceDataService surProjectAttendanceDataService;
|
||||
/**
|
||||
* 查询劳资管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:unitpay:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SurProjectAttendanceUnitpay surProjectAttendanceUnitpay)
|
||||
public AjaxResult list(SurProjectAttendanceUnitpay surProjectAttendanceUnitpay)
|
||||
{
|
||||
startPage();
|
||||
List<SurProjectAttendanceUnitpay> list = surProjectAttendanceUnitpayService.selectSurProjectAttendanceUnitpayList(surProjectAttendanceUnitpay);
|
||||
List<SurProjectAttendanceUnitpay> iniList=surProjectAttendanceUnitpayService.initList(surProjectAttendanceUnitpay);
|
||||
for(SurProjectAttendanceUnitpay it :iniList){
|
||||
List<SurProjectAttendanceUnitpay> tmpList= list.stream().filter(item->StrUtil.equals(it.getWorkTypeName(),item.getWorkTypeName()) && StrUtil.equals(it.getGroupName(),item.getGroupName())).collect(Collectors.toList());
|
||||
if(tmpList.isEmpty()){
|
||||
it.setUnitPay(0l);
|
||||
list.add(it);
|
||||
}
|
||||
}
|
||||
return success(list);
|
||||
}
|
||||
/**
|
||||
* 查询劳资管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:unitpay:list')")
|
||||
@GetMapping("/listByDay")
|
||||
public TableDataInfo listByDay(SurProjectAttendanceData attWhere)
|
||||
{
|
||||
attWhere.setAttendanceOutTime(attWhere.getAttendanceOutTime());
|
||||
startPage();
|
||||
String tmp=attWhere.getAttendanceTime();
|
||||
if(StrUtil.isNotEmpty(tmp)){
|
||||
int year= DateUtil.parse(tmp).year();
|
||||
attWhere.setYear(year);
|
||||
}
|
||||
List<SurProjectAttendanceData> list = surProjectAttendanceDataService.selectSurProjectAttendanceDataListByDate(attWhere);
|
||||
SurProjectAttendanceUnitpay payWhere=new SurProjectAttendanceUnitpay();
|
||||
payWhere.setCfgId(attWhere.getCfgid());
|
||||
List<SurProjectAttendanceUnitpay> payList= surProjectAttendanceUnitpayService.selectSurProjectAttendanceUnitpayList(payWhere);
|
||||
for(SurProjectAttendanceData it :list){
|
||||
it.setDays(1l);
|
||||
it.setPay(surProjectAttendanceUnitpayService.getPay(payList,it));
|
||||
}
|
||||
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('project:unitpay:list')")
|
||||
@GetMapping("/listByMonth")
|
||||
public TableDataInfo listByMonth(SurProjectAttendanceData attWhere)
|
||||
{
|
||||
Date dt=DateUtil.parse(attWhere.getAttendanceTime());
|
||||
attWhere.setAttendanceTime( DateUtil.formatDate(DateUtil.beginOfMonth(dt)) );
|
||||
attWhere.setAttendanceOutTime( DateUtil.formatDate(DateUtil.endOfMonth(dt)));
|
||||
startPage();
|
||||
String tmp=attWhere.getAttendanceTime();
|
||||
if(StrUtil.isNotEmpty(tmp)){
|
||||
int year= DateUtil.parse(tmp).year();
|
||||
attWhere.setYear(year);
|
||||
}
|
||||
List<SurProjectAttendanceData> list = surProjectAttendanceDataService.selectSurProjectAttendanceDataListByMonth(attWhere);
|
||||
SurProjectAttendanceUnitpay payWhere=new SurProjectAttendanceUnitpay();
|
||||
payWhere.setCfgId(attWhere.getCfgid());
|
||||
List<SurProjectAttendanceUnitpay> payList= surProjectAttendanceUnitpayService.selectSurProjectAttendanceUnitpayList(payWhere);
|
||||
for(SurProjectAttendanceData it :list){
|
||||
it.setPay(surProjectAttendanceUnitpayService.getPay(payList,it));
|
||||
}
|
||||
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
@ -63,7 +128,7 @@ public class SurProjectAttendanceUnitpayController extends BaseController
|
|||
* 获取劳资管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:unitpay:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@GetMapping(value = "/one/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(surProjectAttendanceUnitpayService.selectSurProjectAttendanceUnitpayById(id));
|
||||
|
@ -75,9 +140,9 @@ public class SurProjectAttendanceUnitpayController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('project:unitpay:add')")
|
||||
@Log(title = "劳资管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SurProjectAttendanceUnitpay surProjectAttendanceUnitpay)
|
||||
public AjaxResult add(@RequestBody List<SurProjectAttendanceUnitpay> datas)
|
||||
{
|
||||
return toAjax(surProjectAttendanceUnitpayService.insertSurProjectAttendanceUnitpay(surProjectAttendanceUnitpay));
|
||||
return toAjax(surProjectAttendanceUnitpayService.addSurProjectAttendanceUnitpaies(datas));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -145,6 +145,42 @@ public class SurProjectAttendanceData extends BaseEntity
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 天数
|
||||
*/
|
||||
private long days;
|
||||
|
||||
public long getDays() {
|
||||
return days;
|
||||
}
|
||||
|
||||
public void setDays(long days) {
|
||||
this.days = days;
|
||||
}
|
||||
|
||||
public long getPay() {
|
||||
return pay;
|
||||
}
|
||||
|
||||
public void setPay(long pay) {
|
||||
this.pay = pay;
|
||||
}
|
||||
|
||||
public Long getUnitPay() {
|
||||
return unitPay;
|
||||
}
|
||||
|
||||
public void setUnitPay(Long unitPay) {
|
||||
this.unitPay = unitPay;
|
||||
}
|
||||
|
||||
private Long unitPay;
|
||||
|
||||
/**
|
||||
* 工资
|
||||
*/
|
||||
private long pay;
|
||||
|
||||
private Long projectId;
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
|
|
@ -119,6 +119,8 @@ public class SurProjectAttendanceUnitpay extends BaseEntity
|
|||
return isDel;
|
||||
}
|
||||
|
||||
private int year;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
@ -137,4 +139,12 @@ public class SurProjectAttendanceUnitpay extends BaseEntity
|
|||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
|
||||
public int getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(int year) {
|
||||
this.year = year;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,4 +132,8 @@ public interface SurProjectAttendanceDataMapper
|
|||
public List<SurProjectAttendanceData> attendanceDataList(SurProjectAttendanceData where);
|
||||
|
||||
public List<SurProjectAttendanceData> groupTodayCompanyTypeId(SurProjectAttendanceData where);
|
||||
|
||||
List<SurProjectAttendanceData> selectSurProjectAttendanceDataListByMonth(SurProjectAttendanceData attWhere);
|
||||
|
||||
List<SurProjectAttendanceData> selectSurProjectAttendanceDataListByDate(SurProjectAttendanceData attWhere);
|
||||
}
|
||||
|
|
|
@ -58,4 +58,6 @@ public interface SurProjectAttendanceUnitpayMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUnitpayByIds(Long[] ids);
|
||||
|
||||
List<SurProjectAttendanceUnitpay> initList(SurProjectAttendanceUnitpay surProjectAttendanceUnitpay);
|
||||
}
|
||||
|
|
|
@ -138,4 +138,8 @@ public interface ISurProjectAttendanceDataService
|
|||
* @param addList
|
||||
*/
|
||||
void addList(List<SurProjectAttendanceData> addList);
|
||||
|
||||
List<SurProjectAttendanceData> selectSurProjectAttendanceDataListByMonth(SurProjectAttendanceData attWhere);
|
||||
|
||||
List<SurProjectAttendanceData> selectSurProjectAttendanceDataListByDate(SurProjectAttendanceData attWhere);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.yanzhu.jh.project.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceUnitpay;
|
||||
|
||||
/**
|
||||
|
@ -58,4 +60,10 @@ public interface ISurProjectAttendanceUnitpayService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUnitpayById(Long id);
|
||||
|
||||
Long getPay(List<SurProjectAttendanceUnitpay> payList, SurProjectAttendanceData it);
|
||||
|
||||
List<SurProjectAttendanceUnitpay> initList(SurProjectAttendanceUnitpay surProjectAttendanceUnitpay);
|
||||
|
||||
int addSurProjectAttendanceUnitpaies(List<SurProjectAttendanceUnitpay> datas);
|
||||
}
|
||||
|
|
|
@ -517,4 +517,14 @@ public class SurProjectAttendanceDataServiceImpl implements ISurProjectAttendanc
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataListByMonth(SurProjectAttendanceData attWhere) {
|
||||
return surProjectAttendanceDataMapper.selectSurProjectAttendanceDataListByMonth(attWhere);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataListByDate(SurProjectAttendanceData attWhere) {
|
||||
return surProjectAttendanceDataMapper.selectSurProjectAttendanceDataListByDate(attWhere);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
package com.yanzhu.jh.project.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import com.yanzhu.jh.project.mapper.SurProjectAttendanceDataMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.jh.project.mapper.SurProjectAttendanceUnitpayMapper;
|
||||
|
@ -20,6 +27,7 @@ public class SurProjectAttendanceUnitpayServiceImpl implements ISurProjectAttend
|
|||
@Autowired
|
||||
private SurProjectAttendanceUnitpayMapper surProjectAttendanceUnitpayMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询劳资管理
|
||||
*
|
||||
|
@ -95,4 +103,48 @@ public class SurProjectAttendanceUnitpayServiceImpl implements ISurProjectAttend
|
|||
{
|
||||
return surProjectAttendanceUnitpayMapper.deleteSurProjectAttendanceUnitpayById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getPay(List<SurProjectAttendanceUnitpay> payList, SurProjectAttendanceData it) {
|
||||
for(SurProjectAttendanceUnitpay pay : payList){
|
||||
if(StrUtil.equals(pay.getGroupName(),it.getGroupName()) && StrUtil.equals(pay.getWorkTypeName(),it.getWorkTypeName())){
|
||||
it.setUnitPay(pay.getUnitPay());
|
||||
return it.getDays()*pay.getUnitPay();
|
||||
}
|
||||
}
|
||||
return 0l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SurProjectAttendanceUnitpay> initList(SurProjectAttendanceUnitpay surProjectAttendanceUnitpay) {
|
||||
int year= DateUtil.parse(DateUtil.now()).year();
|
||||
surProjectAttendanceUnitpay.setYear(year);
|
||||
return surProjectAttendanceUnitpayMapper.initList(surProjectAttendanceUnitpay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addSurProjectAttendanceUnitpaies(List<SurProjectAttendanceUnitpay> datas) {
|
||||
if(datas.size()==0){
|
||||
return 0;
|
||||
}
|
||||
Long cfgId= datas.get(0).getCfgId();
|
||||
SurProjectAttendanceUnitpay where=new SurProjectAttendanceUnitpay();
|
||||
where.setCfgId(cfgId);
|
||||
List<SurProjectAttendanceUnitpay> olds=surProjectAttendanceUnitpayMapper.selectSurProjectAttendanceUnitpayList(where);
|
||||
List<Long> addIds=new ArrayList<>();
|
||||
for(SurProjectAttendanceUnitpay it : datas){
|
||||
if(it.getId()!=null){
|
||||
surProjectAttendanceUnitpayMapper.updateSurProjectAttendanceUnitpay(it);
|
||||
addIds.add(it.getId());
|
||||
}else{
|
||||
surProjectAttendanceUnitpayMapper.insertSurProjectAttendanceUnitpay(it);
|
||||
}
|
||||
}
|
||||
for(SurProjectAttendanceUnitpay it : olds){
|
||||
if(!addIds.contains(it.getId())){
|
||||
surProjectAttendanceUnitpayMapper.deleteSurProjectAttendanceUnitpayById(it.getId());
|
||||
}
|
||||
}
|
||||
return datas.size();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="days" column="days"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectAttendanceDataVo">
|
||||
|
@ -450,7 +451,67 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_dept sd
|
||||
where sd.dept_name = #{deptName}
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceDataListByDate" parameterType="surProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
<include refid="selectSurProjectAttendanceDataVo"/>
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="projectId != null ">and cfgid in (select id from sur_project_attendance_cfg where projectId = #{projectId})</if>
|
||||
<if test="deptId != null "> and deptId = #{deptId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||
<if test="serverid != null "> and serverid = #{serverid}</if>
|
||||
<if test="workerId != null "> and workerId = #{workerId}</if>
|
||||
<if test="attendanceOutTime!=null and attendanceOutTime!=''">
|
||||
and (date(attendance_out_time) =date(#{attendanceOutTime}) or date(attendance_time) =date(#{attendanceOutTime}))
|
||||
</if>
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="companyTypeId!=null">
|
||||
<if test="companyTypeId>100">
|
||||
<if test="companyTypeId==101">
|
||||
and companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
</if>
|
||||
<if test="companyTypeId <100">
|
||||
and companyTypeId=#{companyTypeId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
|
||||
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto like concat('%', #{scanPhoto}, '%')</if>
|
||||
<if test="workerName != null and workerName != ''"> and workerName like concat('%', #{workerName}, '%')</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and
|
||||
(date(attendance_time) = date(#{attendanceTime}) or date(attendance_out_time) = date(#{attendanceTime}) )</if>
|
||||
<if test="identification != null and identification != ''"> and identification = #{identification}</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
<select id="selectSurProjectAttendanceDataListByMonth" parameterType="surProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
WITH RankedAttendance AS (
|
||||
SELECT
|
||||
id,
|
||||
workerId,
|
||||
COUNT(1) OVER (PARTITION BY workerId) AS days,
|
||||
ROW_NUMBER() OVER (PARTITION BY workerId ORDER BY id) AS rn
|
||||
FROM sur_project_attendance_data_2024
|
||||
WHERE cfgid = #{cfgid}
|
||||
AND (date(attendance_time) >= date(#{attendanceTime}) or date(attendance_out_time) >= date(#{attendanceTime}))
|
||||
AND (date(attendance_time) <= date(#{attendanceOutTime}) or date(attendance_out_time) <= date(#{attendanceOutTime}))
|
||||
)
|
||||
SELECT a.*, b.days
|
||||
FROM sur_project_attendance_data_${year} a
|
||||
JOIN RankedAttendance b ON a.id = b.id
|
||||
WHERE b.rn = 1
|
||||
order by a.workerId
|
||||
</select>
|
||||
<select id="todayAttendance" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select ady.* from sur_project_attendance_data_${year} ady
|
||||
left join sur_project sp on sp.id = ady.projectId
|
||||
|
|
|
@ -21,7 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectAttendanceUnitpayVo">
|
||||
select id, cfgId, groupId, groupName, workTypeCode, workTypeName, unitPay, remark, is_del, create_by, create_time, update_by, update_time from sur_project_attendance_unitpay
|
||||
select id, cfgId, groupId, groupName, workTypeCode, workTypeName, unitPay, remark, is_del, create_by, create_time, update_by, update_time
|
||||
from sur_project_attendance_unitpay
|
||||
</sql>
|
||||
|
||||
<select id="selectSurProjectAttendanceUnitpayList" parameterType="SurProjectAttendanceUnitpay" resultMap="SurProjectAttendanceUnitpayResult">
|
||||
|
@ -36,7 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="initList" parameterType="SurProjectAttendanceUnitpay" resultMap="SurProjectAttendanceUnitpayResult">
|
||||
select a.cfgId,a.groupName,a.workTypeCode,a.workTypeName
|
||||
from sur_project_attendance_data_${year} a
|
||||
where a.cfgId=23
|
||||
group by a.cfgId, a.groupName,a.workTypeCode,a.workTypeName
|
||||
</select>
|
||||
<select id="selectSurProjectAttendanceUnitpayById" parameterType="Long" resultMap="SurProjectAttendanceUnitpayResult">
|
||||
<include refid="selectSurProjectAttendanceUnitpayVo"/>
|
||||
where id = #{id}
|
||||
|
|
Loading…
Reference in New Issue