Commit c65ac0b9 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 7099f031 6a82e9cb
...@@ -25,7 +25,16 @@ export default { ...@@ -25,7 +25,16 @@ export default {
data.attachmentPathList && data.attachmentPathList.length > 0 data.attachmentPathList && data.attachmentPathList.length > 0
? (data.attachmentPath = data.attachmentPathList[0].url) ? (data.attachmentPath = data.attachmentPathList[0].url)
: (data.attachmentPath = ""); : (data.attachmentPath = "");
if (data.leavePerson == 0 || data.leavePerson) {
if (this.dict.staffList) {
data.leavePerson = this.dict.staffList[this.form.leavePerson];
for (let key in this.dict.staffList) {
if (this.dict.staffList[key] == data.leavePerson) {
data.leavePersonId = Number(key);
}
}
}
}
return data; return data;
}, },
// 提交表单的后置处理, 会阻断默认的回退行为 // 提交表单的后置处理, 会阻断默认的回退行为
......
...@@ -81,21 +81,14 @@ instance.interceptors.response.use(response=>{ ...@@ -81,21 +81,14 @@ instance.interceptors.response.use(response=>{
* @returns * @returns
*/ */
export function post(url, option, config = {}) { export function post(url, option, config = {}) {
//判断object是数组还是对象
if(Array.isArray(option)){
return instance.post(url, option, config)
}
const data = Object.assign({}, option, { const data = Object.assign({}, option, {
// __mortals_token__: cookie.getItem('__mortals_token__'), // __mortals_token__: cookie.getItem('__mortals_token__'),
}) })
return instance.post(url, data, config) return instance.post(url, data, config)
/* //判断object是数组还是对象
if(Object.getPrototypeOf(option) === Object.prototype){
const data = Object.assign({}, option, {
// __mortals_token__: cookie.getItem('__mortals_token__'),
})
return instance.post(url, data, config)
}else{
return instance.post(url, option, config)
}*/
} }
/** /**
...@@ -116,7 +109,7 @@ export function get(url, option, config = {}) { ...@@ -116,7 +109,7 @@ export function get(url, option, config = {}) {
// 文件上传 // 文件上传
const uploadInstance = axios.create({ const uploadInstance = axios.create({
baseURL: '/m', baseURL: '/attendance',
headers: { headers: {
post: { post: {
'Content-Type': 'multipart/form-data', 'Content-Type': 'multipart/form-data',
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
:row-class-name="tableRowClassName" :row-class-name="tableRowClassName"
:empty-text="emptytxt ? emptytxt : emptyText" :empty-text="emptytxt ? emptytxt : emptyText"
border border
:height="height"
style="width: 100%" style="width: 100%"
> >
<template v-for="column in columns"> <template v-for="column in columns">
...@@ -113,6 +114,10 @@ export default { ...@@ -113,6 +114,10 @@ export default {
required: false, required: false,
default: () => [], default: () => [],
}, },
height: {
type: String,
required: false,
},
}, },
computed: { computed: {
emptyText() { emptyText() {
......
...@@ -200,6 +200,7 @@ ...@@ -200,6 +200,7 @@
:handleSelectableMethod="config.methods.handleSelectableMethod" :handleSelectableMethod="config.methods.handleSelectableMethod"
:handleSelectionChange="config.methods.handleSelectionChange" :handleSelectionChange="config.methods.handleSelectionChange"
:handleRowClick="config.methods.handleRowClick" :handleRowClick="config.methods.handleRowClick"
:height="config.height"
:handleCellClick="config.methods.handleCellClick" :handleCellClick="config.methods.handleCellClick"
/> />
......
<template> <template>
<!-- 弹出框表单 --> <!-- 弹出框表单 -->
<el-drawer :title="title" :visible.sync="open" :direction="direction" size="60%"> <el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
size="60%"
>
<div style="padding:15px"> <div style="padding:15px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
...@@ -13,44 +18,142 @@ ...@@ -13,44 +18,142 @@
:maxLength="10" :maxLength="10"
:disabled="pageInfo.type == 'view'" :disabled="pageInfo.type == 'view'"
/> --> /> -->
<Field label="请假人" prop="leavePerson" type="select" filterable remote v-model="form.leavePerson" <Field
placeholder="请输入请假人" :remote-method="remoteMethod" :maxLength="10" :enumData="staffList" label="请假人"
:disabled="pageInfo.type == 'view'" /> prop="leavePerson"
<Field label="所属部门" prop="deptId" v-model="form.deptId" type="select" placeholder="请选择所属部门" type="select"
:enumData="dict.deptId" :disabled="pageInfo.type == 'view'" /> filterable
remote
v-model="form.leavePerson"
placeholder="请输入请假人"
@change="changeStaff(form.leavePerson)"
:remote-method="remoteMethod"
:maxLength="10"
:enumData="dict.staffList"
:disabled="pageInfo.type == 'view'"
/>
<Field
label="所属部门"
prop="deptId"
v-model="form.deptId"
type="select"
placeholder="请选择所属部门"
:enumData="dict.deptId"
:disabled="true"
/>
<!-- <Field label="所属部门" prop="deptName" v-model="form.deptName" type="textarea" placeholder="请输入所属部门"/> --> <!-- <Field label="所属部门" prop="deptName" v-model="form.deptName" type="textarea" placeholder="请输入所属部门"/> -->
<Field label="电话号码" prop="phoneNumber" v-model="form.phoneNumber" placeholder="请输入电话号码" :maxLength="11" <Field
:disabled="pageInfo.type == 'view'" /> label="电话号码"
<Field label="请假类型" prop="leaveType" v-model="form.leaveType" type="select" :enumData="dict.leaveType" prop="phoneNumber"
placeholder="请选择请假类型" :disabled="pageInfo.type == 'view'" /> v-model="form.phoneNumber"
placeholder="请输入电话号码"
:maxLength="11"
:disabled="pageInfo.type == 'view'"
/>
<Field
label="请假类型"
prop="leaveType"
v-model="form.leaveType"
type="select"
:enumData="dict.leaveType"
placeholder="请选择请假类型"
:disabled="pageInfo.type == 'view'"
/>
<Field label="开始时间" prop="startTime" v-model="form.startTime" type="datetime" @change="changedate" <Field
:disabled="pageInfo.type == 'view'" /> label="开始时间"
<Field label="结束时间" prop="endTime" v-model="form.endTime" type="datetime" @change="changedate" prop="startTime"
:disabled="pageInfo.type == 'view'" /> v-model="form.startTime"
type="datetime"
@change="changedate"
:disabled="pageInfo.type == 'view'"
/>
<Field
label="结束时间"
prop="endTime"
v-model="form.endTime"
type="datetime"
@change="changedate"
:disabled="pageInfo.type == 'view'"
/>
<Field label="时长(单位:小时)" disabled prop="duration" v-model="form.duration / 60 / 60" placeholder="请输入时长(秒)" <Field
:maxLength="4" /> label="时长(单位:小时)"
<Field label="请假事由" prop="reason" v-model="form.reason" type="textarea" placeholder="请输入请假事由" disabled
:disabled="pageInfo.type == 'view'" /> prop="duration"
<Field label="审核结果" prop="auditResult" v-model="form.auditResult" type="radioCol" :enumData="dict.auditResult" v-model="form.duration / 60 / 60"
placeholder="请选择审核结果" :disabled="pageInfo.type == 'view'" style="width: 100%;" /> placeholder="请输入时长(秒)"
:maxLength="4"
/>
<Field
label="请假事由"
prop="reason"
v-model="form.reason"
type="textarea"
placeholder="请输入请假事由"
:disabled="pageInfo.type == 'view'"
/>
<Field
label="审核结果"
prop="auditResult"
v-model="form.auditResult"
type="radioCol"
:enumData="dict.auditResult"
placeholder="请选择审核结果"
:disabled="pageInfo.type == 'view'"
style="width: 100%;"
/>
<Field label="审批负责人" prop="approverId" type="select" v-model="form.approverId" placeholder="请选择审批负责人" <Field
:enumData="dict.approverId" :disabled="pageInfo.type == 'view'" /> label="审批负责人"
<Field label="申请时间" prop="createTime" v-model="form.createTime" type="datetime" disabled /> prop="approverId"
<Field label="审核说明" prop="auditDesc" type="textarea" v-model="form.auditDesc" placeholder="请输入审核说明" type="select"
:disabled="pageInfo.type == 'view'" style="width: 100%;" /> v-model="form.approverId"
placeholder="请选择审批负责人"
:enumData="dict.approverId"
:disabled="pageInfo.type == 'view'"
/>
<Field
label="申请时间"
prop="createTime"
v-model="form.createTime"
type="datetime"
disabled
/>
<Field
label="审核说明"
prop="auditDesc"
type="textarea"
v-model="form.auditDesc"
placeholder="请输入审核说明"
:disabled="pageInfo.type == 'view'"
style="width: 100%;"
/>
</el-row> </el-row>
<!-- <Field label="审批负责人" prop="approver" v-model="form.approver" placeholder="请输入审批负责人"/> --> <!-- <Field label="审批负责人" prop="approver" v-model="form.approver" placeholder="请输入审批负责人"/> -->
<!-- <Field label="附件" prop="attachment" v-model="form.attachment" type="textarea" placeholder="请输入附件"/> --> <!-- <Field label="附件" prop="attachment" v-model="form.attachment" type="textarea" placeholder="请输入附件"/> -->
<Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注" <Field
:disabled="pageInfo.type == 'view'" style="width: 100%;" /> label="备注"
prop="remark"
v-model="form.remark"
type="textarea"
placeholder="请输入备注"
:disabled="pageInfo.type == 'view'"
style="width: 100%;"
/>
<el-form-item label="附件路径" prop="attachmentPathList"> <el-form-item label="附件路径" prop="attachmentPathList">
<FileUpload @input="uploadFn" :value="form.attachmentPathList" :fileNumber="1" <FileUpload
:pageInfoType="pageInfo.type" /> @input="uploadFn"
:value="form.attachmentPathList"
:fileNumber="1"
:pageInfoType="pageInfo.type"
/>
</el-form-item> </el-form-item>
<form-buttons @submit="submitForm" noCancelBtn v-if="pageInfo.type !== 'view'" /> <form-buttons
@submit="submitForm"
noCancelBtn
v-if="pageInfo.type !== 'view'"
/>
</el-form> </el-form>
</div> </div>
</el-drawer> </el-drawer>
...@@ -74,7 +177,7 @@ export default { ...@@ -74,7 +177,7 @@ export default {
loading: true, loading: true,
// 弹出层标题 // 弹出层标题
title: "请假记录信息", title: "请假记录信息",
staffList: {}, staffList: [],
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
direction: "rtl", direction: "rtl",
...@@ -126,9 +229,7 @@ export default { ...@@ -126,9 +229,7 @@ export default {
trigger: "change", trigger: "change",
}, },
], ],
duration: [ duration: [{ required: true, message: "请输入时长", trigger: "blur" }],
{ required: true, message: "请输入时长", trigger: "blur" },
],
// reason: [ // reason: [
// { required: true, message: "请输入请假理由", trigger: "blur" }, // { required: true, message: "请输入请假理由", trigger: "blur" },
// ], // ],
...@@ -155,20 +256,28 @@ export default { ...@@ -155,20 +256,28 @@ export default {
}, },
watch: {}, watch: {},
mounted() { mounted() {
this.remoteMethod() this.remoteMethod();
}, },
methods: { methods: {
changeStaff(val) {
let person = this.staffList.filter((v) => v.id == val);
console.log(person);
console.log(this.form);
this.form.deptId = person ? person[0].deptId : "";
},
async remoteMethod() { async remoteMethod() {
await this.$post(`/staff/list`, { await this.$post(`/staff/list`, {
page: 1, page: 1,
size: -1, size: -1,
}).then((res) => { }).then((res) => {
let data = res.data.data let data = res.data.data;
let obj = {} let obj = {};
for (let key in data) { for (let key in data) {
obj[key] = data[key].name obj[data[key].id] = data[key].name;
} }
this.staffList = obj this.dict.staffList = obj;
console.log(obj);
this.staffList = res.data.data;
}); });
}, },
// beforeSubmit() { // beforeSubmit() {
...@@ -245,9 +354,7 @@ export default { ...@@ -245,9 +354,7 @@ export default {
}, },
changedate(val) { changedate(val) {
if (this.form.startTime && this.form.endTime) { if (this.form.startTime && this.form.endTime) {
if ( if (this.form.endTime.valueOf() > this.form.startTime.valueOf()) {
this.form.endTime.valueOf() > this.form.startTime.valueOf()
) {
// this.form.duration = getSec(this.form.startTime, this.form.endTime); // this.form.duration = getSec(this.form.startTime, this.form.endTime);
this.$post("/attendance/getTimeCount", { this.$post("/attendance/getTimeCount", {
startTime: this.form.startTime, startTime: this.form.startTime,
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
{{ item.label }} {{ item.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<div class="mt20" style="text-align:right"> <div class="mt20" style="text-align: right">
<el-button @click="handleCancel(1)">取消</el-button> <el-button @click="handleCancel(1)">取消</el-button>
<el-button type="primary" @click="handleSubmit(1)">确定</el-button> <el-button type="primary" @click="handleSubmit(1)">确定</el-button>
</div> </div>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
{{ item.label }} {{ item.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<div class="mt20" style="text-align:right"> <div class="mt20" style="text-align: right">
<el-button @click="handleCancel(2)">取消</el-button> <el-button @click="handleCancel(2)">取消</el-button>
<el-button type="primary" @click="handleSubmit(2)">确定</el-button> <el-button type="primary" @click="handleSubmit(2)">确定</el-button>
</div> </div>
...@@ -102,9 +102,7 @@ ...@@ -102,9 +102,7 @@
<div>打卡记录汇总</div> <div>打卡记录汇总</div>
<el-button type="text">导出成功</el-button> <el-button type="text">导出成功</el-button>
</div> </div>
<div class="times"> <div class="times">导出时间:2020-08-13</div>
导出时间:2020-08-13
</div>
</div> </div>
</div> </div>
</el-drawer> </el-drawer>
...@@ -197,10 +195,15 @@ export default { ...@@ -197,10 +195,15 @@ export default {
</el-tag> </el-tag>
) )
) : ( ) : (
"-" "正常"
); );
} else { } else {
return "-"; if (currentTime < timestampToTime(new Date(), 3)) {
return "正常";
} else {
return "--";
}
// return "正常";
} }
}, },
restTable() { restTable() {
...@@ -226,7 +229,11 @@ export default { ...@@ -226,7 +229,11 @@ export default {
) { ) {
return this.handleArr(row.attendanceStaffStatEntities, item); return this.handleArr(row.attendanceStaffStatEntities, item);
} else { } else {
return "-"; if (item < timestampToTime(new Date(), 3)) {
return "正常";
} else {
return "--";
}
} }
}, },
}; };
...@@ -386,6 +393,7 @@ export default { ...@@ -386,6 +393,7 @@ export default {
config: { config: {
showType: "tableSelect", showType: "tableSelect",
isshowTabPane: true, isshowTabPane: true,
height: "680px",
search: [ search: [
{ {
name: "salaId", name: "salaId",
...@@ -445,6 +453,7 @@ export default { ...@@ -445,6 +453,7 @@ export default {
prop: "windowCategory", prop: "windowCategory",
fixed: "left", fixed: "left",
width: 100, width: 100,
formatter: this.formatter,
show: true, show: true,
}, },
...@@ -455,8 +464,18 @@ export default { ...@@ -455,8 +464,18 @@ export default {
width: 100, width: 100,
show: true, show: true,
}, },
{ label: "大厅", prop: "salaName", show: true }, {
{ label: "部门", prop: "deptName", show: true }, label: "大厅",
prop: "salaName",
formatter: this.formatter,
show: true,
},
{
label: "部门",
prop: "deptName",
formatter: this.formatter,
show: true,
},
{ {
label: "应到", label: "应到",
prop: "workDays", prop: "workDays",
......
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
<profiles.sms.smsSendUrl>http://sms.wx3.com.cn/api/index/index</profiles.sms.smsSendUrl> <profiles.sms.smsSendUrl>http://sms.wx3.com.cn/api/index/index</profiles.sms.smsSendUrl>
<profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId> <profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId>
<package.environment>build</package.environment> <package.environment>build</package.environment>
<skipUi>ture</skipUi> <skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace> <profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.sms.smsSendUrl>http://sms.wx3.com.cn/api/index/index</profiles.sms.smsSendUrl> <profiles.sms.smsSendUrl>http://sms.wx3.com.cn/api/index/index</profiles.sms.smsSendUrl>
<profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId> <profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId>
<skipUi>ture</skipUi> <skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
......
...@@ -50,6 +50,13 @@ public class CalculateDayAttendTaskImpl implements ITaskExcuteService { ...@@ -50,6 +50,13 @@ public class CalculateDayAttendTaskImpl implements ITaskExcuteService {
AttendanceRecordHikQuery recordHikQuery = new AttendanceRecordHikQuery(); AttendanceRecordHikQuery recordHikQuery = new AttendanceRecordHikQuery();
recordHikQuery.setAttendanceDateStart(DateUtil.today()); recordHikQuery.setAttendanceDateStart(DateUtil.today());
recordHikQuery.setAttendanceDateEnd(DateUtil.today()); recordHikQuery.setAttendanceDateEnd(DateUtil.today());
recordHikQuery.setAttendanceDateStart(DateUtil.today());
recordHikQuery.setAttendanceDateEnd(DateUtil.today());
recordHikService.buildCustomHikRecord(recordHikQuery, null);
/*
Set<Long> attendStaffSet = recordHikService.find(recordHikQuery).stream().map(i -> i.getStaffId()).distinct().collect(Collectors.toSet()); Set<Long> attendStaffSet = recordHikService.find(recordHikQuery).stream().map(i -> i.getStaffId()).distinct().collect(Collectors.toSet());
Map<Long, List<AttendanceGroupStaffEntity>> groupStaffCollect = attendanceGroupStaffService.find(new AttendanceGroupStaffQuery()).stream().collect(Collectors.groupingBy(x -> x.getGroupId())); Map<Long, List<AttendanceGroupStaffEntity>> groupStaffCollect = attendanceGroupStaffService.find(new AttendanceGroupStaffQuery()).stream().collect(Collectors.groupingBy(x -> x.getGroupId()));
Iterator<Map.Entry<Long, List<AttendanceGroupStaffEntity>>> iterator = groupStaffCollect.entrySet().iterator(); Iterator<Map.Entry<Long, List<AttendanceGroupStaffEntity>>> iterator = groupStaffCollect.entrySet().iterator();
...@@ -119,7 +126,7 @@ public class CalculateDayAttendTaskImpl implements ITaskExcuteService { ...@@ -119,7 +126,7 @@ public class CalculateDayAttendTaskImpl implements ITaskExcuteService {
} }
} }
calculateAttendByDay(); calculateAttendByDay();*/
} }
private Boolean checkWorkByHoliday() { private Boolean checkWorkByHoliday() {
......
...@@ -691,6 +691,7 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte ...@@ -691,6 +691,7 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
int count = this.count(query, context); int count = this.count(query, context);
if (count > 0) { if (count > 0) {
//删除当前虚增的记录 //删除当前虚增的记录
log.info("删除虚增的记录:{}", recordHikEntity.getId());
this.remove(recordHikEntity.getId(), context); this.remove(recordHikEntity.getId(), context);
} }
} }
......
...@@ -91,7 +91,7 @@ public class HikStaffServiceImpl extends AbstractHikService implements IHikStaff ...@@ -91,7 +91,7 @@ public class HikStaffServiceImpl extends AbstractHikService implements IHikStaff
} else if (dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_SUCCESS) { } else if (dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_SUCCESS) {
ptrOutuff.read(); ptrOutuff.read();
resp = new String(ptrOutuff.byValue).trim(); resp = new String(ptrOutuff.byValue).trim();
log.info("查询人员成功, json==>{}", resp); // log.info("查询人员成功, json==>{}", resp);
break; break;
} else if (dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_FINISH) { } else if (dwState == HCNetSDK.NET_SDK_CONFIG_STATUS_FINISH) {
log.info("获取人员完成"); log.info("获取人员完成");
......
...@@ -53,14 +53,13 @@ Content-Type: application/json ...@@ -53,14 +53,13 @@ Content-Type: application/json
###海康考勤打卡记录虚增记录 ###考勤打卡记录虚增记录
POST {{baseUrl}}/attendance/record/hik/addAttendanceRecordCustom POST {{baseUrl}}/attendance/record/hik/addAttendanceRecordCustom
Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"attendanceDateStart": "2023-12-01", "attendanceDateStart": "2024-05-15",
"attendanceDateEnd": "2024-01-25" "attendanceDateEnd": "2024-05-15"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment