dev_xd
姜玉琦 2025-05-09 22:25:56 +08:00
commit 7d14cda64c
24 changed files with 5877 additions and 167 deletions

View File

@ -36,8 +36,8 @@ const attendanceUbiDataList = (data) => {
const photographyList = (proId) => {
return request({
url: "/manage/photography/finaList/"+proId,
method: "get"
url: "/manage/photography/finaList/" + proId,
method: "get",
});
};
@ -95,11 +95,11 @@ const milestoneList = (data) => {
params: data,
}).then((d) => {
let tmps = (d.rows || []).map((it) => {
it.nodeText = it.nodeName||'';
it.planStartDate=it.scheduledStart;
it.planEndDate=it.scheduledEnd;
it.startDate=it.actualStart;
it.endDate=it.actualEnd;
it.nodeText = it.nodeName || "";
it.planStartDate = it.scheduledStart;
it.planEndDate = it.scheduledEnd;
it.startDate = it.actualStart;
it.endDate = it.actualEnd;
updateItemState(it);
return it;
});
@ -108,82 +108,124 @@ const milestoneList = (data) => {
});
};
const costOutputSelectYearAndMonth=(data)=> {
return new Promise(reslove=>{
let data2={...data};
let y=data2.year;
let m=data2.month-1;
if(m==0){
m=12;
const costOutputSelectYearAndMonth = (data) => {
return new Promise((reslove) => {
let data2 = { ...data };
let y = data2.year;
let m = data2.month - 1;
if (m == 0) {
m = 12;
y--;
}
data2.year=y;
data2.month=m;
var ajaxs=[request({
data2.year = y;
data2.month = m;
var ajaxs = [
request({
url: `/manage/costOutput/selectYearAndMonth`,
method: 'post',
data:data
method: "post",
data: data,
}),
request({
url: `/manage/costOutput/selectYearAndMonth`,
method: 'post',
data:data2
})];
method: "post",
data: data2,
}),
];
axios.all(ajaxs).then(res=>{
let d=res[0]
const getValue=(tmps,type)=>{
let objs=tmps.filter(d=>d.costType==type);
return objs.length>0?objs[0]:{};
}
let tmps=(d.data||[]).map(it=>{
it.money=it.money?it.money/10000.0:0;
axios.all(ajaxs).then((res) => {
let d = res[0];
const getValue = (tmps, type) => {
let objs = tmps.filter((d) => d.costType == type);
return objs.length > 0 ? objs[0] : {};
};
let tmps = (d.data || []).map((it) => {
it.money = it.money ? it.money / 10000.0 : 0;
return it;
});
let y=data.year;
let m=data.month;
let y = data.year;
let m = data.month;
//if(m==0){
// m=12;
// y--;
//}
let tmps2=(res[1].data||[]).map(it=>{
it.money=it.money?it.money/10000.0:0;
let tmps2 = (res[1].data || []).map((it) => {
it.money = it.money ? it.money / 10000.0 : 0;
return it;
});
let curM=tmps.filter(it=>it.costType==9 && it.year==y && it.month==m);
curM=curM.length>0?curM[0]:{};
let curM = tmps.filter(
(it) => it.costType == 9 && it.year == y && it.month == m
);
curM = curM.length > 0 ? curM[0] : {};
let totalObjs=tmps.filter(it=>it.costType==9);
let total=0;
totalObjs.forEach(it=>{
if(it.money){
total+=it.money;
let totalObjs = tmps.filter((it) => it.costType == 9);
let total = 0;
totalObjs.forEach((it) => {
if (it.money) {
total += it.money;
}
});
let yearObjs=tmps.filter(it=>it.costType==9 && it.year==y);
let totalY=0;
yearObjs.forEach(it=>{
if(it.money){
totalY+=it.money;
let yearObjs = tmps.filter((it) => it.costType == 9 && it.year == y);
let totalY = 0;
yearObjs.forEach((it) => {
if (it.money) {
totalY += it.money;
}
});
let obj={
totalInv:getValue(tmps,1).money||0,//总投资
curYear:getValue(tmps,2).money||0,//年总投资
contract1:getValue(tmps,3).money||0,//合同金额
contract2:getValue(tmps,4).money||0,//合同支付金额
contract3:getValue(tmps,5).money||0,//合同挂账金额
safety1:getValue(tmps,6).money||0,//安措金额
safety2:getValue(tmps,7).money||0,//安措支付金额
safety3:getValue(tmps,8).money||0,//安措挂账金额
curMonth:curM.money||0,//当月投资
totalMonth:total,//开累投资
totalYear:totalY,//本年完成
}
let obj = {
totalInv: getValue(tmps, 1).money || 0, //总投资
curYear: getValue(tmps, 2).money || 0, //年总投资
contract1: getValue(tmps, 3).money || 0, //合同金额
contract2: getValue(tmps, 4).money || 0, //合同支付金额
contract3: getValue(tmps, 5).money || 0, //合同挂账金额
safety1: getValue(tmps, 6).money || 0, //安措金额
safety2: getValue(tmps, 7).money || 0, //安措支付金额
safety3: getValue(tmps, 8).money || 0, //安措挂账金额
curMonth: curM.money || 0, //当月投资
totalMonth: total, //开累投资
totalYear: totalY, //本年完成
};
reslove(obj);
})
})
}
});
});
};
const groupByComany = (data) => {
return request({
url: `/manage/bgscreen/attendance/groupByComany`,
data: data,
method: "post",
});
};
const groupAllByComany = (data) => {
return request({
url: `/manage/bgscreen/attendance/groupAllByComany`,
data: data,
method: "post",
});
};
// 查询劳务实名制管理列表
const listAttendance = (query) => {
return request({
url: "/manage/bgscreen/attendance/list",
method: "get",
params: query,
});
};
const groupByWorkerState = (data) => {
return request({
url: "/manage/bgscreen/attendance/groupByWorkerState",
method: "get",
params: data,
});
};
const queryWorkerByState = (data) => {
return request({
url: "/manage/bgscreen/attendance/queryWorkerByState",
method: "get",
params: data,
});
};
export default {
groupByCraftType,
@ -192,5 +234,10 @@ export default {
attendanceUbiDataList,
photographyList,
milestoneList,
costOutputSelectYearAndMonth
costOutputSelectYearAndMonth,
groupByComany,
groupAllByComany,
listAttendance,
groupByWorkerState,
queryWorkerByState,
};

View File

@ -0,0 +1,155 @@
<template>
<MyDialog v-if="show" v-model="show" width="1600px" height="850px" class="today-attendance-detail">
<template slot="title">今日出勤</template>
<div class="head-title-tab" style="padding: 10px 0px;">
<div :class="nav == 1 ? 'head-nav active' : 'head-nav'" @click="doNav(101)"></div>
<div :class="nav == 8 ? 'head-nav active' : 'head-nav'" @click="doNav(102)"></div>
<div :class="nav == 2 ? 'head-nav active' : 'head-nav'" @click="doNav(103)"></div>
</div>
<el-table v-loading="loading" :data="tableData" class="mytable" height="650" style="width: 100%;background: transparent;" ref="fbsubordinateUnit">
<el-table-column label="照片" align="center" prop="id">
<template slot-scope="{row}">
<el-image
v-if="row.scanPhoto || row.recentPhoto || row.workerPhoto"
:src="row.scanPhoto || row.recentPhoto || row.workerPhoto"
:preview-src-list="[row.recentPhoto || 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="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="inTime">
<template slot-scope="{row}">
<span v-if="row.attendanceTime">{{ row.attendanceTime | formatTime }}</span>
<i style="font-size: 20px;color: red;" v-else class="el-icon-close"></i>
</template>
</el-table-column>
<el-table-column label="下午打卡(末次)" align="center" prop="outTime">
<template slot-scope="{row}">
<span v-if="row.attendanceOutTime">{{ row.attendanceOutTime | formatTime }}</span>
<i style="font-size: 20px;color: red;" v-else class="el-icon-close"></i>
</template>
</el-table-column>
</el-table>
<el-pagination
layout="total,prev, pager, next"
:hide-on-single-page="true"
@current-change="handleCurrentChange"
:total="total"
:page-size="size"
:current-page.sync="index"
class="bg-pagination"
></el-pagination>
</MyDialog>
</template>
<script>
export default {
components: {},
data() {
return {
loading: false,
show: false,
tableData: [],
projectId: 0,
deptId: 0,
size: 10,
index: 1,
total: 0,
nav: 101,
}
},
mounted() {},
methods: {
handleCurrentChange(n) {
this.index = n
this.loadData()
},
doNav(n) {
this.nav = n
this.index = 1
this.loadData()
},
showDialog(data) {
this.projectId = data?.projectId || 0
this.deptId = data?.deptId || 0
this.size = 10
this.index = 1
this.loadData()
this.show = true
},
loadData() {
let postData = {
attendanceTime: this.$dt(new Date()).format('YYYY-MM-DD'),
projectId: this.projectId,
pageSize: this.size,
pageNum: this.index,
companyTypeId: this.nav,
}
this.tableData = []
this.loading = true
this.$api.detail.listAttendance(postData).then((d) => {
this.total = d.total || 0
this.tableData = (d.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.loading = false
})
},
},
}
</script>
<style lang="less" scoped>
.mytable {
/deep/ th .cell {
color: aquamarine;
}
}
.today-attendance-detail {
/deep/ .quality-table .el-table .el-table__row {
background-image: none !important;
td {
border-bottom: solid 1px rgba(60, 170, 255, 0.3);
}
}
}
</style>
<style lang="less">
.today-attendance-detail {
.popup-project-introduction-min {
transform: translateY(100px);
.bg-pagination {
margin-top: 20px;
}
}
}
</style>

View File

@ -0,0 +1,337 @@
<template>
<MyDialog v-if="show" v-model="show" width="80vw" class="today-attendance-detail">
<template v-if="isGroup">
<template slot="title">{{jobType==0?'在岗':'离岗'}}人数({{ total }})</template>
<el-table :data="tableData" class="mytable" max-height="750" style="width: 100%;background: transparent;" ref="fbsubordinateUnit" :show-summary="tableData.length > 1">
<el-table-column label="项目名称" align="left" prop="prjName" />
<el-table-column label="部门" align="left" prop="dptName"></el-table-column>
<el-table-column label="总包人数" align="center" prop="data101" />
<el-table-column label="监理人数" align="center" prop="data102" />
<el-table-column label="劳务人数" align="center" prop="data103" />
<el-table-column label="合计" align="center" prop="total">
<template slot-scope="{row}">
<span style="font-size:16px;font-weight: bold;color:#87e3fa;">{{row.total }}</span>
</template>
</el-table-column>
</el-table>
</template>
<template v-else>
<template slot="title">在岗人数({{ indexData.total }})</template>
<div class="head-title-tab" style="padding: 10px 0px;">
<div :class="nav == 101 ? 'head-nav active' : 'head-nav'" @click="doNav(101)">
总包人员({{ indexData.data101
}})
</div>
<div :class="nav == 102 ? 'head-nav active' : 'head-nav'" @click="doNav(102)">
监理人员({{ indexData.data102
}})
</div>
<div :class="nav == 103 ? 'head-nav active' : 'head-nav'" @click="doNav(103)">
劳务人员({{ indexData.data103
}})
</div>
</div>
<el-table v-loading="loading" :data="tableData" class="mytable" :height="tbHeight" style="width: 100%;background: transparent;" ref="fbsubordinateUnit">
<el-table-column label="照片" align="center" prop="id">
<template slot-scope="{row}">
<el-image :src="row.recentPhoto" :preview-src-list="[row.recentPhoto]" />
</template>
</el-table-column>
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="籍贯" align="center" prop="nativePlace" />
<el-table-column label="性别" align="center" prop="attendanceType">
<template slot-scope="{row}">{{ row.gender == 1 ? '女' : '男' }}</template>
</el-table-column>
<el-table-column label="进场时间" align="center" prop="inTime" v-if="1 == 2">
<template slot-scope="{row}">{{ row.enterDate | formatDate }}</template>
</el-table-column>
<el-table-column label="分包单位名称" align="center" prop="companyName">
<template slot-scope="{row}">{{row.companyName||row.degreeName}}</template>
</el-table-column>
<el-table-column label="所属班组" align="center">
<template slot-scope="{row}">{{ row.groupName||row.remark }}</template>
</el-table-column>
<el-table-column label="岗位/工种" align="center" prop="workTypeName" />
</el-table>
<el-pagination
layout="total,prev, pager, next"
:hide-on-single-page="true"
@current-change="handleCurrentChange"
:total="total"
:page-size="size"
:current-page.sync="index"
class="bg-pagination"
></el-pagination>
</template>
</MyDialog>
</template>
<script>
export default {
components: {},
data() {
return {
dpi: 0,
tbHeight: '60vh',
loading: false,
show: false,
tableData: [],
projectId: 0,
deptId: 0,
isGroup: false,
size: 10,
index: 1,
total: 0,
jobType: 0,
nav: 101,
indexData: {
total: 0,
data101: 0,
data102: 0,
data103: 0,
},
}
},
mounted() {
this.dpi = this.$dpi()
window.addEventListener('resize', () => {
if (this.dpi != this.$dpi()) {
this.dpi = this.$dpi()
this.chartKey++
}
})
},
methods: {
handleCurrentChange(n) {
this.index = n
this.loadData()
},
doNav(n) {
this.nav = n
this.index = 1
this.loadData()
},
showDialog(data) {
const getData = (id) => {
var tmps = data.datas.filter((d) => d.text == id)
return tmps.length > 0 ? tmps[0].cnt : 0
}
this.indexData.total = data.total
this.jobType = data.type
this.indexData.data101 = getData('101')
this.indexData.data102 = getData('102')
this.indexData.data103 = getData('103')
this.projectId = data?.projectId || 0
this.deptId = data?.deptId || 0
this.size = 10
this.index = 1
if (this.projectId == 0) {
this.isGroup = true
this.loadGroupData()
} else {
this.isGroup = false
this.loadData()
}
this.show = true
},
loadGroupData() {
this.$api.detail.groupByWorkerState({ deptId: this.deptId, state: this.jobType == 0 ? 0 : 1 }).then((d) => {
const getTypeId = (id) => {
let typeId = { 101: [1, 6], 102: [8], 103: [0, 2, 3, 4, 5] }
for (let k in typeId) {
let v = typeId[k]
if (v.indexOf(id) >= 0) {
return k
}
}
return ''
}
let tmps = (d.data || []).map((it) => {
return {
prjName: it.name,
dptName: it.groupName,
companyId: getTypeId(+it.companyId),
cnt: it.cfgid,
}
})
let sum = 0
let obj = {}
tmps.forEach((it) => {
let k = it.prjName + '_' + it.dptName + '_'
let o = null
if (!obj[k]) {
o = {
prjName: it.prjName,
dptName: it.dptName,
data101: 0,
data102: 0,
data103: 0,
total: 0,
}
obj[k] = o
} else {
o = obj[k]
}
sum += it.cnt
o['data' + it.companyId] += it.cnt
})
this.tableData = []
for (let k in obj) {
let o = obj[k]
o.total = o.data101 + o.data102 + o.data103
this.tableData.push(o)
}
this.total = sum
})
},
loadData() {
let postData = {
projectId: this.projectId,
pageSize: this.size,
pageNum: this.index,
id: this.nav,
state: this.jobType == 0 ? 0 : 1,
}
this.tableData = []
this.loading = true
this.$api.detail.queryWorkerByState(postData).then((d) => {
this.total = d.total || 0
this.tableData = (d.rows || []).map((it) => {
it.scanPhoto = it.scanPhoto && it.scanPhoto.indexOf('/profile') == 0 ? '/jhapi' + it.scanPhoto : it.scanPhoto
return it
})
this.loading = false
})
},
},
}
</script>
<style lang="less" scoped>
.mytable {
/deep/ th .cell {
color: aquamarine;
}
}
.today-attendance-detail {
/deep/ .quality-table .el-table .el-table__row {
background-image: none !important;
td {
border-bottom: solid 1px rgba(60, 170, 255, 0.3);
}
}
}
</style>
<style lang="less">
.today-attendance-detail {
.popup-project-introduction-min {
transform: translateY(100px);
height: calc(60vh + 200px) !important;
.bg-pagination {
margin-top: 20px;
}
.head-title-tab {
.head-nav {
padding: 4px 36px;
}
}
.el-table__row {
.el-image {
height: 60px;
}
}
}
@media (min-width: 1921px) and (max-width: 2560px) {
.popup-project-introduction-min {
height: calc(60vh + 240px) !important;
.el-table__header {
th {
height: 40px;
.cell {
font-size: 24px;
line-height: 40px;
}
}
}
.el-table__row {
.el-image {
height: 90px;
}
td {
.cell {
font-size: 20px;
line-height: 24px;
}
}
}
.el-pagination {
line-height: 30px;
margin-top: 40px;
span {
font-size: 24px;
vertical-align: middle;
}
button,
.number {
font-size: 24px;
width: 32px;
height: 32px;
line-height: 32px;
}
.el-icon {
font-size: 24px;
}
}
}
}
@media (min-width: 2561px) {
.popup-project-introduction-min {
height: calc(60vh + 300px) !important;
.el-table__header {
th {
height: 60px;
.cell {
font-size: 30px;
line-height: 60px;
}
}
}
.el-table__row {
.el-image {
height: 120px;
}
td {
.cell {
font-size: 24px;
line-height: 30px;
}
}
}
.el-pagination {
line-height: 48px;
margin-top: 40px;
span {
font-size: 30px;
vertical-align: middle;
}
button,
.number {
font-size: 30px;
width: 48px;
height: 48px;
line-height: 48px;
}
.el-icon {
font-size: 30px;
}
}
}
}
}
</style>

View File

@ -1,17 +1,13 @@
<template>
<MyDialog v-if="show" v-model="show" width="60vw" height="65vh" class="attendance-info-dlg">
<template slot="title">
{{ title }}
</template>
<template slot="title">{{ title }}</template>
<div class="head-title-tab" style="padding: 10px 0px;">
<div v-for="it in types" :key="it.value" :class="nav == it.value ? 'head-nav active' : 'head-nav'"
@click="doNav(it)">{{ it.label }}({{ getTypeCount(it) }})</div>
<div v-for="it in types" :key="it.value" :class="nav == it.value ? 'head-nav active' : 'head-nav'" @click="doNav(it)">{{ it.label }}({{ getTypeCount(it) }})</div>
</div>
<el-table v-loading="loading" :data="dataList" v-if="type == 0" class="data-list" :height="tbHeight">
<el-table-column label="头像" align="center">
<template #default="scope">
<el-image :src="scope.row.userPicture" :preview-teleported="true" class="att-img"
:preview-src-list="[scope.row.userPicture]"></el-image>
<el-image :src="scope.row.userPicture" :preview-teleported="true" class="att-img" :preview-src-list="[scope.row.userPicture]"></el-image>
</template>
</el-table-column>
<el-table-column label="姓名" align="center" prop="userName" />
@ -23,14 +19,12 @@
<span v-else style="color: red">离场</span>
</template>
</el-table-column>
<el-table-column label="进场日期" align="center" prop="createTime"
:width="$dpi() == '1K' ? '120px' : $dpi() == '2K' ? '200px' : '300px'">
<el-table-column label="进场日期" align="center" prop="createTime" :width="$dpi() == '1K' ? '120px' : $dpi() == '2K' ? '200px' : '300px'">
<template #default="scope">{{ scope.row.createTime | toDate }}</template>
</el-table-column>
<el-table-column label="所属单位" align="center" prop="subDeptName" />
<el-table-column label="班组" align="center" prop="subDeptGroupName"
:width="$dpi() == '1K' ? '120px' : $dpi() == '2K' ? '200px' : '300px'" />
<el-table-column label="班组" align="center" prop="subDeptGroupName" :width="$dpi() == '1K' ? '120px' : $dpi() == '2K' ? '200px' : '300px'" />
<el-table-column label="工种类型" align="center" prop="craftType">
<template #default="scope">
<dict-tag :options="types" :value="scope.row.craftType" />
@ -43,13 +37,11 @@
</el-table-column>
<el-table-column label="出生日期" align="center" prop="info.birthDayStr" v-if="false" />
</el-table>
<el-table v-loading="loading" :data="dataList" v-if="type == 1" class="data-list" :height="tbHeight">
<el-table-column label="进场照片" align="center" prop="inPhoto">
<template #default="scope">
<el-image v-if="scope.row.inPhoto" :src="scope.row.inPhoto" class="att-img"
:preview-teleported="true" :preview-src-list="[scope.row.inPhoto]"></el-image>
<el-image v-if="scope.row.inPhoto" :src="scope.row.inPhoto" class="att-img" :preview-teleported="true" :preview-src-list="[scope.row.inPhoto]"></el-image>
</template>
</el-table-column>
<el-table-column label="姓名" align="center" prop="userName" />
@ -64,8 +56,7 @@
<el-table-column label="离场照片" align="center" prop="outPhoto">
<template #default="scope">
<el-image v-if="scope.row.outPhoto" :src="scope.row.outPhoto" class="att-img"
:preview-teleported="true" :preview-src-list="[scope.row.outPhoto]"></el-image>
<el-image v-if="scope.row.outPhoto" :src="scope.row.outPhoto" class="att-img" :preview-teleported="true" :preview-src-list="[scope.row.outPhoto]"></el-image>
</template>
</el-table-column>
<el-table-column label="离场时间" align="center" prop="outTime">
@ -74,8 +65,7 @@
<span v-else class="el-icon-close" style="color: red;font-weight: bold;"></span>
</template>
</el-table-column>
<el-table-column label="班组" align="center" prop="subDeptGroupName"
:width="$dpi() == '1K' ? '120px' : $dpi() == '2K' ? '200px' : '400px'" />
<el-table-column label="班组" align="center" prop="subDeptGroupName" :width="$dpi() == '1K' ? '120px' : $dpi() == '2K' ? '200px' : '400px'" />
<el-table-column label="工种类型" align="center" prop="craftType">
<template #default="scope">
<dict-tag :options="types" :value="scope.row.craftType" class="dict-tag" />
@ -87,9 +77,15 @@
</template>
</el-table-column>
</el-table>
<el-pagination layout="total,prev, pager, next" :hide-on-single-page="true"
@current-change="handleCurrentChange" :total="total" :page-size="size" :current-page.sync="index"
class="bg-pagination"></el-pagination>
<el-pagination
layout="total,prev, pager, next"
:hide-on-single-page="true"
@current-change="handleCurrentChange"
:total="total"
:page-size="size"
:current-page.sync="index"
class="bg-pagination"
></el-pagination>
</MyDialog>
</template>
@ -98,7 +94,7 @@ export default {
//
data() {
return {
dpi: "",
dpi: '',
show: false,
title: '在岗人员',
prjInfo: {},
@ -116,93 +112,102 @@ export default {
}
},
mounted() {
this.dpi = this.$dpi();
window.addEventListener("resize", () => {
this.dpi = this.$dpi()
window.addEventListener('resize', () => {
if (this.dpi != this.$dpi()) {
this.dpi = this.$dpi();
this.resize();
this.dpi = this.$dpi()
this.resize()
}
});
this.resize();
})
this.resize()
},
methods: {
resize() {
let is1K = this.$dpi() == "1K";
let is2K = this.$dpi() == "2K";
this.tbHeight = is1K ? 400 : is2K ? 500 : 600;
let is1K = this.$dpi() == '1K'
let is2K = this.$dpi() == '2K'
this.tbHeight = is1K ? 400 : is2K ? 500 : 600
},
handleCurrentChange(n) {
this.index = n;
this.loadData();
this.index = n
this.loadData()
},
showDialog(opt) {
this.prjInfo = opt.prjInfo || {};
this.type = opt.type || 0;
this.title = this.type == 0 ? "在岗人员" : "今日出勤";
this.attendanceData = opt.attendanceData || [];
this.show = true;
this.$api.dict("pro_craft_type").then(dicts => {
this.types = dicts || [];
});
this.$api.dict("pro_craft_post").then(dicts => {
this.pro_craft_post = dicts || [];
});
this.index = 1;
this.loadData();
this.prjInfo = opt.prjInfo || {}
this.type = opt.type || 0
this.title = this.type == 0 ? '在岗人员' : '今日出勤'
this.attendanceData = opt.attendanceData || []
this.show = true
this.$api.dict('pro_craft_type').then((dicts) => {
this.types = dicts || []
})
this.$api.dict('pro_craft_post').then((dicts) => {
this.pro_craft_post = dicts || []
})
debugger
this.index = 1
this.loadData()
},
loadData() {
let ajax = this.$api.detail.subdeptsUsersList;
if (this.prjInfo.vendorsCode == 'uni') {
this.loadDataUni()
} else {
this.loadDataJh()
}
},
loadDataUni() {
let ajax = this.$api.detail.subdeptsUsersList
let postData = {
pageSize: this.size,
pageNum: this.index,
craftType: this.nav,
comId: this.prjInfo.comId,
useStatus: 0,
projectId: this.prjInfo.id
};
projectId: this.prjInfo.id,
}
if (this.type == 1) {
ajax = this.$api.detail.attendanceUbiDataList;
ajax = this.$api.detail.attendanceUbiDataList
postData = {
pageSize: this.size,
pageNum: this.index,
comId: this.prjInfo.comId,
projectId: this.prjInfo.id,
craftType: this.nav,
inTime: this.$dt(new Date()).format("YYYY-MM-DD")
};
inTime: this.$dt(new Date()).format('YYYY-MM-DD'),
}
this.loading = true;
ajax(postData).then(d => {
this.loading = false;
}
this.loading = true
ajax(postData).then((d) => {
this.loading = false
if (this.type == 0) {
this.dataList = (d.rows || []).map(d => {
d.info = this.$tryToJson(d.userInfos || "{}")
d.user = d.user || {};
this.dataList = (d.rows || []).map((d) => {
d.info = this.$tryToJson(d.userInfos || '{}')
d.user = d.user || {}
if (d.info.birthDay) {
let birthDay = this.$dt(d.info.birthDay).format("YYYY-MM-DD");
d.info.birthDayStr = birthDay;
d.info.age = this.$dt(new Date()).diff(d.info.birthDay, 'year');
let birthDay = this.$dt(d.info.birthDay).format('YYYY-MM-DD')
d.info.birthDayStr = birthDay
d.info.age = this.$dt(new Date()).diff(d.info.birthDay, 'year')
}
d.sex = d.userSex == 0 ? '男' : '女';
d.nativePlace = d.info.nativePlace || "";
return d;
});
d.sex = d.userSex == 0 ? '男' : '女'
d.nativePlace = d.info.nativePlace || ''
return d
})
} else {
this.dataList = d.rows || [];
this.dataList = d.rows || []
}
this.total = d.total || 0;
});
this.total = d.total || 0
})
},
loadDataJh() {},
doNav(n) {
this.nav = n.value;
this.index = 1;
this.loadData();
this.nav = n.value
this.index = 1
this.loadData()
},
getTypeCount(it) {
let tmps = this.attendanceData.filter(d => d.id == it.value)
return tmps.length > 0 ? tmps[0].value : 0;
}
}
let tmps = this.attendanceData.filter((d) => d.id == it.value)
return tmps.length > 0 ? tmps[0].value : 0
},
},
}
</script>
@ -277,7 +282,6 @@ export default {
line-height: 28px !important;
vertical-align: middle !important;
}
}
}
@ -340,7 +344,6 @@ export default {
line-height: 36px !important;
vertical-align: middle !important;
}
}
}
}
@ -410,7 +413,6 @@ export default {
line-height: 48px !important;
vertical-align: middle !important;
}
}
}
}

View File

@ -474,6 +474,8 @@
</el-col>
<project-info-dialog ref="infoDlg"></project-info-dialog>
<attendanceInfoDlg ref="attDlg"></attendanceInfoDlg>
<jh-attendance-detail-dialog ref="jhAttDlg"></jh-attendance-detail-dialog>
<jh-job-worker-dialog ref="jhJobWorkerDlg"></jh-job-worker-dialog>
</div>
</template>
@ -482,6 +484,8 @@ import projectInfoDialog from './detail/projectInfoDialog.vue'
import staffSurveyChart from '@/components/staffSurveyChart.vue'
import MonitAndWarning from './components/MonitAndWarning.vue'
import attendanceInfoDlg from './detail/attendanceInfoDlg.vue'
import jhAttendanceDetailDialog from './detail/AttendanceDetailDialog.vue'
import jhJobWorkerDialog from './detail/JobWorkerDialog.vue'
import debounce from 'lodash.debounce'
export default {
components: {
@ -489,6 +493,8 @@ export default {
staffSurveyChart,
MonitAndWarning,
attendanceInfoDlg,
jhAttendanceDetailDialog,
jhJobWorkerDialog,
},
data() {
return {
@ -608,6 +614,7 @@ export default {
this.getWeatherNowInfo()
}
})
this.loadAttendanceData()
this.loadMilestoneData()
this.loadCostOutput()
@ -653,6 +660,46 @@ export default {
})
},
loadAttendanceData() {
if (this.prjInfo.vendorsCode != 'uni') {
this.loadJhAttendanceData()
} else {
this.loadUniAttendanceData()
}
},
loadJhAttendanceData() {
let data = {
id: this.attendanceNav,
projectId: this.selProject.id,
attendanceTime: this.$dt(new Date()).format('YYYY-MM-DD'),
}
let ajax = this.$api.detail.groupByComany
if (this.attendanceNav != 1) {
ajax = this.$api.detail.groupAllByComany
}
ajax(data).then((d) => {
let tmps = d.data || []
const func = (ids) => {
let sum = 0
tmps.filter((it) => ids.includes(it.companyTypeId))
.map((it) => it.id)
.forEach((it) => {
sum += it * 1
})
return sum
}
this.attendanceTotal = 0
this.attendanceData = [
{ text: '劳务人员', value: func(['0', '2', '3', '4', '5']) },
{ text: '监理人员', value: func(['8']) },
{ text: '总包人员', value: func(['1', '6']) },
]
this.attendanceData.forEach((it) => {
this.attendanceTotal += it.value
})
})
},
loadUniAttendanceData() {
let ajax = this.$api.detail.groupByCraftType
let posData = {
comId: this.selProject.comId,
@ -689,11 +736,34 @@ export default {
this.loadAttendanceData()
},
doShowAttendanceDetail() {
if (this.prjInfo.vendorsCode == 'uni') {
this.$refs.attDlg.showDialog({
prjInfo: this.prjInfo,
attendanceData: this.attendanceData,
type: this.attendanceNav,
})
} else {
let data = {
deptId: this.prjInfo.deptId || 0,
projectId: this.prjInfo.id || 0,
attendanceTime: this.$dt(new Date()).format('YYYY-MM-DD'),
}
if (this.attendanceNav === 1) {
this.$refs.jhAttDlg.showDialog(data)
} else {
this.$refs.jhJobWorkerDlg.showDialog({
...data,
type: this.attendanceNav,
total: this.attendanceTotal,
datas: this.attendanceData.map((it) => {
return {
text: it.text.replace('总包人员', '101').replace('监理人员', '102').replace('劳务人员', '103'),
cnt: it.value,
}
}),
})
}
}
},
doDeviceNav(n) {
this.deviceNav = n

View File

@ -0,0 +1,33 @@
package com.yanzhu.manage.domain;
import com.yanzhu.common.core.web.domain.BaseEntity;
import java.util.List;
public class JhBaseEntity extends BaseEntity {
/**
* ID,B b.,
*/
private List<Long> prjIds;
/**
*
*/
private String proType;
public List<Long> getPrjIds() {
return prjIds;
}
public void setPrjIds(List<Long> prjIds) {
this.prjIds = prjIds;
}
public String getProType() {
return proType;
}
public void setProType(String proType) {
this.proType = proType;
}
}

View File

@ -106,6 +106,16 @@ public class ProProjectInfo extends BaseEntity
@Excel(name = "区县")
private String district;
public String getVendorsCode() {
return vendorsCode;
}
public void setVendorsCode(String vendorsCode) {
this.vendorsCode = vendorsCode;
}
private String vendorsCode;
private String disDeptName;
public String getDisDeptName() {

View File

@ -0,0 +1,514 @@
package com.yanzhu.manage.domain;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson2.JSONObject;
import com.yanzhu.common.core.annotation.Excel;
import com.yanzhu.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sur_project_attendance_data
*
* @author ruoyi
* @date 2023-09-24
*/
public class SurProjectAttendanceData extends JhBaseEntity
{
public SurProjectAttendanceData(){
this.year= DateTime.now().year();
}
private static final long serialVersionUID = 1L;
private int year;
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getWorkerName() {
return workerName;
}
public void setWorkerName(String workerName) {
this.workerName = workerName;
}
public String getWorkerPhoto() {
return workerPhoto;
}
public void setWorkerPhoto(String workerPhoto) {
this.workerPhoto = workerPhoto;
}
public Long getWorkerGender() {
return workerGender;
}
public void setWorkerGender(Long workerGender) {
this.workerGender = workerGender;
}
public Long getBirthDate() {
return birthDate;
}
public void setBirthDate(Long birthDate) {
this.birthDate = birthDate;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public String getWorkTypeName() {
return workTypeName;
}
public void setWorkTypeName(String workTypeName) {
this.workTypeName = workTypeName;
}
public String getEthnic() {
return ethnic;
}
public void setEthnic(String ethnic) {
this.ethnic = ethnic;
}
public String getNativePlace() {
return nativePlace;
}
public void setNativePlace(String nativePlace) {
this.nativePlace = nativePlace;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Integer getSpecWorkType() {
return specWorkType;
}
public void setSpecWorkType(Integer specWorkType) {
this.specWorkType = specWorkType;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getAttendanceOutTime() {
return attendanceOutTime;
}
public void setAttendanceOutTime(String attendanceOutTime) {
this.attendanceOutTime = attendanceOutTime;
}
private Long projectId;
@Excel(name = "项目名称")
private String projectName;
private Long deptId;
@Excel(name = "部门名称")
private String deptName;
@Excel(name = "姓名")
private String workerName;
private String workerPhoto;
@Excel(name = "性别0:男 1:女")
private Long workerGender;
private Long birthDate;
@Excel(name = "所属班组")
private String groupName;
@Excel(name = "工种")
private String workTypeName;
@Excel(name = "民族")
private String ethnic;
@Excel(name = "籍贯")
private String nativePlace;
@Excel(name = "联系电话")
private String phone;
@Excel(name = "是否特殊工种")
private Integer specWorkType;
private String companyTypeId;
@Excel(name = "分包商名称")
private String companyName;
private String workerId;
/** 考勤时间yyyy-MM-dd HH:mm:ss */
@Excel(name = "考勤时间(进场)")
private String attendanceTime;
@Excel(name = "考勤时间(离开)")
private String attendanceOutTime;
/** 身份证号 */
@Excel(name = "身份证号")
private String identification;
/** */
private Long id;
/** 配置项ID,可以获取项目ID和总包ID */
private Long cfgid;
/** 注册应用ID */
private String appId;
/** 厂商编号参考字典attendance_vendors */
private String vendorsCode;
/** 服务端ID */
private String serverid;
/** 队伍id */
private Long teamId;
/** 工种编码 */
private String workTypeCode;
/** 分包商id */
private String companyId;
/** 平台对应分包商ID */
private Long vendorId;
/** 设备编号 */
private String deviceCode;
/** 照片 */
private String scanPhoto;
/** */
private Long isDel;
private Long subDeptId;
/** 重要::yanzhu接口接收base64图片 */
private String scanPhotoBase64;
/** 重要::yanzhu出门进门逻辑判断 */
private String attendanceType;
public String getScanPhotoBase64() {
return scanPhotoBase64;
}
public void setScanPhotoBase64(String scanPhotoBase64) {
this.scanPhotoBase64 = scanPhotoBase64;
}
public String getAttendanceType() {
return attendanceType;
}
public void setAttendanceType(String attendanceType) {
this.attendanceType = attendanceType;
}
public static SurProjectAttendanceData createFromHuazhu(JSONObject j) {
SurProjectAttendanceData d=new SurProjectAttendanceData();
d.vendorsCode="huazhu";
d.serverid=j.getString("id");
d.workerId=j.getString("labourWorkerId");
long recordTime=j.getLongValue("recordTime",0);
if(recordTime>0){
if(j.getIntValue("inOrOut",1)==1){
d.setRemark("E");
}else{
d.setRemark("L");
}
d.attendanceTime= DateUtil.format(DateUtil.date(recordTime),"yyyy-MM-dd HH:mm:ss");
}
d.identification=j.getString("idCardNo");
d.teamId=j.getLongValue("teamId",0);
d.workTypeCode=j.getString("workerTypeId");
d.companyId=j.getString("unitId");
d.deviceCode=j.getString("deviceNo");
return d;
}
public static SurProjectAttendanceData createFromJgw(JSONObject j) {
SurProjectAttendanceData d=new SurProjectAttendanceData();
d.vendorsCode="jgw";
d.serverid=j.getString("id");
d.workerId=j.getString("workerId");
if("2".equals(j.getString("machineType"))){
d.setRemark("E");
}else{
d.setRemark("L");
}
d.attendanceTime = j.getString("checkinTime");
d.teamId=0l;
d.workTypeCode="";
d.companyId=j.getString("subcontractorId");
d.deviceCode=j.getString("deviceSerialNo");
d.isDel=0l;
return d;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getProjectId() {
return projectId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
public Long getSubDeptId() {
return subDeptId;
}
public void setSubDeptId(Long subDeptId) {
this.subDeptId = subDeptId;
}
public String getCompanyTypeId() {
return companyTypeId;
}
public void setCompanyTypeId(String companyTypeId) {
this.companyTypeId = companyTypeId;
}
public static SurProjectAttendanceData create(JSONObject json) {
SurProjectAttendanceData d=new SurProjectAttendanceData();
d.attendanceTime=json.getString("time");
if("E".equals(json.getString("type"))){
d.setRemark("E");
}else{
d.setRemark("L");
}
d.serverid=json.getString("id");
d.workerId=json.getString("workerId");
d.identification=json.getString("identification");
d.teamId=json.getLong("teamId");
d.workTypeCode=json.getString("workerTypeId");
d.companyId=json.getString("companyId");
d.vendorId=json.getLong("vendorId");
d.deviceCode=json.getString("deviceCode");
d.scanPhoto=json.getString("scanPhoto");
d.isDel=0l;
return d;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCfgid(Long cfgid)
{
this.cfgid = cfgid;
}
public Long getCfgid()
{
return cfgid;
}
public void setVendorsCode(String vendorsCode)
{
this.vendorsCode = vendorsCode;
}
public String getVendorsCode()
{
return vendorsCode;
}
public void setServerid(String serverid)
{
this.serverid = serverid;
}
public String getServerid()
{
return serverid;
}
public void setWorkerId(String workerId)
{
this.workerId = workerId;
}
public String getWorkerId()
{
return workerId;
}
public void setAttendanceTime(String attendanceTime)
{
this.attendanceTime = attendanceTime;
}
public String getAttendanceTime()
{
return attendanceTime;
}
public void setIdentification(String identification)
{
this.identification = identification;
}
public String getIdentification()
{
return identification;
}
public void setTeamId(Long teamId)
{
this.teamId = teamId;
}
public Long getTeamId()
{
return teamId;
}
public void setWorkTypeCode(String workTypeCode)
{
this.workTypeCode = workTypeCode;
}
public String getWorkTypeCode()
{
return workTypeCode;
}
public void setCompanyId(String companyId)
{
this.companyId = companyId;
}
public String getCompanyId()
{
return companyId;
}
public void setVendorId(Long vendorId)
{
this.vendorId = vendorId;
}
public Long getVendorId()
{
return vendorId;
}
public void setDeviceCode(String deviceCode)
{
this.deviceCode = deviceCode;
}
public String getDeviceCode()
{
return deviceCode;
}
public void setScanPhoto(String scanPhoto)
{
this.scanPhoto = scanPhoto;
}
public String getScanPhoto()
{
return scanPhoto;
}
public void setIsDel(Long isDel)
{
this.isDel = isDel;
}
public Long getIsDel()
{
return isDel;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("cfgid", getCfgid())
.append("vendorsCode", getVendorsCode())
.append("serverid", getServerid())
.append("workerId", getWorkerId())
.append("attendanceTime", getAttendanceTime())
.append("identification", getIdentification())
.append("teamId", getTeamId())
.append("workTypeCode", getWorkTypeCode())
.append("companyId", getCompanyId())
.append("vendorId", getVendorId())
.append("deviceCode", getDeviceCode())
.append("scanPhoto", getScanPhoto())
.append("remark", getRemark())
.append("isDel", getIsDel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,429 @@
package com.yanzhu.manage.domain;
import com.alibaba.fastjson2.JSONObject;
import com.yanzhu.common.core.annotation.Excel;
import com.yanzhu.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 广 sur_project_attendance_group
*
* @author ruoyi
* @date 2023-09-26
*/
public class SurProjectAttendanceGroup extends JhBaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** cfgid */
@Excel(name = "cfgid")
private Long cfgid;
/** 注册应用ID */
@Excel(name = "注册应用ID")
private String appId;
/** 服务器主键id */
@Excel(name = "服务器主键id")
private String serverid;
/** 营业执照号 */
@Excel(name = "营业执照号")
private String bizLicense;
/** 分包商统一社会信用代码 */
@Excel(name = "分包商统一社会信用代码")
private String companyCode;
/** 分包商ID */
@Excel(name = "分包商ID")
private String companyId;
/** 分包商名称 */
@Excel(name = "分包商名称")
private String companyName;
/** 分包商类型 */
@Excel(name = "分包商类型")
private String companyTypeId;
/** 平台对应分包商ID */
@Excel(name = "平台对应分包商ID")
private Long vendorId;
/** 班组名称 */
@Excel(name = "班组名称")
private String name;
/** 班组长名称 */
@Excel(name = "班组长名称")
private String leaderName;
/** 班组长电话 */
@Excel(name = "班组长电话")
private String leaderPhone;
/** 队伍Id */
@Excel(name = "队伍Id")
private Long teamId;
/** 队伍名称 */
@Excel(name = "队伍名称")
private String teamName;
/** 班组类型0:建筑工人班组;1:管理人员班组 */
@Excel(name = "班组类型0:建筑工人班组;1:管理人员班组")
private Long type;
/** 班组长对应的工人ID */
@Excel(name = "班组长对应的工人ID")
private Long leaderId;
/** 是否删除 */
@Excel(name = "是否删除")
private Integer deleted;
/** 基础平台对应班组ID */
@Excel(name = "基础平台对应班组ID")
private Long platformGroupId;
/** 基础平台对应队伍ID */
@Excel(name = "基础平台对应队伍ID")
private Long platformTeamId;
/** 企业进场日期 */
@Excel(name = "企业进场日期")
private Long enterDate;
/** 企业退场日期 */
@Excel(name = "企业退场日期")
private Long exitDate;
/** 是否有效 */
@Excel(name = "是否有效")
private Long isDel;
/** 时间戳 */
@Excel(name = "时间戳")
private Long createTimestamp;
public static SurProjectAttendanceGroup createHuazhu(JSONObject j) {
SurProjectAttendanceGroup g=new SurProjectAttendanceGroup();
g.companyId=""+j.getLongValue("unitId",0);
g.companyName=j.getString("unitName");
g.companyTypeId=j.getString("unitType");
g.serverid=j.getString("id");
g.enterDate=j.getLong("enterTime");
g.exitDate=j.getLong("leaveTime");
g.isDel=0l;
return g;
}
public static SurProjectAttendanceGroup createJgw(JSONObject j, boolean isDirectlyUnder) {
SurProjectAttendanceGroup g=new SurProjectAttendanceGroup();
g.serverid=j.getString("id");
if(isDirectlyUnder) {
g.companyId = j.getString("leaderTeamId");
g.leaderName=j.getString("subcontractorId");
g.leaderPhone="directly";
}else{
g.companyId=j.getString("subcontractorId");
}
g.companyName=j.getString("corpName");
g.teamName=j.getString("teamName");
g.bizLicense=j.getString("corpCode");
g.companyCode=j.getString("teamJobtype");
g.companyTypeId="0";
g.enterDate=0l;
g.exitDate=0l;
g.isDel=0l;
return g;
}
public Long getCreateTimestamp() {
return createTimestamp;
}
public void setCreateTimestamp(Long createTimestamp) {
this.createTimestamp = createTimestamp;
}
public static SurProjectAttendanceGroup create(JSONObject json) {
SurProjectAttendanceGroup g=new SurProjectAttendanceGroup();
g.serverid=json.getString("id");
g.bizLicense=json.getString("bizLicense");
g.companyCode=json.getString("companyCode");
g.companyId=""+json.getLongValue("companyId",0);
g.companyName=json.getString("companyName");
String typeId=json.getString("companyTypeId");
if("1".equals(typeId)||"8".equals(typeId)||"9".equals(typeId)){
typeId=typeId;
}else{
typeId="2";
}
g.companyTypeId=typeId;
g.vendorId=json.getLongValue("vendorId",0);
g.name=json.getString("name");
g.leaderName=json.getString("leaderName");
g.leaderPhone=json.getString("leaderPhone");
g.teamId=json.getLongValue("teamId",0);
g.teamName=json.getString("teamName");
g.type=json.getLongValue("type",0);
g.leaderId=json.getLongValue("leaderId",0);
g.deleted=json.get("deleted")==null?0:(json.getBoolean("deleted")?1:0);
g.platformGroupId=json.getLongValue("platformGroupId",0);
g.platformTeamId=json.getLongValue("platformTeamId",0);
g.enterDate=json.getLongValue("enterDate",0);
g.exitDate=json.getLongValue("exitDate",0);
g.isDel=0l;
return g;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCfgid(Long cfgid)
{
this.cfgid = cfgid;
}
public Long getCfgid()
{
return cfgid;
}
public void setServerid(String serverid)
{
this.serverid = serverid;
}
public String getServerid()
{
return serverid;
}
public void setBizLicense(String bizLicense)
{
this.bizLicense = bizLicense;
}
public String getBizLicense()
{
return bizLicense;
}
public void setCompanyCode(String companyCode)
{
this.companyCode = companyCode;
}
public String getCompanyCode()
{
return companyCode;
}
public void setCompanyId(String companyId)
{
this.companyId = companyId;
}
public String getCompanyId()
{
return companyId;
}
public void setCompanyName(String companyName)
{
this.companyName = companyName;
}
public String getCompanyName()
{
return companyName;
}
public void setCompanyTypeId(String companyTypeId)
{
this.companyTypeId = companyTypeId;
}
public String getCompanyTypeId()
{
return companyTypeId;
}
public void setVendorId(Long vendorId)
{
this.vendorId = vendorId;
}
public Long getVendorId()
{
return vendorId;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setLeaderName(String leaderName)
{
this.leaderName = leaderName;
}
public String getLeaderName()
{
return leaderName;
}
public void setLeaderPhone(String leaderPhone)
{
this.leaderPhone = leaderPhone;
}
public String getLeaderPhone()
{
return leaderPhone;
}
public void setTeamId(Long teamId)
{
this.teamId = teamId;
}
public Long getTeamId()
{
return teamId;
}
public void setTeamName(String teamName)
{
this.teamName = teamName;
}
public String getTeamName()
{
return teamName;
}
public void setType(Long type)
{
this.type = type;
}
public Long getType()
{
return type;
}
public void setLeaderId(Long leaderId)
{
this.leaderId = leaderId;
}
public Long getLeaderId()
{
return leaderId;
}
public void setDeleted(Integer deleted)
{
this.deleted = deleted;
}
public Integer getDeleted()
{
return deleted;
}
public void setPlatformGroupId(Long platformGroupId)
{
this.platformGroupId = platformGroupId;
}
public Long getPlatformGroupId()
{
return platformGroupId;
}
public void setPlatformTeamId(Long platformTeamId)
{
this.platformTeamId = platformTeamId;
}
public Long getPlatformTeamId()
{
return platformTeamId;
}
public void setEnterDate(Long enterDate)
{
this.enterDate = enterDate;
}
public Long getEnterDate()
{
return enterDate;
}
public void setExitDate(Long exitDate)
{
this.exitDate = exitDate;
}
public Long getExitDate()
{
return exitDate;
}
public void setIsDel(Long isDel)
{
this.isDel = isDel;
}
public Long getIsDel()
{
return isDel;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("cfgid", getCfgid())
.append("serverid", getServerid())
.append("bizLicense", getBizLicense())
.append("companyCode", getCompanyCode())
.append("companyId", getCompanyId())
.append("companyName", getCompanyName())
.append("companyTypeId", getCompanyTypeId())
.append("vendorId", getVendorId())
.append("name", getName())
.append("leaderName", getLeaderName())
.append("leaderPhone", getLeaderPhone())
.append("teamId", getTeamId())
.append("teamName", getTeamName())
.append("type", getType())
.append("leaderId", getLeaderId())
.append("deleted", getDeleted())
.append("createTimestamp", getCreateTimestamp())
.append("platformGroupId", getPlatformGroupId())
.append("platformTeamId", getPlatformTeamId())
.append("enterDate", getEnterDate())
.append("exitDate", getExitDate())
.append("remark", getRemark())
.append("isDel", getIsDel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,733 @@
package com.yanzhu.manage.domain;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.yanzhu.common.core.annotation.Excel;
import com.yanzhu.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
import java.util.List;
/**
* sur_project_attendance_user
*
* @author ruoyi
* @date 2023-09-24
*/
public class SurProjectAttendanceUser extends JhBaseEntity
{
private static final long serialVersionUID = 1L;
/** */
private Long id;
/** 配置项ID,可以获取项目ID和总包ID */
private Long cfgid;
/** 注册应用ID */
private String appId;
/** 厂商编号参考字典attendance_vendors */
private String vendorsCode;
/** 工人id */
@Excel(name = "工人id")
private String workerId;
/** 项目工人履历id对于旧劳务这个字段相当于工人的projectWorkerId管理人员的registerManagerId */
private Long laborWorkerId;
/** 人员类别0工人1管理人员 */
@Excel(name = "人员类别0工人1管理人员")
private Long workerCategory;
/** 工号 */
private Long qrCode;
/** 姓名 */
@Excel(name = "姓名")
private String name;
/** 民族 */
@Excel(name = "民族")
private String ethnic;
/** 籍贯 */
@Excel(name = "籍贯")
private String nativePlace;
/** 性别0:男 1:女 */
@Excel(name = "性别0:男 1:女")
private Long gender;
/** 出生日期时间戳 */
@Excel(name = "出生日期时间戳")
private Long birthDate;
/** 联系电话 */
@Excel(name = "联系电话")
private String phone;
/** 学历 */
@Excel(name = "学历")
private String degreeName;
/** 身份证照 */
@Excel(name = "身份证照")
private String photo;
/** 近照 */
private String recentPhoto;
/** 所属班组ID */
private String groupId;
/** 所属班组 */
@Excel(name = "所属班组")
private String groupName;
/** 是否班组长 */
@Excel(name = "是否班组长")
private Integer leader;
/** 工种编码 */
@Excel(name = "工种编码")
private String workTypeCode;
/** 工种 */
@Excel(name = "工种")
private String workTypeName;
/** 是否特殊工种 */
@Excel(name = "是否特殊工种")
private Integer specWorkType;
/** 安全帽编号 */
@Excel(name = "安全帽编号")
private String hatCode;
/** 进退场状态0:进场1:退场 */
@Excel(name = "进退场状态0:进场1:退场")
private Long state;
/** 进场日期 */
@Excel(name = "进场日期")
private String enterDate;
/** 退场日期 */
@Excel(name = "退场日期")
private String exitDate;
/** 分包商id */
@Excel(name = "分包商id")
private String companyId;
/** 分包商名称 */
@Excel(name = "分包商名称")
private String companyName;
/** 平台对应分包商ID */
@Excel(name = "平台对应分包商ID")
private Long vendorId;
/** 队伍id */
@Excel(name = "队伍id")
private Integer teamId;
/** 队伍名称 */
@Excel(name = "队伍名称")
private String teamName;
/** 进场方式0:自动,1:手动2:拍照 */
@Excel(name = "进场方式0:自动,1:手动2:拍照")
private String enterType;
/** 服务返回的JSON */
@Excel(name = "服务返回的JSON")
private String other;
/** 是否有效 */
@Excel(name = "是否有效")
private Long isDel;
/** 人员部门类型 */
@Excel(name = "人员部门类型")
private String companyTypeId;
/** 重要::yanzhu接口接收base64图片 */
private String recentPhotoBase64;
public String getRecentPhotoBase64() {
return recentPhotoBase64;
}
public void setRecentPhotoBase64(String recentPhotoBase64) {
this.recentPhotoBase64 = recentPhotoBase64;
}
@Excel(name = "进场时间")
private Date inTime;
@Excel(name = "离场时间")
private Date outTime;
public static SurProjectAttendanceUser createFromHuazhu(JSONObject j) {
SurProjectAttendanceUser u=new SurProjectAttendanceUser();
u.workerId=j.getString("id");
u.name=j.getString("name");
u.ethnic=j.getString("nationalName");
u.nativePlace=j.getString("provinceName")+j.getString("cityName");
u.gender=j.getLongValue("sex",0)==0l?1l:0l;
u.birthDate=j.getLongValue("birthday",0);
u.phone=j.getString("phone");
u.degreeName=j.getString("levelOfEducation");
u.recentPhoto=j.getString("profile");
u.groupId=j.getString("teamId");
u.groupName=j.getString("teamName");
u.workTypeCode=j.getString("workerTypeId");
u.workTypeName=j.getString("workerTypeName");
u.state=j.getLongValue("status",1)==2l?0l:1l;
long enterTime=j.getLong("enterTime");
if(enterTime>0){
u.enterDate= DateUtil.format(DateUtil.date(enterTime),"yyyy-MM-dd HH:mm:ss");
}
long leaveTime=j.getLong("leaveTime");
if(leaveTime>0) {
u.exitDate = DateUtil.format(DateUtil.date(leaveTime), "yyyy-MM-dd HH:mm:ss");
}
u.vendorId=j.getLongValue("unitProjectId",0);
u.companyId=""+j.getLongValue("unitId",0);
u.companyName=j.getString("unitName");
u.teamName=j.getString("teamName");
return u;
}
public static SurProjectAttendanceUser createFromJgw(JSONObject j) {
SurProjectAttendanceUser u=new SurProjectAttendanceUser();
u.workerId=j.getString("workerId");
u.name=j.getString("name");
u.ethnic=j.getString("minor");
u.phone=j.getString("workPhone");
u.nativePlace=j.getString("address");
u.gender=j.getLongValue("sex",0)==0l?1l:0l;
String tmp=j.getString("birthday");
if(StrUtil.isNotEmpty(tmp)) {
try {
u.birthDate = DateUtil.parse(tmp).getTime();
}catch (Exception ex){
}
}
u.photo=j.getString("headImage");
u.degreeName=j.getString("education");
u.recentPhoto=j.getString("vaildPhoto");
u.groupId="";
u.groupName="";
u.workTypeCode="";
u.workTypeName=j.getString("jobtype");
u.state="01".equals( j.getString("workerStatus"))?0l:1l;
String workDate=j.getString("workDate");
if(!StrUtil.isEmpty(workDate)){
u.enterDate=workDate;
}
u.vendorId=0l;
u.companyId=j.getString("subcontractorId");
u.companyName="";
u.teamName="";
u.isDel=0l;
JSONArray ja=j.getJSONArray("corpName");
if(ja!=null && ja.size()>0){
Object obj=ja.get(0);
if(obj!=null){
u.companyName=obj.toString();
}
}
u.leader=j.getInteger("isAdmin")==1?1:0;
return u;
}
public Date getInTime() {
return inTime;
}
public void setInTime(Date inTime) {
this.inTime = inTime;
}
public Date getOutTime() {
return outTime;
}
public void setOutTime(Date outTime) {
this.outTime = outTime;
}
private Long projectId;
private Long subDeptId;
private Long deptId;
private List<String> workerIds;
public List<String> getWorkerIds() {
return workerIds;
}
public void setWorkerIds(List<String> workerIds) {
this.workerIds = workerIds;
}
private int size;
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
private int index;
public Long getProjectId() {
return projectId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
public Long getSubDeptId() {
return subDeptId;
}
public void setSubDeptId(Long subDeptId) {
this.subDeptId = subDeptId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public static SurProjectAttendanceUser create(JSONObject json) {
SurProjectAttendanceUser u=new SurProjectAttendanceUser();
u.workerId=json.getString("workerId");
u.laborWorkerId=json.getLongValue("laborWorkerId",0);
u.workerCategory=json.getLongValue("workerCategory",0);
u.qrCode=json.getLongValue("qrCode",0);
u.name=json.getString("name");
u.ethnic=json.getString("ethnic");
u.nativePlace=json.getString("nativePlace");
u.gender=json.getLongValue("gender",0);
u.birthDate=json.getLongValue("birthDate",0);
u.phone=json.getString("phone");
u.recentPhoto=json.getString("recentPhoto");
u.groupId=json.getString("groupId");
u.groupName=json.getString("groupName");
u.leader=json.getBooleanValue("leader",false)?1:0;
u.workTypeCode=json.getString("workTypeCode");
u.workTypeName=json.getString("workTypeName");
u.specWorkType=json.getBooleanValue("specWorkType",false)?1:0;
u.hatCode=json.getString("hatCode");
u.state=json.getLongValue("status",0);
u.enterDate=json.getString("enterDate");
u.exitDate=json.getString("exitDate");
u.companyId=""+json.getLongValue("companyId",0);
u.companyName=json.getString("companyName");
u.vendorId=json.getLongValue("vendorId",0);
u.teamId=json.getInteger("teamId");
u.teamName=json.getString("teamName");
u.enterType=json.getString("enterType");
u.isDel=0l;
return u;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCfgid(Long cfgid)
{
this.cfgid = cfgid;
}
public Long getCfgid()
{
return cfgid;
}
public void setVendorsCode(String vendorsCode)
{
this.vendorsCode = vendorsCode;
}
public String getVendorsCode()
{
return vendorsCode;
}
public void setWorkerId(String workerId)
{
this.workerId = workerId;
}
public String getWorkerId()
{
return workerId;
}
public void setLaborWorkerId(Long laborWorkerId)
{
this.laborWorkerId = laborWorkerId;
}
public Long getLaborWorkerId()
{
return laborWorkerId;
}
public void setWorkerCategory(Long workerCategory)
{
this.workerCategory = workerCategory;
}
public Long getWorkerCategory()
{
return workerCategory;
}
public void setQrCode(Long qrCode)
{
this.qrCode = qrCode;
}
public Long getQrCode()
{
return qrCode;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setEthnic(String ethnic)
{
this.ethnic = ethnic;
}
public String getEthnic()
{
return ethnic;
}
public void setNativePlace(String nativePlace)
{
this.nativePlace = nativePlace;
}
public String getNativePlace()
{
return nativePlace;
}
public void setGender(Long gender)
{
this.gender = gender;
}
public Long getGender()
{
return gender;
}
public void setBirthDate(Long birthDate)
{
this.birthDate = birthDate;
}
public Long getBirthDate()
{
return birthDate;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setDegreeName(String degreeName)
{
this.degreeName = degreeName;
}
public String getDegreeName()
{
return degreeName;
}
public void setPhoto(String photo)
{
this.photo = photo;
}
public String getPhoto()
{
return photo;
}
public void setRecentPhoto(String recentPhoto)
{
this.recentPhoto = recentPhoto;
}
public String getRecentPhoto()
{
return recentPhoto;
}
public void setGroupId(String groupId)
{
this.groupId = groupId;
}
public String getGroupId()
{
return groupId;
}
public void setGroupName(String groupName)
{
this.groupName = groupName;
}
public String getGroupName()
{
return groupName;
}
public void setLeader(Integer leader)
{
this.leader = leader;
}
public Integer getLeader()
{
return leader;
}
public void setWorkTypeCode(String workTypeCode)
{
this.workTypeCode = workTypeCode;
}
public String getWorkTypeCode()
{
return workTypeCode;
}
public void setWorkTypeName(String workTypeName)
{
this.workTypeName = workTypeName;
}
public String getWorkTypeName()
{
return workTypeName;
}
public void setSpecWorkType(Integer specWorkType)
{
this.specWorkType = specWorkType;
}
public Integer getSpecWorkType()
{
return specWorkType;
}
public void setHatCode(String hatCode)
{
this.hatCode = hatCode;
}
public String getHatCode()
{
return hatCode;
}
public void setState(Long state)
{
this.state = state;
}
public Long getState()
{
return state;
}
public void setEnterDate(String enterDate)
{
this.enterDate = enterDate;
}
public String getEnterDate()
{
return enterDate;
}
public void setExitDate(String exitDate)
{
this.exitDate = exitDate;
}
public String getExitDate()
{
return exitDate;
}
public void setCompanyId(String companyId)
{
this.companyId = companyId;
}
public String getCompanyId()
{
return companyId;
}
public void setCompanyName(String companyName)
{
this.companyName = companyName;
}
public String getCompanyName()
{
return companyName;
}
public void setVendorId(Long vendorId)
{
this.vendorId = vendorId;
}
public Long getVendorId()
{
return vendorId;
}
public void setTeamId(Integer teamId)
{
this.teamId = teamId;
}
public Integer getTeamId()
{
return teamId;
}
public void setTeamName(String teamName)
{
this.teamName = teamName;
}
public String getTeamName()
{
return teamName;
}
public void setEnterType(String enterType)
{
this.enterType = enterType;
}
public String getEnterType()
{
return enterType;
}
public void setOther(String other)
{
this.other = other;
}
public String getOther()
{
return other;
}
public void setIsDel(Long isDel)
{
this.isDel = isDel;
}
public Long getIsDel()
{
return isDel;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getCompanyTypeId() {
return companyTypeId;
}
public void setCompanyTypeId(String companyTypeId) {
this.companyTypeId = companyTypeId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("cfgid", getCfgid())
.append("vendorsCode", getVendorsCode())
.append("workerId", getWorkerId())
.append("laborWorkerId", getLaborWorkerId())
.append("workerCategory", getWorkerCategory())
.append("qrCode", getQrCode())
.append("name", getName())
.append("ethnic", getEthnic())
.append("nativePlace", getNativePlace())
.append("gender", getGender())
.append("birthDate", getBirthDate())
.append("phone", getPhone())
.append("degreeName", getDegreeName())
.append("photo", getPhoto())
.append("recentPhoto", getRecentPhoto())
.append("groupId", getGroupId())
.append("groupName", getGroupName())
.append("leader", getLeader())
.append("workTypeCode", getWorkTypeCode())
.append("workTypeName", getWorkTypeName())
.append("specWorkType", getSpecWorkType())
.append("hatCode", getHatCode())
.append("state", getState())
.append("enterDate", getEnterDate())
.append("exitDate", getExitDate())
.append("companyId", getCompanyId())
.append("companyName", getCompanyName())
.append("vendorId", getVendorId())
.append("teamId", getTeamId())
.append("teamName", getTeamName())
.append("enterType", getEnterType())
.append("other", getOther())
.append("remark", getRemark())
.append("isDel", getIsDel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,139 @@
package com.yanzhu.manage.mapper;
import com.yanzhu.manage.domain.SurProjectAttendanceData;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* Mapper
*
* @author ruoyi
* @date 2023-09-24
*/
public interface SurProjectAttendanceDataMapper
{
/**
*
*
* @param id
* @return
*/
public SurProjectAttendanceData selectSurProjectAttendanceDataById(Long id);
/**
*
*
* @param surProjectAttendanceData
* @return
*/
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataList(SurProjectAttendanceData surProjectAttendanceData);
/**
*
*
* @param surProjectAttendanceData
* @return
*/
public SurProjectAttendanceData findCurrentAttendanceData(SurProjectAttendanceData surProjectAttendanceData);
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataListEx(SurProjectAttendanceData surProjectAttendanceData);
/**
*
*
* @param surProjectAttendanceData
* @return
*/
public int insertSurProjectAttendanceData(SurProjectAttendanceData surProjectAttendanceData);
/**
*
*
* @param surProjectAttendanceData
* @return
*/
public int updateSurProjectAttendanceData(SurProjectAttendanceData surProjectAttendanceData);
/**
*
*
* @param id
* @return
*/
public int deleteSurProjectAttendanceDataById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteSurProjectAttendanceDataByIds(Long[] ids);
/**
*
*
* @param list
* @return
*/
public int deleteSurProjectAttendanceDataByParams(List<String> list);
/**
*
*
* @param SurProjectAttendanceDataList
* @return
*/
public int batchSurProjectAttendanceData(@Param("list") List<SurProjectAttendanceData> SurProjectAttendanceDataList, @Param("year") String year);
public Long getLastServerId(SurProjectAttendanceData where);
List<SurProjectAttendanceData> groupAllByComany(SurProjectAttendanceData where);
List<SurProjectAttendanceData> groupByComany(SurProjectAttendanceData where);
public Long getHuazhuPage(SurProjectAttendanceData where);
public List<Map<String,Object>> initOtherData(Map<String,Object> data);
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data);
public String findHuaZhuCompanyType(String deptName);
public List<SurProjectAttendanceData> todayAttendance(SurProjectAttendanceData where);
/**
*
* @param where
* @return
*/
public List<Map<String, Object>> findGroupAllByDays(SurProjectAttendanceData where);
/**
*
* @param where
* @return
*/
public List<Map<String, Object>> findGroupAllByParams(SurProjectAttendanceData where);
/**
*
* @param where
* @return
*/
public List<Map<String, Object>> groupDataByParams(SurProjectAttendanceData where);
/**
*
* @param where
* @return
*/
public List<SurProjectAttendanceData> attendanceDataList(SurProjectAttendanceData where);
public List<SurProjectAttendanceData> groupTodayCompanyTypeId(SurProjectAttendanceData where);
List<SurProjectAttendanceData> selectSurProjectAttendanceDataListByMonth(SurProjectAttendanceData attWhere);
List<SurProjectAttendanceData> selectSurProjectAttendanceDataListByDate(SurProjectAttendanceData attWhere);
}

View File

@ -0,0 +1,86 @@
package com.yanzhu.manage.mapper;
import com.yanzhu.manage.domain.SurProjectAttendanceGroup;
import java.util.List;
/**
* 广Mapper
*
* @author ruoyi
* @date 2023-09-26
*/
public interface SurProjectAttendanceGroupMapper
{
/**
* 广
*
* @param id 广
* @return 广
*/
public SurProjectAttendanceGroup selectSurProjectAttendanceGroupById(Long id);
/**
* 广
*
* @param surProjectAttendanceGroup 广
* @return 广
*/
public List<SurProjectAttendanceGroup> selectSurProjectAttendanceGroupViewList(SurProjectAttendanceGroup surProjectAttendanceGroup);
/**
* 广
*
* @param surProjectAttendanceGroup 广
* @return 广
*/
public List<SurProjectAttendanceGroup> selectSurProjectAttendanceGroupList(SurProjectAttendanceGroup surProjectAttendanceGroup);
/**
* 广
*
* @param surProjectAttendanceGroup 广
* @return
*/
public int insertSurProjectAttendanceGroup(SurProjectAttendanceGroup surProjectAttendanceGroup);
/**
* 广
*
* @param surProjectAttendanceGroup 广
* @return
*/
public int updateSurProjectAttendanceGroup(SurProjectAttendanceGroup surProjectAttendanceGroup);
/**
* 广
*
* @param id 广
* @return
*/
public int deleteSurProjectAttendanceGroupById(Long id);
/**
* 广
*
* @param ids
* @return
*/
public int deleteSurProjectAttendanceGroupByIds(Long[] ids);
/**
* 广
*
* @param list
* @return
*/
public int deleteSurProjectAttendanceGroupByParams(List<String> list);
/**
* 广
*
* @param surProjectAttendanceGroupList 广
* @return
*/
public int batchSurProjectAttendanceGroup(List<SurProjectAttendanceGroup> surProjectAttendanceGroupList);
}

View File

@ -0,0 +1,170 @@
package com.yanzhu.manage.mapper;
import com.yanzhu.manage.domain.AttendanceCfg;
import com.yanzhu.manage.domain.SurProjectAttendanceData;
import com.yanzhu.manage.domain.SurProjectAttendanceUser;
import java.util.List;
import java.util.Map;
/**
* Mapper
*
* @author ruoyi
* @date 2023-09-24
*/
public interface SurProjectAttendanceUserMapper
{
/**
*
*
* @param id
* @return
*/
public SurProjectAttendanceUser selectSurProjectAttendanceUserById(Long id);
/**
*
*
* @param surProjectAttendanceUser
* @return
*/
public SurProjectAttendanceUser findCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
/**
* []
*
* @param surProjectAttendanceUser
* @return
*/
public SurProjectAttendanceUser findYzCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
/**
*
*
* @param surProjectAttendanceUser
* @return
*/
public List<SurProjectAttendanceUser> selectSurProjectAttendanceUserList(SurProjectAttendanceUser surProjectAttendanceUser);
public List<SurProjectAttendanceUser> querySurProjectAttendanceUserList(SurProjectAttendanceUser surProjectAttendanceUser);
public List<SurProjectAttendanceUser> selectSurProjectAttendanceUserListJgw(SurProjectAttendanceUser surProjectAttendanceUser);
/**
*
*
* @param surProjectAttendanceUser
* @return
*/
public int insertSurProjectAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
/**
*
*
* @param surProjectAttendanceUser
* @return
*/
public int updateSurProjectAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
/**
*
*
* @param id
* @return
*/
public int deleteSurProjectAttendanceUserById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteSurProjectAttendanceUserByIds(Long[] ids);
/**
*
*
* @param list
* @return
*/
public int deleteSurProjectAttendanceUserByParams(List<String> list);
/**
*
*
* @param surProjectAttendanceUserList
* @return
*/
public int batchSurProjectAttendanceUser(List<SurProjectAttendanceUser> surProjectAttendanceUserList);
/**
*
* countAttendance
* queryAttendanceUsers workerIds
* queryAttendanceByUserIds workerIds
* @param where
* @return
*/
public List<SurProjectAttendanceUser> queryAttendanceByUserIds(SurProjectAttendanceUser where);
public long countAttendance(AttendanceCfg where);
public List<SurProjectAttendanceUser> queryAttendanceUsers(SurProjectAttendanceUser where);
public long countTodayAttendance(SurProjectAttendanceUser where);
public List<SurProjectAttendanceUser> todayAttendance(SurProjectAttendanceUser where);
public List<SurProjectAttendanceUser> todayAttendanceData(List<String> list);
public List<SurProjectAttendanceUser> todayAttendanceOtherData(Map<String,Object> data);
/**
*
* @param where
* @return
*/
List<SurProjectAttendanceUser> queryWorkerOnDuty(SurProjectAttendanceUser where);
/**
*
* @param where
* @return
*/
public List<Map<String, Object>> groupUserByParams(SurProjectAttendanceUser where);
/**
*
* @param where
* @return
*/
public List<SurProjectAttendanceUser> attendanceUserList(SurProjectAttendanceUser where);
/**
*
* @param projectId
* @return
*/
public List<Map<String, Object>> findUserAllByDays(Long projectId);
/**
*
* @param where
* @return
*/
List<SurProjectAttendanceData> groupByWorkerOnDutyByDept(SurProjectAttendanceUser where);
/**
* |
* @param where
* @return
*/
List<SurProjectAttendanceData> groupByWorkerByDept(SurProjectAttendanceUser where);
/**
* |
* @param where
* @return
*/
List<SurProjectAttendanceUser> queryWorkerByState(SurProjectAttendanceUser where);
}

View File

@ -52,6 +52,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="vendorsCode" column="vendors_code"/>
<association property="setting" column="ps_id" javaType="ProProjectInfoSetting" resultMap="ProProjectInfoSettingResult" />
<collection property="projectDeptsList" javaType="java.util.List" resultMap="ProProjectInfoDeptsResult" />
</resultMap>
@ -123,13 +124,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pi.contract_amount, pi.paid_amount, pi.on_account_amount, pi.project_schedule, pi.project_summarize, pi.project_qr_code, pi.project_status,
pi.project_sort, pi.is_del, pi.create_by, pi.create_time, pi.update_by, pi.update_time, pi.remark,
pd.id pd_id,pd.dept_type pd_type,pd.dept_name pd_name,pd.dept_code pd_code,pd.leader pd_leader,pd.phone pd_phone,
ps.id ps_id,ps.org_name ps_org_name,ps.org_logo ps_org_logo,ps.org_image ps_org_image,ps.org_video ps_org_video,ps.org_plane ps_org_plane
ps.id ps_id,ps.org_name ps_org_name,ps.org_logo ps_org_logo,ps.org_image ps_org_image,ps.org_video ps_org_video,ps.org_plane ps_org_plane,ac.vendors_code
from pro_project_info pi
left join sys_dept sd on sd.dept_id = pi.com_id
left join sys_dept sd2 on sd2.dept_id = pi.dis_dept_id
left join pro_project_info_depts pd on pi.id=pd.project_id
left join pro_project_info_setting ps on pi.id=ps.project_id
left join sys_dict_data sdd1 on sdd1.dict_value = pi.project_type and sdd1.dict_type='pro_project_type'
left join attendance_cfg ac on ac.project_id=pi.id and ac.enabled=1 and ac.is_del=0
where pi.id = #{id}
</select>

View File

@ -0,0 +1,651 @@
<?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.yanzhu.manage.mapper.SurProjectAttendanceDataMapper">
<resultMap type="SurProjectAttendanceData" id="SurProjectAttendanceDataResult">
<result property="id" column="id" />
<result property="cfgid" column="cfgid" />
<result property="appId" column="app_id" />
<result property="projectId" column="projectId" />
<result property="projectName" column="projectName" />
<result property="deptId" column="deptId" />
<result property="deptName" column="deptName" />
<result property="vendorsCode" column="vendors_code" />
<result property="serverid" column="serverid" />
<result property="workerId" column="workerId" />
<result property="workerName" column="workerName" />
<result property="identification" column="identification" />
<result property="workerPhoto" column="workerPhoto" />
<result property="workerGender" column="workerGender" />
<result property="birthDate" column="birthDate" />
<result property="ethnic" column="ethnic" />
<result property="nativePlace" column="nativePlace" />
<result property="phone" column="phone" />
<result property="workTypeName" column="workTypeName" />
<result property="specWorkType" column="specWorkType" />
<result property="groupName" column="groupName" />
<result property="companyTypeId" column="companyTypeId" />
<result property="companyName" column="companyName" />
<result property="attendanceTime" column="attendance_time" />
<result property="attendanceOutTime" column="attendance_out_time" />
<result property="scanPhoto" column="scanPhoto" />
<result property="teamId" column="teamId" />
<result property="workTypeCode" column="workTypeCode" />
<result property="companyId" column="companyId" />
<result property="vendorId" column="vendorId" />
<result property="deviceCode" column="device_code" />
<result property="isDel" column="is_del" />
<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="remark" column="remark" />
<result property="days" column="days"/>
</resultMap>
<sql id="selectSurProjectAttendanceDataVo">
select
id,
cfgid,
app_id,
projectId,
projectName,
deptId,
deptName,
vendors_code,
serverid,
workerId,
workerName,
identification,
workerPhoto,
workerGender,
birthDate,
ethnic,
nativePlace,
phone,
workTypeName,
specWorkType,
groupName,
companyTypeId,
companyName,
attendance_time,
attendance_out_time,
scanPhoto,
teamId,
workTypeCode,
companyId,
vendorId,
device_code,
is_del,
create_by,
create_time,
update_by,
update_time,
remark
from sur_project_attendance_data_${year}
</sql>
<select id="findCurrentAttendanceData" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select * from sur_project_attendance_data_${year}
<where>
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
<if test="appId != null "> and app_id = #{appId}</if>
<if test="workerId != null and workerId != ''"> and workerId = #{workerId}</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) = date(#{attendanceTime})</if>
</where>
order by id desc LIMIT 1
</select>
<select id="selectSurProjectAttendanceDataListEx" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select * from sur_project_attendance_data_${year}
<where>
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
<if test="appId != null "> and app_id = #{appId}</if>
<if test="projectId != null "> and 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="identification != null and identification != ''"> and identification = #{identification}</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="vendorId != null "> and vendorId = #{vendorId}</if>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</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 &lt;100">
and companyTypeId=#{companyTypeId}
</if>
</if>
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) = date(#{attendanceTime})</if>
</where>
order by id desc
</select>
<select id="selectSurProjectAttendanceDataList" 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 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) &lt;=date(#{attendanceOutTime}) or date(attendance_time) &lt;=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 &lt;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) &gt;= date(#{attendanceTime}) or date(attendance_out_time) &gt;= date(#{attendanceTime}) )</if>
<if test="identification != null and identification != ''"> and identification = #{identification}</if>
</where>
order by id desc
</select>
<select id="selectSurProjectAttendanceDataById" parameterType="Long" resultMap="SurProjectAttendanceDataResult">
<include refid="selectSurProjectAttendanceDataVo"/>
where id = #{id}
</select>
<insert id="insertSurProjectAttendanceData" parameterType="SurProjectAttendanceData" useGeneratedKeys="true" keyProperty="id">
insert into sur_project_attendance_data_${year}
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cfgid != null">cfgid,</if>
<if test="appId != null">app_id,</if>
<if test="projectId != null">projectId,</if>
<if test="projectName != null">projectName,</if>
<if test="deptId != null">deptId,</if>
<if test="deptName != null">deptName,</if>
<if test="vendorsCode != null">vendors_code,</if>
<if test="serverid != null">serverid,</if>
<if test="workerId != null">workerId,</if>
<if test="workerName != null">workerName,</if>
<if test="identification != null">identification,</if>
<if test="workerPhoto != null">workerPhoto,</if>
<if test="workerGender != null">workerGender,</if>
<if test="birthDate != null">birthDate,</if>
<if test="ethnic != null">ethnic,</if>
<if test="nativePlace != null">nativePlace,</if>
<if test="phone != null">phone,</if>
<if test="workTypeName != null">workTypeName,</if>
<if test="specWorkType != null">specWorkType,</if>
<if test="groupName != null">groupName,</if>
<if test="companyTypeId != null">companyTypeId,</if>
<if test="companyName != null">companyName,</if>
<if test="attendanceTime != null">attendance_time,</if>
<if test="attendanceOutTime != null">attendance_out_time,</if>
<if test="scanPhoto != null">scanPhoto,</if>
<if test="teamId != null">teamId,</if>
<if test="workTypeCode != null">workTypeCode,</if>
<if test="companyId != null">companyId,</if>
<if test="vendorId != null">vendorId,</if>
<if test="deviceCode != null">device_code,</if>
<if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cfgid != null">#{cfgid},</if>
<if test="appId != null">#{appId},</if>
<if test="projectId != null">#{projectId},</if>
<if test="projectName != null">#{projectName},</if>
<if test="deptId != null">#{deptId},</if>
<if test="deptName != null">#{deptName},</if>
<if test="vendorsCode != null">#{vendorsCode},</if>
<if test="serverid != null">#{serverid},</if>
<if test="workerId != null">#{workerId},</if>
<if test="workerName != null">#{workerName},</if>
<if test="identification != null">#{identification},</if>
<if test="workerPhoto != null">#{workerPhoto},</if>
<if test="workerGender != null">#{workerGender},</if>
<if test="birthDate != null">#{birthDate},</if>
<if test="ethnic != null">#{ethnic},</if>
<if test="nativePlace != null">#{nativePlace},</if>
<if test="phone != null">#{phone},</if>
<if test="workTypeName != null">#{workTypeName},</if>
<if test="specWorkType != null">#{specWorkType},</if>
<if test="groupName != null">#{groupName},</if>
<if test="companyTypeId != null">#{companyTypeId},</if>
<if test="companyName != null">#{companyName},</if>
<if test="attendanceTime != null">#{attendanceTime},</if>
<if test="attendanceOutTime != null">#{attendanceOutTime},</if>
<if test="scanPhoto != null">#{scanPhoto},</if>
<if test="teamId != null">#{teamId},</if>
<if test="workTypeCode != null">#{workTypeCode},</if>
<if test="companyId != null">#{companyId},</if>
<if test="vendorId != null">#{vendorId},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSurProjectAttendanceData" parameterType="SurProjectAttendanceData">
update sur_project_attendance_data_${year}
<trim prefix="SET" suffixOverrides=",">
<if test="cfgid != null">cfgid = #{cfgid},</if>
<if test="appId != null">app_id = #{appId},</if>
<if test="projectId != null">projectId = #{projectId},</if>
<if test="projectName != null">projectName = #{projectName},</if>
<if test="deptId != null">deptId = #{deptId},</if>
<if test="deptName != null">deptName = #{deptName},</if>
<if test="vendorsCode != null">vendors_code = #{vendorsCode},</if>
<if test="serverid != null">serverid = #{serverid},</if>
<if test="workerId != null">workerId = #{workerId},</if>
<if test="workerName != null">workerName = #{workerName},</if>
<if test="identification != null">identification = #{identification},</if>
<if test="workerPhoto != null">workerPhoto = #{workerPhoto},</if>
<if test="workerGender != null">workerGender = #{workerGender},</if>
<if test="birthDate != null">birthDate = #{birthDate},</if>
<if test="ethnic != null">ethnic = #{ethnic},</if>
<if test="nativePlace != null">nativePlace = #{nativePlace},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="workTypeName != null">workTypeName = #{workTypeName},</if>
<if test="specWorkType != null">specWorkType = #{specWorkType},</if>
<if test="groupName != null">groupName = #{groupName},</if>
<if test="companyTypeId != null">companyTypeId = #{companyTypeId},</if>
<if test="companyName != null">companyName = #{companyName},</if>
<if test="attendanceTime != null">attendance_time = #{attendanceTime},</if>
<if test="attendanceOutTime != null">attendance_out_time = #{attendanceOutTime},</if>
<if test="scanPhoto != null">scanPhoto = #{scanPhoto},</if>
<if test="teamId != null">teamId = #{teamId},</if>
<if test="workTypeCode != null">workTypeCode = #{workTypeCode},</if>
<if test="companyId != null">companyId = #{companyId},</if>
<if test="vendorId != null">vendorId = #{vendorId},</if>
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSurProjectAttendanceDataById" parameterType="Long">
delete from sur_project_attendance_data_${year} where id = #{id}
</delete>
<delete id="deleteSurProjectAttendanceDataByIds" parameterType="String">
delete from sur_project_attendance_data_${year} where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteSurProjectAttendanceDataByParams" parameterType="String">
delete from sur_project_attendance_data_${year} where CONCAT(app_id,'-',serverid,'-',workerId) in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</delete>
<insert id="batchSurProjectAttendanceData">
insert into sur_project_attendance_data_${year}( id, cfgid, app_id, projectId, projectName, deptId, deptName, vendors_code, serverid, workerId, workerName, identification, workerPhoto, workerGender, birthDate, ethnic, nativePlace, phone, workTypeName, specWorkType, groupName, companyTypeId,
companyName, attendance_time, attendance_out_time, scanPhoto, teamId,workTypeCode, companyId, vendorId, device_code, is_del, create_by, create_time, update_by, update_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.cfgid},#{item.appId}, #{item.projectId}, #{item.projectName}, #{item.deptId}, #{item.deptName}, #{item.vendorsCode}, #{item.serverid}, #{item.workerId}, #{item.workerName}, #{item.identification},#{item.workerPhoto}, #{item.workerGender}, #{item.birthDate},#{item.ethnic}, #{item.nativePlace}, #{item.phone}, #{item.workTypeName}, #{item.specWorkType}, #{item.groupName}, #{item.companyTypeId},
#{item.companyName}, #{item.attendanceTime}, #{item.attendanceOutTime}, #{item.scanPhoto},#{item.teamId}, #{item.workTypeCode}, #{item.companyId}, #{item.vendorId}, #{item.deviceCode},#{item.isDel}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
</foreach>
</insert>
<select id="getLastServerId" parameterType="SurProjectAttendanceData" resultType="Long">
SELECT IF(MAX(serverid+0),MAX(serverid+0),0) serverid FROM sur_project_attendance_data_${year} WHERE cfgid=#{cfgid}
</select>
<select id="groupByComanyOld" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select companyTypeId,count(1) id from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x2 where id in (
select min(id) from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x1
where date(attendance_time)=#{attendanceTime}
<if test="subDeptId!=null and subDeptId>0"> and project_id in (
SELECT id FROM pro_project_info WHERE is_del=0 AND deptid = #{subDeptId}
)
</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="projectId!=null and projectId>0"> and project_id=#{projectId}</if>
group by workerId )
and companyTypeId in (1,2,3,4,5,6,8) group by companyTypeId
</select>
<select id="groupByComany" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select g.companyTypeId,count(1) id from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE()
and cfgid in (select id from attendance_cfg
<where>
<if test="projectId!=null and projectId>0">
and project_id=#{projectId}
</if>
<if test="subDeptId!=null and subDeptId>0">
and project_id in (SELECT id FROM pro_project_info WHERE dis_dept_id=#{subDeptId})
</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
)
)
and g.companyTypeId in (1,2,3,4,5,6,8)
<if test="projectId!=null and projectId>0">
and c.project_id=#{projectId}
</if>
<if test="subDeptId!=null and subDeptId>0">
and c.project_id in (SELECT id FROM pro_project_info WHERE dis_dept_id=#{subDeptId})
</if>
<if test="prjIds !=null and prjIds.size()>0">
and c.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by g.companyTypeId
</select>
<select id="groupAllByComany" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select g.companyTypeId,count(1) id
from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g,
pro_project_info sp
where u.cfgid=c.id and u.companyId=g.companyId and u.state=#{id} and c.project_id = sp.id
and sp.is_Del=0
and g.companyTypeId in (0,1,2,3,4,5,6,8)
<if test="projectId!=null and projectId>0">
and c.project_id=#{projectId}
</if>
<if test="subDeptId!=null and subDeptId>0">
and sp.dis_dept_id=#{subDeptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.project_Type = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and c.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by g.companyTypeId
</select>
<select id="getHuazhuPage" parameterType="SurProjectAttendanceData" resultType="Long">
select max(vendorId) vendorId from sur_project_attendance_data_${year} WHERE cfgid=#{id}
</select>
<select id="initOtherData" parameterType="map" resultType="map">
select d.workerId,d.app_id,d.serverid,u.companyId,u.companyName,u.`name`,d.identification,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
u.workTypeName,u.specWorkType,u.groupName,g.companyTypeId,d.teamId,u.workTypeCode,d.vendorId,d.device_code,d.scanPhoto,d.is_del
from sur_project_attendance_data d
left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid
left join sur_project_attendance_group g on u.companyId = g.companyId and g.cfgid = u.cfgid
where d.cfgid=#{cfgid} and date(d.attendance_time) = #{date}
GROUP BY d.workerId
</select>
<select id="initHuaZhuData" parameterType="map" resultType="map">
select d.workerId,d.app_id,d.serverid,u.companyId,u.companyName,u.`name`,d.identification,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
u.workTypeName,u.specWorkType,u.groupName,d.teamId,u.workTypeCode,d.vendorId,d.device_code,d.scanPhoto,d.is_del,
CASE WHEN sd.type_flag = 2 THEN '1' WHEN sd.type_flag = 3 THEN '2' WHEN sd.type_flag = 4 THEN '8' else '0' end as companyTypeId
from sur_project_attendance_data d
left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid
left join sys_dept sd on u.companyName = sd.dept_name
where d.cfgid=#{cfgid} and date(d.attendance_time) = #{date}
GROUP BY d.workerId
</select>
<select id="findHuaZhuCompanyType" parameterType="string" resultType="string">
select CASE WHEN sd.type_flag = 2 THEN '1' WHEN sd.type_flag = 3 THEN '2' WHEN sd.type_flag = 4 THEN '8' else '0' end as companyTypeId
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 attendance_cfg where projectId = #{projectId}
<if test="deptId != null "> and sub_dept_id = #{deptId}</if>
)</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 &lt;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_${year}
<where>
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
<if test="projectId != null ">and cfgid in (select id from attendance_cfg where projectId = #{projectId}
<if test="deptId != null "> and sub_dept_id = #{deptId}</if>
)</if>
<if test="attendanceTime!=null or attendanceOutTime!=null">
<if test="attendanceTime!=null and attendanceOutTime!=null">
AND (date(attendance_time) &gt;= date(#{attendanceTime}) or date(attendance_out_time) &gt;= date(#{attendanceTime}))
AND (date(attendance_time) &lt;= date(#{attendanceOutTime}) or date(attendance_out_time) &lt;= date(#{attendanceOutTime}))
</if>
<if test="attendanceTime==null and attendanceOutTime!=null">
AND (date(attendance_time) &lt;= date(#{attendanceOutTime}) or date(attendance_out_time) &lt;= date(#{attendanceOutTime}))
</if>
<if test="attendanceTime!=null and attendanceOutTime==null">
AND (date(attendance_time) &gt;= date(#{attendanceTime}) or date(attendance_out_time) &gt;= date(#{attendanceTime}))
</if>
</if>
</where>
)
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 pro_project_info sp on sp.id = ady.projectId
where sp.is_Del=0
<if test="projectId!=null and projectId>0">
and ady.projectId=#{projectId}
</if>
<if test="id==1">
and ady.companyTypeId in (1,6)
</if>
<if test="id==2">
and ady.companyTypeId in (0,2,3,4,5)
</if>
<if test="id==8">
and ady.companyTypeId =8
</if>
<if test="deptId!=null and deptId>0">
and sp.dis_dept_id=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.project_Type = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and ady.projectId in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) =date(#{attendanceTime})</if>
</select>
<select id="attendanceDataList" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select ady.* from sur_project_attendance_data_${year} ady
where ady.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
<if test="companyTypeId==101">
and ady.companyTypeId in (1,6)
</if>
<if test="companyTypeId==103">
and ady.companyTypeId in (0,2,3,4,5)
</if>
<if test="companyTypeId==102">
and ady.companyTypeId =8
</if>
<if test="workerId != null and workerId != ''"> and ady.workerId = #{workerId}</if>
<if test="workerName != null and workerName != ''"> and ady.workerName like concat('%', #{workerName}, '%')</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) = date(#{attendanceTime})</if>
and ady.is_del=0
order by ady.id desc
</select>
<select id="groupTodayCompanyTypeId" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select ady.companyTypeId,count(1) id from sur_project_attendance_data_${year} ady
where ady.cfgid in (select id from attendance_cfg where
is_del=0
<if test="projectId!=null and projectId>0">
and projectId=#{projectId}
</if>
and projectId in (select id from pro_project_info sp where sp.is_Del=0
<if test="deptId!=null and deptId>0">
and sp.dis_dept_id=#{deptId}
</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) =date(#{attendanceTime})</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and ady.projectId in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
)
)
group by ady.companyTypeId
</select>
<select id="findGroupAllByParams" parameterType="SurProjectAttendanceData" resultType="Map">
select '1' as type,g.companyTypeId,count(1) as total
from sur_project_attendance_user u
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
and g.companyTypeId in (0,1,2,3,4,5,6,8)
and u.state=0
group by g.companyTypeId
UNION ALL
select '2' as type,g.companyTypeId,count(1) as total
from sur_project_attendance_user u
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
and g.companyTypeId in (0,1,2,3,4,5,6,8)
and u.state=1
group by g.companyTypeId
UNION ALL
select '3' as type, d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d
where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
and d.is_del=0
and date(d.attendance_time) = date(now())
group by d.companyTypeId
</select>
<select id="groupDataByParams" parameterType="SurProjectAttendanceData" resultType="Map">
select d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d
where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
and d.is_del=0
<if test="attendanceTime != null and attendanceTime != ''"> and date(d.attendance_time) = date(#{attendanceTime})</if>
<if test="workerName != null and workerName != ''"> and d.workerName like concat('%', #{workerName}, '%')</if>
group by d.companyTypeId
</select>
<select id="findGroupAllByDays" parameterType="SurProjectAttendanceData" resultType="Map">
select '3' as type, DATE_FORMAT(days.attendanceTime, '%m-%d') as attendanceTime,days.total from(
select date(d.attendance_time) as attendanceTime, DATE_FORMAT(d.attendance_time, '%m-%d'),count(1) as total from sur_project_attendance_data_${year} d
where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
and d.is_del=0
and date(d.attendance_time) between #{attendanceTime} and #{attendanceOutTime}
group by date(d.attendance_time)
order by date(d.attendance_time)
)days
</select>
</mapper>

View File

@ -0,0 +1,233 @@
<?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.yanzhu.manage.mapper.SurProjectAttendanceGroupMapper">
<resultMap type="SurProjectAttendanceGroup" id="SurProjectAttendanceGroupResult">
<result property="id" column="id" />
<result property="cfgid" column="cfgid" />
<result property="appId" column="app_id" />
<result property="serverid" column="serverid" />
<result property="bizLicense" column="bizLicense" />
<result property="companyCode" column="companyCode" />
<result property="companyId" column="companyId" />
<result property="companyName" column="companyName" />
<result property="companyTypeId" column="companyTypeId" />
<result property="vendorId" column="vendorId" />
<result property="name" column="name" />
<result property="leaderName" column="leaderName" />
<result property="leaderPhone" column="leaderPhone" />
<result property="teamId" column="teamId" />
<result property="teamName" column="teamName" />
<result property="type" column="type" />
<result property="leaderId" column="leaderId" />
<result property="deleted" column="deleted" />
<result property="createTimestamp" column="createTimestamp" />
<result property="platformGroupId" column="platformGroupId" />
<result property="platformTeamId" column="platformTeamId" />
<result property="enterDate" column="enterDate" />
<result property="exitDate" column="exitDate" />
<result property="remark" column="remark" />
<result property="isDel" column="is_del" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectSurProjectAttendanceGroupVo">
select id, cfgid, app_id, serverid, bizLicense, companyCode, companyId, companyName, companyTypeId, vendorId, name, leaderName, leaderPhone, teamId, teamName, type, leaderId, deleted, createTimestamp, platformGroupId, platformTeamId, enterDate, exitDate, remark, is_del, create_by, create_time, update_by, update_time
from view_sur_project_attendance_group
</sql>
<select id="selectSurProjectAttendanceGroupViewList" parameterType="SurProjectAttendanceGroup" resultMap="SurProjectAttendanceGroupResult">
<include refid="selectSurProjectAttendanceGroupVo"/>
<where>
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
<if test="appId != null "> and app_id = #{appId}</if>
<if test="serverid != null "> and serverid = #{serverid}</if>
<if test="bizLicense != null and bizLicense != ''"> and bizLicense = #{bizLicense}</if>
<if test="companyCode != null and companyCode != ''"> and companyCode = #{companyCode}</if>
<if test="companyId != null "> and companyId = #{companyId}</if>
<if test="companyName != null and companyName != ''"> and companyName like concat('%', #{companyName}, '%')</if>
<if test="companyTypeId != null and companyTypeId != ''"> and companyTypeId = #{companyTypeId}</if>
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="leaderName != null and leaderName != ''"> and leaderName like concat('%', #{leaderName}, '%')</if>
<if test="leaderPhone != null and leaderPhone != ''"> and leaderPhone = #{leaderPhone}</if>
<if test="teamId != null "> and teamId = #{teamId}</if>
<if test="teamName != null and teamName != ''"> and teamName like concat('%', #{teamName}, '%')</if>
<if test="type != null "> and type = #{type}</if>
<if test="leaderId != null "> and leaderId = #{leaderId}</if>
<if test="deleted != null "> and deleted = #{deleted}</if>
<if test="createTime != null "> and createTime = #{createTime}</if>
<if test="platformGroupId != null "> and platformGroupId = #{platformGroupId}</if>
<if test="platformTeamId != null "> and platformTeamId = #{platformTeamId}</if>
<if test="enterDate != null "> and enterDate = #{enterDate}</if>
<if test="exitDate != null "> and exitDate = #{exitDate}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectSurProjectAttendanceGroupList" parameterType="SurProjectAttendanceGroup" resultMap="SurProjectAttendanceGroupResult">
select id, cfgid, app_id, serverid, bizLicense, companyCode, companyId, companyName, companyTypeId, vendorId, name, leaderName, leaderPhone, teamId, teamName, type, leaderId, deleted, createTimestamp, platformGroupId, platformTeamId, enterDate, exitDate, remark, is_del, create_by, create_time, update_by, update_time
from sur_project_attendance_group
<where>
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
<if test="appId != null "> and app_id = #{appId}</if>
<if test="serverid != null "> and serverid = #{serverid}</if>
<if test="bizLicense != null and bizLicense != ''"> and bizLicense = #{bizLicense}</if>
<if test="companyCode != null and companyCode != ''"> and companyCode = #{companyCode}</if>
<if test="companyId != null "> and companyId = #{companyId}</if>
<if test="companyName != null and companyName != ''"> and companyName like concat('%', #{companyName}, '%')</if>
<if test="companyTypeId != null and companyTypeId != ''"> and companyTypeId = #{companyTypeId}</if>
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="leaderName != null and leaderName != ''"> and leaderName like concat('%', #{leaderName}, '%')</if>
<if test="leaderPhone != null and leaderPhone != ''"> and leaderPhone = #{leaderPhone}</if>
<if test="teamId != null "> and teamId = #{teamId}</if>
<if test="teamName != null and teamName != ''"> and teamName like concat('%', #{teamName}, '%')</if>
<if test="type != null "> and type = #{type}</if>
<if test="leaderId != null "> and leaderId = #{leaderId}</if>
<if test="deleted != null "> and deleted = #{deleted}</if>
<if test="createTime != null "> and createTime = #{createTime}</if>
<if test="platformGroupId != null "> and platformGroupId = #{platformGroupId}</if>
<if test="platformTeamId != null "> and platformTeamId = #{platformTeamId}</if>
<if test="enterDate != null "> and enterDate = #{enterDate}</if>
<if test="exitDate != null "> and exitDate = #{exitDate}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectSurProjectAttendanceGroupById" parameterType="Long" resultMap="SurProjectAttendanceGroupResult">
<include refid="selectSurProjectAttendanceGroupVo"/>
where id = #{id}
</select>
<insert id="insertSurProjectAttendanceGroup" parameterType="SurProjectAttendanceGroup" useGeneratedKeys="true" keyProperty="id">
insert into sur_project_attendance_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cfgid != null">cfgid,</if>
<if test="appId != null">app_id,</if>
<if test="serverid != null">serverid,</if>
<if test="bizLicense != null">bizLicense,</if>
<if test="companyCode != null">companyCode,</if>
<if test="companyId != null">companyId,</if>
<if test="companyName != null">companyName,</if>
<if test="companyTypeId != null">companyTypeId,</if>
<if test="vendorId != null">vendorId,</if>
<if test="name != null">name,</if>
<if test="leaderName != null">leaderName,</if>
<if test="leaderPhone != null">leaderPhone,</if>
<if test="teamId != null">teamId,</if>
<if test="teamName != null">teamName,</if>
<if test="type != null">type,</if>
<if test="leaderId != null">leaderId,</if>
<if test="deleted != null">deleted,</if>
<if test="createTimestamp != null">createTimestamp,</if>
<if test="platformGroupId != null">platformGroupId,</if>
<if test="platformTeamId != null">platformTeamId,</if>
<if test="enterDate != null">enterDate,</if>
<if test="exitDate != null">exitDate,</if>
<if test="remark != null">remark,</if>
<if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cfgid != null">#{cfgid},</if>
<if test="appId != null">#{appId},</if>
<if test="serverid != null">#{serverid},</if>
<if test="bizLicense != null">#{bizLicense},</if>
<if test="companyCode != null">#{companyCode},</if>
<if test="companyId != null">#{companyId},</if>
<if test="companyName != null">#{companyName},</if>
<if test="companyTypeId != null">#{companyTypeId},</if>
<if test="vendorId != null">#{vendorId},</if>
<if test="name != null">#{name},</if>
<if test="leaderName != null">#{leaderName},</if>
<if test="leaderPhone != null">#{leaderPhone},</if>
<if test="teamId != null">#{teamId},</if>
<if test="teamName != null">#{teamName},</if>
<if test="type != null">#{type},</if>
<if test="leaderId != null">#{leaderId},</if>
<if test="deleted != null">#{deleted},</if>
<if test="createTimestamp != null">#{createTimestamp},</if>
<if test="platformGroupId != null">#{platformGroupId},</if>
<if test="platformTeamId != null">#{platformTeamId},</if>
<if test="enterDate != null">#{enterDate},</if>
<if test="exitDate != null">#{exitDate},</if>
<if test="remark != null">#{remark},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateSurProjectAttendanceGroup" parameterType="SurProjectAttendanceGroup">
update sur_project_attendance_group
<trim prefix="SET" suffixOverrides=",">
<if test="cfgid != null">cfgid = #{cfgid},</if>
<if test="appId != null">app_id = #{appId},</if>
<if test="serverid != null">serverid = #{serverid},</if>
<if test="bizLicense != null">bizLicense = #{bizLicense},</if>
<if test="companyCode != null">companyCode = #{companyCode},</if>
<if test="companyId != null">companyId = #{companyId},</if>
<if test="companyName != null">companyName = #{companyName},</if>
<if test="companyTypeId != null">companyTypeId = #{companyTypeId},</if>
<if test="vendorId != null">vendorId = #{vendorId},</if>
<if test="name != null">name = #{name},</if>
<if test="leaderName != null">leaderName = #{leaderName},</if>
<if test="leaderPhone != null">leaderPhone = #{leaderPhone},</if>
<if test="teamId != null">teamId = #{teamId},</if>
<if test="teamName != null">teamName = #{teamName},</if>
<if test="type != null">type = #{type},</if>
<if test="leaderId != null">leaderId = #{leaderId},</if>
<if test="deleted != null">deleted = #{deleted},</if>
<if test="createTimestamp != null">createTimestamp = #{createTimestamp},</if>
<if test="platformGroupId != null">platformGroupId = #{platformGroupId},</if>
<if test="platformTeamId != null">platformTeamId = #{platformTeamId},</if>
<if test="enterDate != null">enterDate = #{enterDate},</if>
<if test="exitDate != null">exitDate = #{exitDate},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSurProjectAttendanceGroupById" parameterType="Long">
delete from sur_project_attendance_group where id = #{id}
</delete>
<delete id="deleteSurProjectAttendanceGroupByIds" parameterType="String">
delete from sur_project_attendance_group where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteSurProjectAttendanceGroupByParams" parameterType="String">
delete from sur_project_attendance_group where CONCAT(app_id,'-',serverid) in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</delete>
<insert id="batchSurProjectAttendanceGroup">
insert into sur_project_attendance_group(id,cfgid,app_id,serverid,bizLicense,companyCode,companyId,companyName,companyTypeId,vendorId,name,leaderName,leaderPhone,teamId,teamName,type,leaderId,deleted,createTimestamp,platformGroupId,platformTeamId,enterDate,exitDate,remark,create_by,create_time,update_by,update_time) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.id}, #{item.cfgid}, #{item.appId}, #{item.serverid}, #{item.bizLicense}, #{item.companyCode}, #{item.companyId}, #{item.companyName},#{item.companyTypeId}, #{item.vendorId}, #{item.name}, #{item.leaderName}, #{item.leaderPhone}, #{item.teamId}, #{item.teamName}, #{item.type}, #{item.leaderId}, #{item.deleted}, #{item.createTimestamp}, #{item.platformGroupId}, #{item.platformTeamId}, #{item.enterDate},
#{item.exitDate}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,812 @@
<?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.yanzhu.manage.mapper.SurProjectAttendanceUserMapper">
<resultMap type="SurProjectAttendanceUser" id="SurProjectAttendanceUserResult">
<result property="id" column="id" />
<result property="cfgid" column="cfgid" />
<result property="appId" column="app_id" />
<result property="vendorsCode" column="vendors_code" />
<result property="workerId" column="workerId" />
<result property="laborWorkerId" column="laborWorkerId" />
<result property="workerCategory" column="workerCategory" />
<result property="qrCode" column="qrCode" />
<result property="name" column="name" />
<result property="ethnic" column="ethnic" />
<result property="nativePlace" column="nativePlace" />
<result property="gender" column="gender" />
<result property="birthDate" column="birthDate" />
<result property="phone" column="phone" />
<result property="degreeName" column="degreeName" />
<result property="photo" column="photo" />
<result property="recentPhoto" column="recentPhoto" />
<result property="groupId" column="groupId" />
<result property="groupName" column="groupName" />
<result property="leader" column="leader" />
<result property="workTypeCode" column="workTypeCode" />
<result property="workTypeName" column="workTypeName" />
<result property="specWorkType" column="specWorkType" />
<result property="hatCode" column="hatCode" />
<result property="state" column="state" />
<result property="enterDate" column="enterDate" />
<result property="exitDate" column="exitDate" />
<result property="companyId" column="companyId" />
<result property="companyName" column="companyName" />
<result property="vendorId" column="vendorId" />
<result property="teamId" column="teamId" />
<result property="teamName" column="teamName" />
<result property="enterType" column="enterType" />
<result property="other" column="other" />
<result property="remark" column="remark" />
<result property="isDel" column="is_del" />
<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="projectId" column="project_id"/>
<result property="subDeptId" column="sub_dept_id"/>
<result property="companyTypeId" column="companyTypeId"/>
</resultMap>
<sql id="selectSurProjectAttendanceUserVo">
SELECT * FROM (
SELECT a.*,b.project_id,b.sub_dept_id
FROM sur_project_attendance_user a,attendance_cfg b
WHERE a.cfgid=b.id )
sur_project_attendance_user
</sql>
<select id="selectSurProjectAttendanceUserListJgw" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.degreeName,u.photo,u.recentPhoto,
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
c.project_id,c.sub_dept_id,u.companyName,u.workTypeName,g.teamname groupName,g.companyName remark
FROM sur_project_attendance_user u,attendance_cfg c,sur_project_attendance_group g
WHERE u.cfgid=c.id AND g.companyid=u.companyid AND u.vendors_code='jgw'
<if test="companyTypeId!=null">
<if test="companyTypeId>100">
<if test="companyTypeId==101">
and g.companyTypeId in (1,6)
</if>
<if test="companyTypeId==102">
and g.companyTypeId =8
</if>
<if test="companyTypeId==103">
and g.companyTypeId in (0,2,3,4,5)
</if>
</if>
<if test="companyTypeId &lt;100">
and g.companyTypeId=#{companyTypeId}
</if>
</if>
<if test="cfgid != null "> and u.cfgid = #{cfgid}</if>
<if test="appId != null "> and u.app_id = #{appId}</if>
<if test="vendorsCode != null and vendorsCode != ''"> and u.vendors_code = #{vendorsCode}</if>
<if test="workerId != null "> and u.workerId = #{workerId}</if>
<if test="laborWorkerId != null "> and u.laborWorkerId = #{laborWorkerId}</if>
<if test="workerCategory != null "> and u.workerCategory = #{workerCategory}</if>
<if test="qrCode != null "> and u.qrCode = #{qrCode}</if>
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
<if test="ethnic != null and ethnic != ''"> and u.ethnic = #{ethnic}</if>
<if test="nativePlace != null and nativePlace != ''"> and u.nativePlace = #{nativePlace}</if>
<if test="gender != null "> and u.gender = #{gender}</if>
<if test="birthDate != null "> and u.birthDate = #{birthDate}</if>
<if test="phone != null and phone != ''"> and u.phone = #{phone}</if>
<if test="degreeName != null and degreeName != ''"> and u.degreeName like concat('%', #{degreeName}, '%')</if>
<if test="photo != null and photo != ''"> and u.photo = #{photo}</if>
<if test="recentPhoto != null and recentPhoto != ''"> and u.recentPhoto = #{recentPhoto}</if>
<if test="groupId != null "> and u.groupId = #{groupId}</if>
<if test="groupName != null and groupName != ''"> and u.groupName like concat('%', #{groupName}, '%')</if>
<if test="leader != null "> and u.leader = #{leader}</if>
<if test="workTypeCode != null and workTypeCode != ''"> and u.workTypeCode = #{workTypeCode}</if>
<if test="workTypeName != null and workTypeName != ''"> and u.workTypeName like concat('%', #{workTypeName}, '%')</if>
<if test="specWorkType != null "> and u.specWorkType = #{specWorkType}</if>
<if test="hatCode != null and hatCode != ''"> and u.hatCode = #{hatCode}</if>
<if test="state != null "> and u.state = #{state}</if>
<if test="enterDate != null and enterDate != ''"> and u.enterDate = #{enterDate}</if>
<if test="exitDate != null and exitDate != ''"> and u.exitDate = #{exitDate}</if>
<if test="companyId != null "> and u.companyId = #{companyId}</if>
<if test="companyName != null and companyName != ''"> and u.companyName like concat('%', #{companyName}, '%')</if>
<if test="vendorId != null "> and u.vendorId = #{vendorId}</if>
<if test="teamId != null "> and u.teamId = #{teamId}</if>
<if test="teamName != null and teamName != ''"> and u.teamName like concat('%', #{teamName}, '%')</if>
<if test="enterType != null and enterType != ''"> and u.enterType = #{enterType}</if>
<if test="other != null and other != ''"> and u.other = #{other}</if>
<if test="projectId != null and projectId > 0 "> and c.project_id = #{projectId}</if>
<if test="subDeptId != null and subDeptId >0 "> and c.sub_dept_id = #{subDeptId}</if>
<if test="isDel != null "> and u.is_del = #{isDel}</if>
</select>
<select id="querySurProjectAttendanceUserList" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
SELECT * FROM (
SELECT a.id,
a.cfgid,
a.app_id,
a.vendors_code,
a.workerId,
a.laborWorkerId,
a.workerCategory,
a.qrCode,
a.name,
a.ethnic,
a.nativePlace,
a.gender,
a.birthDate,
a.phone,
a.degreeName,
a.photo,
a.recentPhoto,
a.groupId,
a.groupName,
a.leader,
a.workTypeCode,
a.workTypeName,
a.specWorkType,
a.hatCode,
a.state,
a.enterDate,
a.exitDate,
a.companyId,
a.companyName,
a.vendorId,
a.teamId,
a.teamName,
a.enterType,
a.other,
a.is_del,
a.create_by,
a.create_time,
a.update_by,
a.update_time,b.project_id,b.sub_dept_id,g.companyTypeId,g.companyName as remark
FROM sur_project_attendance_user a,attendance_cfg b,view_sur_project_attendance_group g
WHERE a.cfgid=b.id and a.companyId=g.companyId and g.id in(select min(id) from view_sur_project_attendance_group group by companyid)
)
sur_project_attendance_user
<where>
<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 &lt;100">
and companyTypeId=#{companyTypeId}
</if>
</if>
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
<if test="appId != null "> and app_id = #{appId}</if>
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
<if test="workerId != null "> and workerId = #{workerId}</if>
<if test="laborWorkerId != null "> and laborWorkerId = #{laborWorkerId}</if>
<if test="workerCategory != null "> and workerCategory = #{workerCategory}</if>
<if test="qrCode != null "> and qrCode = #{qrCode}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="ethnic != null and ethnic != ''"> and ethnic = #{ethnic}</if>
<if test="nativePlace != null and nativePlace != ''"> and nativePlace = #{nativePlace}</if>
<if test="gender != null "> and gender = #{gender}</if>
<if test="birthDate != null "> and birthDate = #{birthDate}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="degreeName != null and degreeName != ''"> and degreeName like concat('%', #{degreeName}, '%')</if>
<if test="photo != null and photo != ''"> and photo = #{photo}</if>
<if test="recentPhoto != null and recentPhoto != ''"> and recentPhoto = #{recentPhoto}</if>
<if test="groupId != null "> and groupId = #{groupId}</if>
<if test="groupName != null and groupName != ''"> and groupName like concat('%', #{groupName}, '%')</if>
<if test="leader != null "> and leader = #{leader}</if>
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
<if test="workTypeName != null and workTypeName != ''"> and workTypeName like concat('%', #{workTypeName}, '%')</if>
<if test="specWorkType != null "> and specWorkType = #{specWorkType}</if>
<if test="hatCode != null and hatCode != ''"> and hatCode = #{hatCode}</if>
<if test="state != null "> and state = #{state}</if>
<if test="enterDate != null and enterDate != ''"> and enterDate = #{enterDate}</if>
<if test="exitDate != null and exitDate != ''"> and exitDate = #{exitDate}</if>
<if test="companyId != null "> and companyId = #{companyId}</if>
<if test="companyName != null and companyName != ''"> and companyName like concat('%', #{companyName}, '%')</if>
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
<if test="teamId != null "> and teamId = #{teamId}</if>
<if test="teamName != null and teamName != ''"> and teamName like concat('%', #{teamName}, '%')</if>
<if test="enterType != null and enterType != ''"> and enterType = #{enterType}</if>
<if test="other != null and other != ''"> and other = #{other}</if>
<if test="projectId != null and projectId > 0 "> and project_id = #{projectId}</if>
<if test="subDeptId != null and subDeptId >0 "> and sub_dept_id = #{subDeptId}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectSurProjectAttendanceUserList" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
<include refid="selectSurProjectAttendanceUserVo"/>
<where>
<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 &lt;100">
and companyTypeId=#{companyTypeId}
</if>
</if>
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
<if test="appId != null "> and app_id = #{appId}</if>
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
<if test="workerId != null "> and workerId = #{workerId}</if>
<if test="laborWorkerId != null "> and laborWorkerId = #{laborWorkerId}</if>
<if test="workerCategory != null "> and workerCategory = #{workerCategory}</if>
<if test="qrCode != null "> and qrCode = #{qrCode}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="ethnic != null and ethnic != ''"> and ethnic = #{ethnic}</if>
<if test="nativePlace != null and nativePlace != ''"> and nativePlace = #{nativePlace}</if>
<if test="gender != null "> and gender = #{gender}</if>
<if test="birthDate != null "> and birthDate = #{birthDate}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="degreeName != null and degreeName != ''"> and degreeName like concat('%', #{degreeName}, '%')</if>
<if test="photo != null and photo != ''"> and photo = #{photo}</if>
<if test="recentPhoto != null and recentPhoto != ''"> and recentPhoto = #{recentPhoto}</if>
<if test="groupId != null "> and groupId = #{groupId}</if>
<if test="groupName != null and groupName != ''"> and groupName like concat('%', #{groupName}, '%')</if>
<if test="leader != null "> and leader = #{leader}</if>
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
<if test="workTypeName != null and workTypeName != ''"> and workTypeName like concat('%', #{workTypeName}, '%')</if>
<if test="specWorkType != null "> and specWorkType = #{specWorkType}</if>
<if test="hatCode != null and hatCode != ''"> and hatCode = #{hatCode}</if>
<if test="state != null "> and state = #{state}</if>
<if test="enterDate != null and enterDate != ''"> and enterDate = #{enterDate}</if>
<if test="exitDate != null and exitDate != ''"> and exitDate = #{exitDate}</if>
<if test="companyId != null "> and companyId = #{companyId}</if>
<if test="companyName != null and companyName != ''"> and companyName like concat('%', #{companyName}, '%')</if>
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
<if test="teamId != null "> and teamId = #{teamId}</if>
<if test="teamName != null and teamName != ''"> and teamName like concat('%', #{teamName}, '%')</if>
<if test="enterType != null and enterType != ''"> and enterType = #{enterType}</if>
<if test="other != null and other != ''"> and other = #{other}</if>
<if test="projectId != null and projectId > 0 "> and project_id = #{projectId}</if>
<if test="subDeptId != null and subDeptId >0 "> and sub_dept_id = #{subDeptId}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectSurProjectAttendanceUserById" parameterType="Long" resultMap="SurProjectAttendanceUserResult">
<include refid="selectSurProjectAttendanceUserVo"/>
where id = #{id}
</select>
<select id="findCurrentAttendanceUser" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
select u.companyId,u.companyName,u.`name`,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
u.workTypeName,u.specWorkType,u.groupName,g.companyTypeId,u.workTypeCode
from sur_project_attendance_user u
left join sur_project_attendance_group g on u.companyId = g.companyId and g.cfgid = u.cfgid
where u.cfgid=#{cfgid} and u.workerId=#{workerId}
</select>
<select id="findYzCurrentAttendanceUser" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
select u.companyId,g.companyName,u.`name`,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
u.workTypeName,u.specWorkType,u.groupName,g.companyTypeId,u.workTypeCode
from sur_project_attendance_user u
left join sur_project_attendance_group g on u.groupId = g.serverid and g.cfgid = u.cfgid
where u.cfgid=#{cfgid} and u.workerId=#{workerId} ORDER BY u.id desc LIMIT 1
</select>
<insert id="insertSurProjectAttendanceUser" parameterType="SurProjectAttendanceUser" useGeneratedKeys="true" keyProperty="id">
insert into sur_project_attendance_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cfgid != null">cfgid,</if>
<if test="appId != null">app_id,</if>
<if test="vendorsCode != null">vendors_code,</if>
<if test="workerId != null">workerId,</if>
<if test="laborWorkerId != null">laborWorkerId,</if>
<if test="workerCategory != null">workerCategory,</if>
<if test="qrCode != null">qrCode,</if>
<if test="name != null">name,</if>
<if test="ethnic != null">ethnic,</if>
<if test="nativePlace != null">nativePlace,</if>
<if test="gender != null">gender,</if>
<if test="birthDate != null">birthDate,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="degreeName != null">degreeName,</if>
<if test="photo != null">photo,</if>
<if test="recentPhoto != null">recentPhoto,</if>
<if test="groupId != null">groupId,</if>
<if test="groupName != null">groupName,</if>
<if test="leader != null">leader,</if>
<if test="workTypeCode != null">workTypeCode,</if>
<if test="workTypeName != null">workTypeName,</if>
<if test="specWorkType != null">specWorkType,</if>
<if test="hatCode != null">hatCode,</if>
<if test="state != null">state,</if>
<if test="enterDate != null">enterDate,</if>
<if test="exitDate != null">exitDate,</if>
<if test="companyId != null">companyId,</if>
<if test="companyName != null">companyName,</if>
<if test="vendorId != null">vendorId,</if>
<if test="teamId != null">teamId,</if>
<if test="teamName != null">teamName,</if>
<if test="enterType != null">enterType,</if>
<if test="other != null and other != ''">other,</if>
<if test="remark != null">remark,</if>
<if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cfgid != null">#{cfgid},</if>
<if test="appId != null">#{appId},</if>
<if test="vendorsCode != null">#{vendorsCode},</if>
<if test="workerId != null">#{workerId},</if>
<if test="laborWorkerId != null">#{laborWorkerId},</if>
<if test="workerCategory != null">#{workerCategory},</if>
<if test="qrCode != null">#{qrCode},</if>
<if test="name != null">#{name},</if>
<if test="ethnic != null">#{ethnic},</if>
<if test="nativePlace != null">#{nativePlace},</if>
<if test="gender != null">#{gender},</if>
<if test="birthDate != null">#{birthDate},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="degreeName != null">#{degreeName},</if>
<if test="photo != null">#{photo},</if>
<if test="recentPhoto != null">#{recentPhoto},</if>
<if test="groupId != null">#{groupId},</if>
<if test="groupName != null">#{groupName},</if>
<if test="leader != null">#{leader},</if>
<if test="workTypeCode != null">#{workTypeCode},</if>
<if test="workTypeName != null">#{workTypeName},</if>
<if test="specWorkType != null">#{specWorkType},</if>
<if test="hatCode != null">#{hatCode},</if>
<if test="state != null">#{state},</if>
<if test="enterDate != null">#{enterDate},</if>
<if test="exitDate != null">#{exitDate},</if>
<if test="companyId != null">#{companyId},</if>
<if test="companyName != null">#{companyName},</if>
<if test="vendorId != null">#{vendorId},</if>
<if test="teamId != null">#{teamId},</if>
<if test="teamName != null">#{teamName},</if>
<if test="enterType != null">#{enterType},</if>
<if test="other != null and other != ''">#{other},</if>
<if test="remark != null">#{remark},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateSurProjectAttendanceUser" parameterType="SurProjectAttendanceUser">
update sur_project_attendance_user
<trim prefix="SET" suffixOverrides=",">
<if test="cfgid != null">cfgid = #{cfgid},</if>
<if test="appId != null">app_id = #{appId},</if>
<if test="vendorsCode != null">vendors_code = #{vendorsCode},</if>
<if test="workerId != null">workerId = #{workerId},</if>
<if test="laborWorkerId != null">laborWorkerId = #{laborWorkerId},</if>
<if test="workerCategory != null">workerCategory = #{workerCategory},</if>
<if test="qrCode != null">qrCode = #{qrCode},</if>
<if test="name != null">name = #{name},</if>
<if test="ethnic != null">ethnic = #{ethnic},</if>
<if test="nativePlace != null">nativePlace = #{nativePlace},</if>
<if test="gender != null">gender = #{gender},</if>
<if test="birthDate != null">birthDate = #{birthDate},</if>
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="degreeName != null">degreeName = #{degreeName},</if>
<if test="photo != null">photo = #{photo},</if>
<if test="recentPhoto != null">recentPhoto = #{recentPhoto},</if>
<if test="groupId != null">groupId = #{groupId},</if>
<if test="groupName != null">groupName = #{groupName},</if>
<if test="leader != null">leader = #{leader},</if>
<if test="workTypeCode != null">workTypeCode = #{workTypeCode},</if>
<if test="workTypeName != null">workTypeName = #{workTypeName},</if>
<if test="specWorkType != null">specWorkType = #{specWorkType},</if>
<if test="hatCode != null">hatCode = #{hatCode},</if>
<if test="state != null">state = #{state},</if>
<if test="enterDate != null">enterDate = #{enterDate},</if>
<if test="exitDate != null">exitDate = #{exitDate},</if>
<if test="companyId != null">companyId = #{companyId},</if>
<if test="companyName != null">companyName = #{companyName},</if>
<if test="vendorId != null">vendorId = #{vendorId},</if>
<if test="teamId != null">teamId = #{teamId},</if>
<if test="teamName != null">teamName = #{teamName},</if>
<if test="enterType != null">enterType = #{enterType},</if>
<if test="other != null and other != ''">other = #{other},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSurProjectAttendanceUserById" parameterType="Long">
delete from sur_project_attendance_user where id = #{id}
</delete>
<delete id="deleteSurProjectAttendanceUserByIds" parameterType="String">
delete from sur_project_attendance_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteSurProjectAttendanceUserByParams" parameterType="String">
delete from sur_project_attendance_user where CONCAT(app_id,'-',workerId) in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</delete>
<insert id="batchSurProjectAttendanceUser">
insert into sur_project_attendance_user( id, cfgid, vendors_code, workerId, laborWorkerId, workerCategory, qrCode, name, ethnic, nativePlace, gender, birthDate, phone, degreeName, photo, recentPhoto, groupId, groupName, leader, workTypeCode, workTypeName, specWorkType, hatCode, state, enterDate, exitDate, companyId, companyName, vendorId, teamId, teamName, enterType, other, remark, is_del, create_by, create_time, update_by, update_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.cfgid}, #{item.vendorsCode}, #{item.workerId}, #{item.laborWorkerId}, #{item.workerCategory}, #{item.qrCode}, #{item.name}, #{item.ethnic}, #{item.nativePlace}, #{item.gender}, #{item.birthDate}, #{item.phone}, #{item.degreeName}, #{item.photo}, #{item.recentPhoto}, #{item.groupId}, #{item.groupName}, #{item.leader}, #{item.workTypeCode}, #{item.workTypeName}, #{item.specWorkType}, #{item.hatCode}, #{item.state}, #{item.enterDate}, #{item.exitDate}, #{item.companyId}, #{item.companyName}, #{item.vendorId}, #{item.teamId}, #{item.teamName}, #{item.enterType}, #{item.other}, #{item.remark}, #{item.isDel}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
</foreach>
</insert>
<sql id="sqlAttendanceData">
(
SELECT * FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN (
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{subDeptId}
) ) xx
</sql>
<select id="queryAttendanceData" parameterType="AttendanceCfg" resultMap="SurProjectAttendanceUserResult">
select * from (
select n.*,m.inTime,m.outTime from (
SELECT * FROM (
SELECT workerId,attendance_time inTime,null outtime FROM sur_project_attendance_data WHERE id IN (
SELECT min(id) id FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='e' GROUP BY workerId )) X WHERE workerId NOT IN (
SELECT workerId FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='l' GROUP BY workerId
)
union
select * from (
select workerId,null inTime,attendance_time outTime from sur_project_attendance_data where id in (
select max(id) id from <include refid="sqlAttendanceData"/> where attendance_type='l' group by workerId )) x where workerId not in (
SELECT workerId FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='e' GROUP BY workerId
)
union
select x.workerId,y.attendance_time inTime,x.attendance_time outTime from (
SELECT id,workerId,attendance_time FROM sur_project_attendance_data WHERE id IN (
SELECT MAX(id) id FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='l' GROUP BY workerId )
) x cross join (
SELECT id,workerId,attendance_time FROM sur_project_attendance_data WHERE id IN (
SELECT MIN(id) id FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='e' GROUP BY workerId )
) y on x.workerId=y.workerId
) m left join sur_project_attendance_user n on m.workerId=n.workerId
) oo
</select>
<select id="countAttendance" resultType="Long" parameterType="AttendanceCfg">
select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN (
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{subDeptId}
) group by workerid
)
</select>
<select id="queryAttendanceByUserIds" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data
where DATE(attendance_time)=date(#{createBy})
<if test="workerIds !=null and workerIds.size()>0">
and workerid in
<foreach collection="workerIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by workerid,attendance_type
</select>
<select id="queryAttendanceUsers" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN (
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{subDeptId}
) group by workerid
)
order by u.id limit #{index},#{size}
</select>
<select id="countTodayAttendance" resultType="Long" parameterType="SurProjectAttendanceUser">
select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE() group by workerid
)
<if test="id==1">
and g.companyTypeId in (1,6)
</if>
<if test="id==2">
and g.companyTypeId in (0,2,3,4,5)
</if>
<if test="id==8">
and g.companyTypeId =8
</if>
<if test="projectId!=null and projectId>0">
and c.project_id=#{projectId}
</if>
<if test="deptId!=null and deptId>0">
and c.project_id in (SELECT id FROM pro_project_info WHERE dis_dept_id=#{deptId})
</if>
<if test="prjIds !=null and prjIds.size()>0">
and c.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="todayAttendanceOld" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
select a.* ,
(select min(attendance_time) from sur_project_attendance_data b where b.workerId=a.workerId and date(b.attendance_time)=CURDATE() and b.attendance_type='e') inTime,
(SELECT Max(attendance_time) FROM sur_project_attendance_data b WHERE b.workerId=a.workerId AND DATE(b.attendance_time)=CURDATE() AND b.attendance_type='l') outTime
from (
select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE()
)
<if test="id==1">
and g.companyTypeId in (1,6)
</if>
<if test="id==2">
and g.companyTypeId in (0,2,3,4,5)
</if>
<if test="id==8">
and g.companyTypeId =8
</if>
<if test="projectId!=null and projectId>0">
and c.project_id=#{projectId}
</if>
<if test="deptId!=null and deptId>0">
and c.project_id in (SELECT id FROM pro_project_info WHERE dis_dept_id=#{deptId})
</if>
<if test="prjIds !=null and prjIds.size()>0">
and c.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
order by u.id limit #{index},#{size} ) a
</select>
<select id="todayAttendance" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE() group by workerid
)
<if test="id==1">
and g.companyTypeId in (1,6)
</if>
<if test="id==2">
and g.companyTypeId in (0,2,3,4,5)
</if>
<if test="id==8">
and g.companyTypeId =8
</if>
<if test="projectId!=null and projectId>0">
and c.project_id=#{projectId}
</if>
<if test="deptId!=null and deptId>0">
and c.project_id in (SELECT id FROM pro_project_info WHERE dis_dept_id=#{deptId})
</if>
<if test="prjIds !=null and prjIds.size()>0">
and c.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
order by u.id limit #{index},#{size}
</select>
<select id="todayAttendanceData" parameterType="java.util.List" resultMap="SurProjectAttendanceUserResult">
select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data where DATE(attendance_time)=CURDATE()
<if test="list !=null and list.size()>0">
and workerid in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by workerid,attendance_type
</select>
<select id="todayAttendanceOtherData" parameterType="map" resultMap="SurProjectAttendanceUserResult">
select workerid,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data where cfgid=#{cfgid} and DATE(attendance_time)=#{date}
<if test="list !=null and list.size()>0">
and workerid in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by workerid
</select>
<select id="queryWorkerOnDuty" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.photo,u.recentPhoto,
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info sp
WHERE u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and sp.is_Del=0 and b.project_id = sp.id
<if test="id==101">
and g.companyTypeId in (1,6)
</if>
<if test="id==102">
and g.companyTypeId =8
</if>
<if test="id==103">
and g.companyTypeId in (0,2,3,4,5)
</if>
<if test="projectId!=null and projectId>0">
and b.project_id=#{projectId}
</if>
<if test="deptId!=null and deptId>0">
and sp.dis_dept_id=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.project_Type = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and b.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="attendanceUserList" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.photo,u.recentPhoto,
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName,g.companyTypeId
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info sp
WHERE u.cfgid=b.id and u.companyId=g.companyId and sp.is_Del=0 and b.project_id = sp.id
<if test="companyTypeId==101">
and g.companyTypeId in (1,6)
</if>
<if test="companyTypeId==102">
and g.companyTypeId =8
</if>
<if test="companyTypeId==103">
and g.companyTypeId in (0,2,3,4,5)
</if>
<if test="projectId!=null and projectId>0">
and b.project_id=#{projectId}
</if>
<if test="id != null"> and u.id = #{id}</if>
<if test="state != null "> and u.state = #{state}</if>
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
order by id
</select>
<select id="groupByWorkerOnDutyByDept" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
SELECT p.id, p.project_Name NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info p,sys_dept c
where u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.dept_id
and p.is_Del=0
and g.companyTypeId in (1,6,0,2,3,4,5,8)
<if test="deptId!=null and deptId>0">
and p.dis_dept_id=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and p.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and b.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by p.projectName,c.dept_name,g.companyTypeId,p.id
order by p.id
</select>
<select id="groupUserByParams" parameterType="SurProjectAttendanceUser" resultType="Map">
select '1' as type,g.companyTypeId,count(1) as total
from sur_project_attendance_user u
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
and g.companyTypeId in (0,1,2,3,4,5,6,8)
and u.state=0
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
group by g.companyTypeId
UNION ALL
select '2' as type,g.companyTypeId,count(1) as total
from sur_project_attendance_user u
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
and g.companyTypeId in (0,1,2,3,4,5,6,8)
and u.state=1
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
group by g.companyTypeId
</select>
<select id="findUserAllByDays" parameterType="Long" resultType="Map">
select '1' as type,g.companyTypeId,count(1) as total
from sur_project_attendance_user u
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
and g.companyTypeId in (0,1,2,3,4,5,6,8)
and u.state=0
group by g.companyTypeId
</select>
<select id="groupByWorkerByDept" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
SELECT p.id, p.project_Name NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info p,sys_dept c
where u.cfgid=b.id and u.state= #{state} and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.dept_id
and p.is_Del=0
and g.companyTypeId in (1,6,0,2,3,4,5,8)
<if test="deptId!=null and deptId>0">
and p.dis_dept_id=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and p.project_Type = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and b.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by p.projectName,c.dept_name,g.companyTypeId,p.id
order by p.id
</select>
<select id="queryWorkerByState" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.photo,u.recentPhoto,
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
b.project_id,b.dept_id,u.companyName,u.workTypeName,u.groupName,
g.teamname remark,g.companyName degreeName
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info sp
WHERE u.cfgid=b.id and u.state=#{state} and u.companyId=g.companyId and sp.is_Del=0 and b.project_id = sp.id
<if test="id==101">
and g.companyTypeId in (1,6)
</if>
<if test="id==102">
and g.companyTypeId =8
</if>
<if test="id==103">
and g.companyTypeId in (0,2,3,4,5)
</if>
<if test="projectId!=null and projectId>0">
and b.project_id=#{projectId}
</if>
<if test="deptId!=null and deptId>0">
and sp.dis_dept_id=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.project_Type = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and b.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
</mapper>

View File

@ -0,0 +1,122 @@
package com.yanzhu.manage.controller.bigscreen;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.yanzhu.common.core.web.controller.BaseController;
import com.yanzhu.common.core.web.domain.AjaxResult;
import com.yanzhu.common.core.web.page.TableDataInfo;
import com.yanzhu.manage.domain.SurProjectAttendanceData;
import com.yanzhu.manage.domain.SurProjectAttendanceUser;
import com.yanzhu.manage.service.ISurProjectAttendanceDataService;
import com.yanzhu.manage.service.ISurProjectAttendanceUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* Conller
*/
@RestController
@RequestMapping("/bgscreen/attendance")
public class ProjectAttendanceController extends BaseController {
@Autowired
ISurProjectAttendanceDataService attendanceDataService;
@Autowired
ISurProjectAttendanceUserService attendanceUserService;
/**
*
* @param where
* @return
*/
@PostMapping("/groupByComany")
public AjaxResult groupByComany(@RequestBody SurProjectAttendanceData where){
where.setAttendanceTime(DateUtil.formatDate(DateTime.now()));
List<SurProjectAttendanceData> list=attendanceDataService.groupTodayCompanyTypeId(where);
return AjaxResult.success(list);
}
@PostMapping("/groupAllByComany")
public AjaxResult groupAllByComany(@RequestBody SurProjectAttendanceData where){
List<SurProjectAttendanceData> list=attendanceDataService.groupAllByComany(where);
return AjaxResult.success(list);
}
/**
*
* @param where
* @return
*/
@GetMapping("/workerOnDuty")
public TableDataInfo queryWorkerOnDuty(SurProjectAttendanceUser where){
startPage();
List<SurProjectAttendanceUser> list=attendanceUserService.queryWorkerOnDuty(where);
return getDataTable(list);
}
/**
*
* @param where
* @return
*/
@GetMapping("/groupByWorkerOnDuty")
public AjaxResult groupByWorkerOnDuty(SurProjectAttendanceUser where){
List<SurProjectAttendanceData> list=attendanceUserService.groupByWorkerOnDutyByDept(where);
return AjaxResult.success(list);
}
/**
* |
* @param where
* @return
*/
@GetMapping("/queryWorkerByState")
public TableDataInfo queryWorkerByState(SurProjectAttendanceUser where){
startPage();
List<SurProjectAttendanceUser> list=attendanceUserService.queryWorkerByState(where);
return getDataTable(list);
}
/**
* |
* @param where
* @return
*/
@GetMapping("/groupByWorkerState")
public AjaxResult groupByWorkerState(SurProjectAttendanceUser where){
List<SurProjectAttendanceData> list=attendanceUserService.groupByWorkerByDept(where);
return AjaxResult.success(list);
}
/**
*
*/
@PostMapping("/todayAttendance")
public TableDataInfo todayAttendance(@RequestBody SurProjectAttendanceData where){
where.setAttendanceTime(DateUtil.formatDate(DateTime.now()));
startPage();
List<SurProjectAttendanceData> list = attendanceDataService.todayAttendance(where);
return getDataTable(list);
}
@GetMapping("/list")
public TableDataInfo list(SurProjectAttendanceData surProjectAttendanceData)
{
startPage();
String tmp=surProjectAttendanceData.getAttendanceTime();
if(StrUtil.isNotEmpty(tmp)){
int year= DateUtil.parse(tmp).year();
surProjectAttendanceData.setYear(year);
}
List<SurProjectAttendanceData> list = attendanceDataService.selectSurProjectAttendanceDataList(surProjectAttendanceData);
return getDataTable(list);
}
}

View File

@ -0,0 +1,140 @@
package com.yanzhu.manage.service;
import com.yanzhu.manage.domain.SurProjectAttendanceData;
import java.util.List;
import java.util.Map;
/**
* Service
*
* @author ruoyi
* @date 2023-09-24
*/
public interface ISurProjectAttendanceDataService
{
/**
*
*
* @param id
* @return
*/
public SurProjectAttendanceData selectSurProjectAttendanceDataById(Long id);
/**
*
*
* @param surProjectAttendanceData
* @return
*/
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataList(SurProjectAttendanceData surProjectAttendanceData);
/**
*
*
* @param surProjectAttendanceData
* @return
*/
public SurProjectAttendanceData findCurrentAttendanceData(SurProjectAttendanceData surProjectAttendanceData);
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataListEx(SurProjectAttendanceData surProjectAttendanceData);
/**
*
*
* @param surProjectAttendanceData
* @return
*/
public int insertSurProjectAttendanceData(SurProjectAttendanceData surProjectAttendanceData);
/**
*
*
* @param surProjectAttendanceData
* @return
*/
public int updateSurProjectAttendanceData(SurProjectAttendanceData surProjectAttendanceData);
/**
*
*
* @param ids
* @return
*/
public int deleteSurProjectAttendanceDataByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteSurProjectAttendanceDataById(Long id);
/**
*
*
* @param list
* @return
*/
public int deleteSurProjectAttendanceDataByParams(List<String> list);
/**
*
*
* @param SurProjectAttendanceDataList
* @return
*/
public int batchSurProjectAttendanceData(List<SurProjectAttendanceData> SurProjectAttendanceDataList);
public String getLastServerId(SurProjectAttendanceData where);
public List<SurProjectAttendanceData> groupByComany(SurProjectAttendanceData where);
public Long getHuazhuPage( SurProjectAttendanceData where);
public List<SurProjectAttendanceData> groupAllByComany(SurProjectAttendanceData where);
public List<Map<String,Object>> initOtherData(Map<String,Object> data);
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data);
List<SurProjectAttendanceData> todayAttendance(SurProjectAttendanceData where);
/**
*
* @param where
* @return
*/
public List<Map<String, Object>> groupAllByParams(SurProjectAttendanceData where);
/**
*
* @param where
* @return
*/
public List<Map<String, Object>> findGroupAllByDays(SurProjectAttendanceData where);
/**
*
* @param where
* @return
*/
public List<SurProjectAttendanceData> attendanceDataList(SurProjectAttendanceData where);
/**
*
* @param where
* @return
*/
public List<Map<String, Object>> groupDataByParams(SurProjectAttendanceData where);
List<SurProjectAttendanceData> groupTodayCompanyTypeId(SurProjectAttendanceData where);
List<SurProjectAttendanceData> selectSurProjectAttendanceDataListByMonth(SurProjectAttendanceData attWhere);
List<SurProjectAttendanceData> selectSurProjectAttendanceDataListByDate(SurProjectAttendanceData attWhere);
}

View File

@ -0,0 +1,95 @@
package com.yanzhu.manage.service;
import com.yanzhu.manage.domain.SurProjectAttendanceGroup;
import java.util.List;
/**
* 广Service
*
* @author ruoyi
* @date 2023-09-26
*/
public interface ISurProjectAttendanceGroupService
{
/**
* 广
*
* @param id 广
* @return 广
*/
public SurProjectAttendanceGroup selectSurProjectAttendanceGroupById(Long id);
/**
* 广
*
* @param surProjectAttendanceGroup 广
* @return 广
*/
public List<SurProjectAttendanceGroup> selectSurProjectAttendanceGroupViewList(SurProjectAttendanceGroup surProjectAttendanceGroup);
/**
* 广
*
* @param surProjectAttendanceGroup 广
* @return 广
*/
public List<SurProjectAttendanceGroup> selectSurProjectAttendanceGroupList(SurProjectAttendanceGroup surProjectAttendanceGroup);
/**
* 广
*
* @param surProjectAttendanceGroup 广
* @return
*/
public int insertSurProjectAttendanceGroup(SurProjectAttendanceGroup surProjectAttendanceGroup);
/**
* 广
*
* @param surProjectAttendanceGroup 广
* @return
*/
public int updateSurProjectAttendanceGroup(SurProjectAttendanceGroup surProjectAttendanceGroup);
/**
* 广
*
* @param ids 广
* @return
*/
public int deleteSurProjectAttendanceGroupByIds(Long[] ids);
/**
* 广
*
* @param id 广
* @return
*/
public int deleteSurProjectAttendanceGroupById(Long id);
/**
* 广
*
* @param list
* @return
*/
public int deleteSurProjectAttendanceGroupByParams(List<String> list);
/**
* 广
*
* @param surProjectAttendanceGroupList 广
* @return
*/
public int batchSurProjectAttendanceGroup(List<SurProjectAttendanceGroup> surProjectAttendanceGroupList);
public void add(SurProjectAttendanceGroup group);
/**
*
* @param group
*/
public void updateJgw(SurProjectAttendanceGroup group);
}

View File

@ -0,0 +1,162 @@
package com.yanzhu.manage.service;
import com.yanzhu.manage.domain.SurProjectAttendanceData;
import com.yanzhu.manage.domain.SurProjectAttendanceUser;
import java.util.List;
import java.util.Map;
/**
* Service
*
* @author ruoyi
* @date 2023-09-24
*/
public interface ISurProjectAttendanceUserService
{
/**
*
*
* @param id
* @return
*/
public SurProjectAttendanceUser selectSurProjectAttendanceUserById(Long id);
/**
*
*
* @param surProjectAttendanceUser
* @return
*/
public SurProjectAttendanceUser findCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
/**
* []
*
* @param surProjectAttendanceUser
* @return
*/
public SurProjectAttendanceUser findYzCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
/**
*
*
* @param surProjectAttendanceUser
* @return
*/
public List<SurProjectAttendanceUser> selectSurProjectAttendanceUserList(SurProjectAttendanceUser surProjectAttendanceUser);
/**
*
*
* @param surProjectAttendanceUser
* @return
*/
public int insertSurProjectAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
/**
*
*
* @param surProjectAttendanceUser
* @return
*/
public int updateSurProjectAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
/**
*
*
* @param ids
* @return
*/
public int deleteSurProjectAttendanceUserByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteSurProjectAttendanceUserById(Long id);
/**
*
*
* @param list
* @return
*/
public int deleteSurProjectAttendanceUserByParams(List<String> list);
/**
*
*
* @param surProjectAttendanceUserList
* @return
*/
public int batchSurProjectAttendanceUser(List<SurProjectAttendanceUser> surProjectAttendanceUserList);
public void add(SurProjectAttendanceUser user);
public List<SurProjectAttendanceUser> queryAttendanceData(SurProjectAttendanceUser where);
public long countTodayAttendance(SurProjectAttendanceUser where);
public List<SurProjectAttendanceUser> todayAttendance(SurProjectAttendanceUser where);
public long countAttendance(SurProjectAttendanceUser where);
/**
*
* @param surProjectAttendanceUser
* @return
*/
public List<SurProjectAttendanceUser> selectSurProjectAttendanceUserListJgw(SurProjectAttendanceUser surProjectAttendanceUser);
/**
*
* @param where
* @return
*/
public List<SurProjectAttendanceUser> queryWorkerOnDuty(SurProjectAttendanceUser where);
/**
*
* @param where
* @return
*/
public List<Map<String, Object>> groupUserByParams(SurProjectAttendanceUser where);
/**
*
* @param where
* @return
*/
public List<SurProjectAttendanceUser> attendanceUserList(SurProjectAttendanceUser where);
/**
*
* @param projectId
* @return
*/
public List<Map<String, Object>> findUserAllByDays(Long projectId);
/**
*
* @param where
* @return
*/
List<SurProjectAttendanceData> groupByWorkerOnDutyByDept(SurProjectAttendanceUser where);
List<SurProjectAttendanceUser> querySurProjectAttendanceUserList(SurProjectAttendanceUser surProjectAttendanceUser);
/**
* |
* @param where
* @return
*/
List<SurProjectAttendanceData> groupByWorkerByDept(SurProjectAttendanceUser where);
/**
* |
* @param where
* @return
*/
List<SurProjectAttendanceUser> queryWorkerByState(SurProjectAttendanceUser where);
}

View File

@ -0,0 +1,292 @@
package com.yanzhu.manage.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.manage.domain.AttendanceCfg;
import com.yanzhu.manage.domain.SurProjectAttendanceData;
import com.yanzhu.manage.domain.SurProjectAttendanceGroup;
import com.yanzhu.manage.domain.SurProjectAttendanceUser;
import com.yanzhu.manage.mapper.AttendanceCfgMapper;
import com.yanzhu.manage.mapper.SurProjectAttendanceDataMapper;
import com.yanzhu.manage.mapper.SurProjectAttendanceGroupMapper;
import com.yanzhu.manage.mapper.SurProjectAttendanceUserMapper;
import com.yanzhu.manage.service.ISurProjectAttendanceDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* Service
*
* @author ruoyi
* @date 2023-09-24
*/
@Service
public class SurProjectAttendanceDataServiceImpl implements ISurProjectAttendanceDataService
{
@Autowired
private SurProjectAttendanceDataMapper surProjectAttendanceDataMapper;
@Autowired
private SurProjectAttendanceUserMapper surProjectAttendanceUserMapper;
@Autowired
private SurProjectAttendanceGroupMapper surProjectAttendanceGroupMapper;
@Autowired
private AttendanceCfgMapper surProjectAttendanceCfgMapper;
/**
*
*
* @param id
* @return
*/
@Override
public SurProjectAttendanceData selectSurProjectAttendanceDataById(Long id)
{
return surProjectAttendanceDataMapper.selectSurProjectAttendanceDataById(id);
}
/**
*
*
* @param surProjectAttendanceData
* @return
*/
@Override
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataList(SurProjectAttendanceData surProjectAttendanceData)
{
return surProjectAttendanceDataMapper.selectSurProjectAttendanceDataList(surProjectAttendanceData);
}
/**
*
*
* @param surProjectAttendanceData
* @return
*/
@Override
public SurProjectAttendanceData findCurrentAttendanceData(SurProjectAttendanceData surProjectAttendanceData){
return surProjectAttendanceDataMapper.findCurrentAttendanceData(surProjectAttendanceData);
}
@Override
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataListEx(SurProjectAttendanceData surProjectAttendanceData)
{
return surProjectAttendanceDataMapper.selectSurProjectAttendanceDataListEx(surProjectAttendanceData);
}
/**
*
*
* @param surProjectAttendanceData
* @return
*/
@Override
public int insertSurProjectAttendanceData(SurProjectAttendanceData surProjectAttendanceData)
{
if(StringUtils.isEmpty(surProjectAttendanceData.getCreateBy())){
surProjectAttendanceData.setCreateBy("task");
surProjectAttendanceData.setCreateTime(DateUtils.getNowDate());
}
return surProjectAttendanceDataMapper.insertSurProjectAttendanceData(surProjectAttendanceData);
}
/**
*
*
* @param surProjectAttendanceData
* @return
*/
@Override
public int updateSurProjectAttendanceData(SurProjectAttendanceData surProjectAttendanceData)
{
if(StringUtils.isEmpty(surProjectAttendanceData.getCreateBy())){
surProjectAttendanceData.setUpdateBy("task");
}
surProjectAttendanceData.setUpdateTime(DateUtils.getNowDate());
return surProjectAttendanceDataMapper.updateSurProjectAttendanceData(surProjectAttendanceData);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteSurProjectAttendanceDataByIds(Long[] ids)
{
return surProjectAttendanceDataMapper.deleteSurProjectAttendanceDataByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteSurProjectAttendanceDataById(Long id)
{
return surProjectAttendanceDataMapper.deleteSurProjectAttendanceDataById(id);
}
/**
*
*
* @param list
* @return
*/
@Override
public int deleteSurProjectAttendanceDataByParams(List<String> list) {
return surProjectAttendanceDataMapper.deleteSurProjectAttendanceDataByParams(list);
}
/**
*
*
* @param SurProjectAttendanceDataList
* @return
*/
@Override
public int batchSurProjectAttendanceData(List<SurProjectAttendanceData> SurProjectAttendanceDataList) {
return surProjectAttendanceDataMapper.batchSurProjectAttendanceData(SurProjectAttendanceDataList,DateUtils.dateTimeNow(DateUtils.YYYY));
}
private String getHuazhuCompanyTypeId(String groupName) {
return surProjectAttendanceDataMapper.findHuaZhuCompanyType(groupName);
}
@Override
public String getLastServerId(SurProjectAttendanceData where) {
return ""+surProjectAttendanceDataMapper.getLastServerId(where);
}
@Override
public List<SurProjectAttendanceData> groupByComany(SurProjectAttendanceData where) {
return surProjectAttendanceDataMapper.groupByComany(where);
}
@Override
public Long getHuazhuPage( SurProjectAttendanceData attWhere) {
return surProjectAttendanceDataMapper.getHuazhuPage(attWhere);
}
@Override
public List<SurProjectAttendanceData> groupAllByComany(SurProjectAttendanceData where) {
return surProjectAttendanceDataMapper.groupAllByComany(where);
}
@Override
public List<Map<String,Object>> initOtherData(Map<String,Object> data) {
List<Map<String,Object>> dataList = new ArrayList<>();
List<Map<String,Object>> list = surProjectAttendanceDataMapper.initOtherData(data);
if(StringUtils.isNotEmpty(list)){
List<String> workerIds = list.stream().map(Map -> Map.get("workerId").toString()).collect(Collectors.toList());
data.put("list",workerIds);
List<SurProjectAttendanceUser> datas=surProjectAttendanceUserMapper.todayAttendanceOtherData(data);
for (Map<String,Object> map:list) {
for(SurProjectAttendanceUser sau:datas){
if(Objects.equals(map.get("workerId").toString(),sau.getWorkerId())){
map.put("inTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getInTime()));
map.put("outTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getOutTime()));
dataList.add(map);
}
}
}
}
return dataList;
}
@Override
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data) {
List<Map<String,Object>> dataList = new ArrayList<>();
List<Map<String,Object>> list = surProjectAttendanceDataMapper.initHuaZhuData(data);
if(StringUtils.isNotEmpty(list)){
List<String> workerIds = list.stream().map(Map -> Map.get("workerId").toString()).collect(Collectors.toList());
data.put("list",workerIds);
List<SurProjectAttendanceUser> datas=surProjectAttendanceUserMapper.todayAttendanceOtherData(data);
for (Map<String,Object> map:list) {
for(SurProjectAttendanceUser sau:datas){
if(Objects.equals(map.get("workerId").toString(),sau.getWorkerId())){
map.put("inTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getInTime()));
map.put("outTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getOutTime()));
dataList.add(map);
}
}
}
}
return dataList;
}
@Override
public List<SurProjectAttendanceData> todayAttendance(SurProjectAttendanceData where) {
return surProjectAttendanceDataMapper.todayAttendance(where);
}
/**
*
* @param where
* @return
*/
@Override
public List<Map<String, Object>> groupAllByParams(SurProjectAttendanceData where) {
return surProjectAttendanceDataMapper.findGroupAllByParams(where);
}
/**
*
* @param where
* @return
*/
@Override
public List<Map<String, Object>> findGroupAllByDays(SurProjectAttendanceData where){
return surProjectAttendanceDataMapper.findGroupAllByDays(where);
}
/**
*
* @param where
* @return
*/
@Override
public List<Map<String, Object>> groupDataByParams(SurProjectAttendanceData where){
return surProjectAttendanceDataMapper.groupDataByParams(where);
}
/**
*
* @param where
* @return
*/
@Override
public List<SurProjectAttendanceData> attendanceDataList(SurProjectAttendanceData where) {
return surProjectAttendanceDataMapper.attendanceDataList(where);
}
@Override
public List<SurProjectAttendanceData> groupTodayCompanyTypeId(SurProjectAttendanceData where) {
return surProjectAttendanceDataMapper.groupTodayCompanyTypeId(where);
}
@Override
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataListByMonth(SurProjectAttendanceData attWhere) {
return surProjectAttendanceDataMapper.selectSurProjectAttendanceDataListByMonth(attWhere);
}
@Override
public List<SurProjectAttendanceData> selectSurProjectAttendanceDataListByDate(SurProjectAttendanceData attWhere) {
return surProjectAttendanceDataMapper.selectSurProjectAttendanceDataListByDate(attWhere);
}
}

View File

@ -0,0 +1,162 @@
package com.yanzhu.manage.service.impl;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.manage.domain.SurProjectAttendanceGroup;
import com.yanzhu.manage.mapper.SurProjectAttendanceGroupMapper;
import com.yanzhu.manage.service.ISurProjectAttendanceGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 广Service
*
* @author ruoyi
* @date 2023-09-26
*/
@Service
public class SurProjectAttendanceGroupServiceImpl implements ISurProjectAttendanceGroupService
{
@Autowired
private SurProjectAttendanceGroupMapper surProjectAttendanceGroupMapper;
/**
* 广
*
* @param id 广
* @return 广
*/
@Override
public SurProjectAttendanceGroup selectSurProjectAttendanceGroupById(Long id)
{
return surProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupById(id);
}
/**
* 广
*
* @param surProjectAttendanceGroup 广
* @return 广
*/
@Override
public List<SurProjectAttendanceGroup> selectSurProjectAttendanceGroupViewList(SurProjectAttendanceGroup surProjectAttendanceGroup)
{
return surProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupViewList(surProjectAttendanceGroup);
}
/**
* 广
*
* @param surProjectAttendanceGroup 广
* @return 广
*/
public List<SurProjectAttendanceGroup> selectSurProjectAttendanceGroupList(SurProjectAttendanceGroup surProjectAttendanceGroup) {
return surProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupList(surProjectAttendanceGroup);
}
/**
* 广
*
* @param surProjectAttendanceGroup 广
* @return
*/
@Override
public int insertSurProjectAttendanceGroup(SurProjectAttendanceGroup surProjectAttendanceGroup)
{
if(StringUtils.isEmpty(surProjectAttendanceGroup.getCreateBy())){
surProjectAttendanceGroup.setCreateBy("task");
}
return surProjectAttendanceGroupMapper.insertSurProjectAttendanceGroup(surProjectAttendanceGroup);
}
/**
* 广
*
* @param surProjectAttendanceGroup 广
* @return
*/
@Override
public int updateSurProjectAttendanceGroup(SurProjectAttendanceGroup surProjectAttendanceGroup)
{
if(StringUtils.isEmpty(surProjectAttendanceGroup.getCreateBy())){
surProjectAttendanceGroup.setUpdateBy("task");
}
surProjectAttendanceGroup.setUpdateTime(DateUtils.getNowDate());
return surProjectAttendanceGroupMapper.updateSurProjectAttendanceGroup(surProjectAttendanceGroup);
}
/**
* 广
*
* @param ids 广
* @return
*/
@Override
public int deleteSurProjectAttendanceGroupByIds(Long[] ids)
{
return surProjectAttendanceGroupMapper.deleteSurProjectAttendanceGroupByIds(ids);
}
/**
* 广
*
* @param id 广
* @return
*/
@Override
public int deleteSurProjectAttendanceGroupById(Long id)
{
return surProjectAttendanceGroupMapper.deleteSurProjectAttendanceGroupById(id);
}
/**
* 广
*
* @param list
* @return
*/
@Override
public int deleteSurProjectAttendanceGroupByParams(List<String> list) {
return surProjectAttendanceGroupMapper.deleteSurProjectAttendanceGroupByParams(list);
}
/**
* 广
*
* @param surProjectAttendanceGroupList 广
* @return
*/
@Override
public int batchSurProjectAttendanceGroup(List<SurProjectAttendanceGroup> surProjectAttendanceGroupList) {
return surProjectAttendanceGroupMapper.batchSurProjectAttendanceGroup(surProjectAttendanceGroupList);
}
@Override
public void add(SurProjectAttendanceGroup group) {
SurProjectAttendanceGroup where=new SurProjectAttendanceGroup();
where.setServerid(group.getServerid());
where.setCfgid(group.getCfgid());
List<SurProjectAttendanceGroup> list=selectSurProjectAttendanceGroupList(where);
if(list.size()==0){
insertSurProjectAttendanceGroup(group);
}else{
group.setId(list.get(0).getId());
updateSurProjectAttendanceGroup(group);
}
}
/**
*
* @param group
*/
@Override
public void updateJgw(SurProjectAttendanceGroup group) {
SurProjectAttendanceGroup where=new SurProjectAttendanceGroup();
where.setBizLicense(group.getBizLicense());
List<SurProjectAttendanceGroup> list=selectSurProjectAttendanceGroupList(where);
for(SurProjectAttendanceGroup g:list){
g.setCompanyTypeId(group.getCompanyTypeId());
updateSurProjectAttendanceGroup(g);
}
}
}

View File

@ -0,0 +1,314 @@
package com.yanzhu.manage.service.impl;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.manage.domain.AttendanceCfg;
import com.yanzhu.manage.domain.SurProjectAttendanceData;
import com.yanzhu.manage.domain.SurProjectAttendanceUser;
import com.yanzhu.manage.mapper.SurProjectAttendanceUserMapper;
import com.yanzhu.manage.service.ISurProjectAttendanceUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Service
*
* @author ruoyi
* @date 2023-09-24
*/
@Service
public class SurProjectAttendanceUserServiceImpl implements ISurProjectAttendanceUserService
{
@Autowired
private SurProjectAttendanceUserMapper surProjectAttendanceUserMapper;
/**
*
*
* @param id
* @return
*/
@Override
public SurProjectAttendanceUser selectSurProjectAttendanceUserById(Long id)
{
return surProjectAttendanceUserMapper.selectSurProjectAttendanceUserById(id);
}
/**
*
*
* @param surProjectAttendanceUser
* @return
*/
@Override
public SurProjectAttendanceUser findCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser) {
return surProjectAttendanceUserMapper.findCurrentAttendanceUser(surProjectAttendanceUser);
}
/**
* []
*
* @param surProjectAttendanceUser
* @return
*/
public SurProjectAttendanceUser findYzCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser){
return surProjectAttendanceUserMapper.findYzCurrentAttendanceUser(surProjectAttendanceUser);
}
/**
*
*
* @param surProjectAttendanceUser
* @return
*/
@Override
public List<SurProjectAttendanceUser> selectSurProjectAttendanceUserList(SurProjectAttendanceUser surProjectAttendanceUser)
{
return surProjectAttendanceUserMapper.selectSurProjectAttendanceUserList(surProjectAttendanceUser);
}
/**
*
*
* @param surProjectAttendanceUser
* @return
*/
@Override
public int insertSurProjectAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser)
{
if(StringUtils.isEmpty(surProjectAttendanceUser.getCreateBy())){
surProjectAttendanceUser.setCreateBy("task");
surProjectAttendanceUser.setCreateTime(DateUtils.getNowDate());
}
return surProjectAttendanceUserMapper.insertSurProjectAttendanceUser(surProjectAttendanceUser);
}
/**
*
*
* @param surProjectAttendanceUser
* @return
*/
@Override
public int updateSurProjectAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser)
{
if(StringUtils.isEmpty(surProjectAttendanceUser.getCreateBy())){
surProjectAttendanceUser.setUpdateBy("task");
}
surProjectAttendanceUser.setUpdateTime(DateUtils.getNowDate());
return surProjectAttendanceUserMapper.updateSurProjectAttendanceUser(surProjectAttendanceUser);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteSurProjectAttendanceUserByIds(Long[] ids)
{
return surProjectAttendanceUserMapper.deleteSurProjectAttendanceUserByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteSurProjectAttendanceUserById(Long id)
{
return surProjectAttendanceUserMapper.deleteSurProjectAttendanceUserById(id);
}
/**
*
*
* @param list
* @return
*/
@Override
public int deleteSurProjectAttendanceUserByParams(List<String> list) {
return surProjectAttendanceUserMapper.deleteSurProjectAttendanceUserByParams(list);
}
/**
*
*
* @param surProjectAttendanceUserList
* @return
*/
@Override
public int batchSurProjectAttendanceUser(List<SurProjectAttendanceUser> surProjectAttendanceUserList) {
return surProjectAttendanceUserMapper.batchSurProjectAttendanceUser(surProjectAttendanceUserList);
}
@Override
public void add(SurProjectAttendanceUser user) {
SurProjectAttendanceUser where=new SurProjectAttendanceUser();
where.setWorkerId(user.getWorkerId());
where.setCfgid(user.getCfgid());
List<SurProjectAttendanceUser> list=selectSurProjectAttendanceUserList(where);
if(list.size()==0){
insertSurProjectAttendanceUser(user);
}else{
SurProjectAttendanceUser old=list.get(0);
if(user.getVendorsCode().equals("jgw")){
user.setCompanyId(old.getCompanyId());
String oldNav=old.getNativePlace();
String newNav=user.getNativePlace();
if(oldNav==null || !oldNav.equals(newNav)){
old.setNativePlace(newNav);
}
}
user.setId(old.getId());
updateSurProjectAttendanceUser(user);
}
}
@Override
public List<SurProjectAttendanceUser> queryAttendanceData(SurProjectAttendanceUser where) {
List<SurProjectAttendanceUser> list= surProjectAttendanceUserMapper.queryAttendanceUsers(where);
List<String> workerIds=new ArrayList<>();
for(SurProjectAttendanceUser u: list){
workerIds.add(u.getWorkerId());
}
where.setWorkerIds(workerIds);
List<SurProjectAttendanceUser> datas=surProjectAttendanceUserMapper.todayAttendanceData(workerIds);
for (SurProjectAttendanceUser u:list) {
u.setInTime(findDate(datas,u,"E"));
u.setOutTime(findDate(datas,u,"L"));
}
return list;
}
@Override
public long countTodayAttendance(SurProjectAttendanceUser where) {
return surProjectAttendanceUserMapper.countTodayAttendance(where);
}
@Override
public List<SurProjectAttendanceUser> todayAttendance(SurProjectAttendanceUser where) {
if(where.getIndex()<1){
where.setIndex(1);
}
where.setIndex((where.getIndex()-1)* where.getSize());
List<SurProjectAttendanceUser> list= surProjectAttendanceUserMapper.todayAttendance(where);
List<String> workerIds=new ArrayList<>();
for(SurProjectAttendanceUser u: list){
workerIds.add(u.getWorkerId());
}
List<SurProjectAttendanceUser> datas=surProjectAttendanceUserMapper.todayAttendanceData(workerIds);
for (SurProjectAttendanceUser u:list) {
u.setInTime(findDate(datas,u,"E"));
u.setOutTime(findDate(datas,u,"L"));
}
return list;
}
@Override
public long countAttendance(SurProjectAttendanceUser user) {
AttendanceCfg where=new AttendanceCfg();
where.setCreateBy(user.getCreateBy());
where.setDeptId(user.getSubDeptId());
where.setProjectId(user.getProjectId());
return surProjectAttendanceUserMapper.countAttendance(where);
}
@Override
public List<SurProjectAttendanceUser> selectSurProjectAttendanceUserListJgw(SurProjectAttendanceUser surProjectAttendanceUser) {
return surProjectAttendanceUserMapper.selectSurProjectAttendanceUserListJgw(surProjectAttendanceUser);
}
/**
*
* @param where
* @return
*/
@Override
public List<SurProjectAttendanceUser> queryWorkerOnDuty(SurProjectAttendanceUser where) {
return surProjectAttendanceUserMapper.queryWorkerOnDuty(where);
}
/**
*
* @param where
* @return
*/
public List<Map<String, Object>> groupUserByParams(SurProjectAttendanceUser where){
return surProjectAttendanceUserMapper.groupUserByParams(where);
}
/**
*
* @param where
* @return
*/
@Override
public List<SurProjectAttendanceUser> attendanceUserList(SurProjectAttendanceUser where){
return surProjectAttendanceUserMapper.attendanceUserList(where);
}
/**
*
* @param projectId
* @return
*/
@Override
public List<Map<String, Object>> findUserAllByDays(Long projectId){
return surProjectAttendanceUserMapper.findUserAllByDays(projectId);
}
/**
*
* @param where
* @return
*/
@Override
public List<SurProjectAttendanceData> groupByWorkerOnDutyByDept(SurProjectAttendanceUser where) {
return surProjectAttendanceUserMapper.groupByWorkerOnDutyByDept(where);
}
@Override
public List<SurProjectAttendanceUser> querySurProjectAttendanceUserList(SurProjectAttendanceUser surProjectAttendanceUser) {
return surProjectAttendanceUserMapper.querySurProjectAttendanceUserList(surProjectAttendanceUser);
}
/**
* |
* @param where
* @return
*/
@Override
public List<SurProjectAttendanceData> groupByWorkerByDept(SurProjectAttendanceUser where) {
return surProjectAttendanceUserMapper.groupByWorkerByDept(where);
}
/**
* |
* @param where
* @return
*/
@Override
public List<SurProjectAttendanceUser> queryWorkerByState(SurProjectAttendanceUser where) {
return surProjectAttendanceUserMapper.queryWorkerByState(where);
}
private Date findDate(List<SurProjectAttendanceUser> datas, SurProjectAttendanceUser u, String type) {
for (SurProjectAttendanceUser user:datas) {
if(user.getWorkerId().equals(u.getWorkerId()) && user.getName().equals(type)){
if(type.equals("L")){
return user.getOutTime();
}else{
return user.getInTime();
}
}
}
return null;
}
}