提交代码

dev_xds
姜玉琦 2024-05-21 22:22:32 +08:00
parent faa9c0110c
commit 71524f2092
4 changed files with 320 additions and 163 deletions

View File

@ -9,7 +9,6 @@ import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.RateLimiter; import com.ruoyi.common.annotation.RateLimiter;
import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
@ -19,7 +18,6 @@ import com.ruoyi.common.enums.*;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.exception.user.BlackListException; import com.ruoyi.common.exception.user.BlackListException;
import com.ruoyi.common.utils.AuthRsaUtils; import com.ruoyi.common.utils.AuthRsaUtils;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanUtils;
@ -28,8 +26,6 @@ import com.ruoyi.common.utils.file.MultipartFileUtils;
import com.ruoyi.common.utils.http.HttpClientUtil; import com.ruoyi.common.utils.http.HttpClientUtil;
import com.ruoyi.common.utils.ip.IpUtils; import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.common.utils.sign.Md5Utils; import com.ruoyi.common.utils.sign.Md5Utils;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.framework.web.service.SysLoginService; import com.ruoyi.framework.web.service.SysLoginService;
import com.ruoyi.system.domain.SysApplyConfig; import com.ruoyi.system.domain.SysApplyConfig;
import com.ruoyi.system.service.ISysConfigService; import com.ruoyi.system.service.ISysConfigService;
@ -49,7 +45,10 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
@ -484,7 +483,7 @@ public class LabourApiController extends BaseController {
SurProjectAttendanceData surProjectAttendanceData = JSONObject.parseObject(req.getData(), SurProjectAttendanceData.class); SurProjectAttendanceData surProjectAttendanceData = JSONObject.parseObject(req.getData(), SurProjectAttendanceData.class);
//30秒内未重复请求 //30秒内未重复请求
if(Convert.toBool(redisCache.getCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId()),true)){ if(Convert.toBool(redisCache.getCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId()),true)){
redisCache.setCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId(),false,30, TimeUnit.SECONDS); redisCache.setCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId(),false,60, TimeUnit.SECONDS);
//判断base64图片 //判断base64图片
if(StringUtils.isNotEmpty(surProjectAttendanceData.getScanPhotoBase64())){ if(StringUtils.isNotEmpty(surProjectAttendanceData.getScanPhotoBase64())){
String filePath = FileUploadUtils.uploadImages(RuoYiConfig.getUploadPath(), MultipartFileUtils.base64ToMultipartFile(surProjectAttendanceData.getScanPhotoBase64())); String filePath = FileUploadUtils.uploadImages(RuoYiConfig.getUploadPath(), MultipartFileUtils.base64ToMultipartFile(surProjectAttendanceData.getScanPhotoBase64()));
@ -643,7 +642,7 @@ public class LabourApiController extends BaseController {
for(SurProjectAttendanceData surProjectAttendanceData:surProjectAttendanceDataList){ for(SurProjectAttendanceData surProjectAttendanceData:surProjectAttendanceDataList){
//30秒内未重复请求 //30秒内未重复请求
if(Convert.toBool(redisCache.getCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId()),true)){ if(Convert.toBool(redisCache.getCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId()),true)){
redisCache.setCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId(),false,30, TimeUnit.SECONDS); redisCache.setCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId(),false,60, TimeUnit.SECONDS);
//判断base64图片 //判断base64图片
if(StringUtils.isNotEmpty(surProjectAttendanceData.getScanPhotoBase64())){ if(StringUtils.isNotEmpty(surProjectAttendanceData.getScanPhotoBase64())){
String filePath = FileUploadUtils.uploadImages(RuoYiConfig.getUploadPath(), MultipartFileUtils.base64ToMultipartFile(surProjectAttendanceData.getScanPhotoBase64())); String filePath = FileUploadUtils.uploadImages(RuoYiConfig.getUploadPath(), MultipartFileUtils.base64ToMultipartFile(surProjectAttendanceData.getScanPhotoBase64()));

View File

@ -1,20 +1,47 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="82px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="82px"
>
<el-form-item label="项目名称" prop="projectId"> <el-form-item label="项目名称" prop="projectId">
<el-select :disabled="prjDisabled" v-model="queryParams.projectId" placeholder="请选择项目" clearable @change="doQuerySub()"> <el-select
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id"> :disabled="prjDisabled"
v-model="queryParams.projectId"
placeholder="请选择项目"
clearable
@change="doQuerySub()"
>
<el-option
v-for="(item, index) in projectOptions"
:key="index"
:label="item.projectName"
:value="item.id"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="总包单位" prop="deptId"> <el-form-item label="总包单位" prop="deptId">
<el-select v-model="queryParams.deptId" placeholder="请选择总包单位" clearable> <el-select v-model="queryParams.deptId" placeholder="请选择总包单位" clearable>
<el-option v-for="(item, index) in depts" :key="index" :label="item.deptName" :value="item.deptId"> <el-option
v-for="(item, index) in depts"
:key="index"
:label="item.deptName"
:value="item.deptId"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="分包商类型" prop="companyTypeId"> <el-form-item label="分包商类型" prop="companyTypeId">
<el-select v-model="queryParams.companyTypeId" placeholder="请选择分包商类型" clearable> <el-select
v-model="queryParams.companyTypeId"
placeholder="请选择分包商类型"
clearable
>
<el-option value="0" label="所有"></el-option> <el-option value="0" label="所有"></el-option>
<el-option value="101" label="总包人员"></el-option> <el-option value="101" label="总包人员"></el-option>
<el-option value="102" label="监理人员"></el-option> <el-option value="102" label="监理人员"></el-option>
@ -22,102 +49,193 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="日期" prop="createBy"> <el-form-item label="日期" prop="createBy">
<el-date-picker v-model="queryParams.attendanceTime" :picker-options="disableTime" type="date" placeholder="选择日期"> <el-date-picker
v-model="queryParams.attendanceTime"
:picker-options="disableTime"
type="date"
placeholder="选择日期"
>
</el-date-picker> </el-date-picker>
- -
<el-date-picker v-model="queryParams.attendanceOutTime" :picker-options="disableTime" type="date" placeholder="选择日期"> <el-date-picker
v-model="queryParams.attendanceOutTime"
:picker-options="disableTime"
type="date"
placeholder="选择日期"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="姓名" prop="workerName"> <el-form-item label="姓名" prop="workerName">
<el-input v-model="queryParams.workerName" placeholder="请输入姓名"></el-input> <el-input v-model="queryParams.workerName" placeholder="请输入姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
<el-button type="warning" plain icon="el-icon-setting" size="mini" @click="handleSetting" v-if="!prjDisabled" <el-button
v-hasPermi="['project:attendanceConfig:edit']">设置</el-button> type="warning"
plain
icon="el-icon-setting"
size="mini"
@click="handleSetting"
v-if="!prjDisabled"
v-hasPermi="['project:attendanceConfig:edit']"
>设置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8" v-if="1 == 2"> <el-row :gutter="10" class="mb8" v-if="1 == 2">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" <el-button
v-hasPermi="['project:attendance:add']">新增</el-button> type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['project:attendance:add']"
>新增</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" <el-button
v-hasPermi="['project:attendance:edit']">修改</el-button> type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['project:attendance:edit']"
>修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" <el-button
v-hasPermi="['project:attendance:remove']">删除</el-button> type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['project:attendance:remove']"
>删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" <el-button
v-hasPermi="['project:attendance:export']">导出</el-button> type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['project:attendance:export']"
>导出</el-button
>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="attendanceList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="attendanceList"
@selection-change="handleSelectionChange"
>
<el-table-column label="照片" align="center" prop="id"> <el-table-column label="照片" align="center" prop="id">
<template slot-scope="{row}"> <template slot-scope="{ row }">
<el-image :src="row.scanPhoto||row.workerPhoto" :preview-src-list="[row.scanPhoto||row.workerPhoto]" style="height:60px"/> <el-image
:src="row.scanPhoto || row.workerPhoto"
:preview-src-list="[row.scanPhoto || row.workerPhoto]"
style="height: 60px"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="姓名" align="center" prop="workerName" /> <el-table-column label="姓名" align="center" prop="workerName" />
<el-table-column label="籍贯" align="center" prop="nativePlace" /> <el-table-column label="籍贯" align="center" prop="nativePlace" />
<el-table-column label="性别" align="center" prop="attendanceType" > <el-table-column label="性别" align="center" prop="attendanceType">
<template slot-scope="{row}">{{ row.workerGender==1?'女':'男' }}</template> <template slot-scope="{ row }">{{
row.workerGender == 1 ? "女" : "男"
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="进场时间" align="center" prop="inTime" width="96"> <el-table-column label="进场时间" align="center" prop="inTime" width="96">
<template slot-scope="{row}"> <template slot-scope="{ row }">
<span v-if="row.attendanceTime"> <span v-if="row.attendanceTime">
{{ row.attendanceTime|formatDateTime }} {{ row.attendanceTime | formatDateTime }}
</span> </span>
<i v-else class="el-icon-close" style="color:red;"></i> <i v-else class="el-icon-close" style="color: red"></i>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="离场时间" align="center" prop="outTime" width="96"> <el-table-column label="离场时间" align="center" prop="outTime" width="96">
<template slot-scope="{row}"> <template slot-scope="{ row }">
<span v-if="row.attendanceOutTime"> <span v-if="row.attendanceOutTime">
{{ row.attendanceOutTime|formatDateTime }} {{ row.attendanceOutTime | formatDateTime }}
</span> </span>
<i v-else class="el-icon-close" style="color:red;"></i> <i v-else class="el-icon-close" style="color: red"></i>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="分包商名称" align="center" prop="companyName" /> <el-table-column label="分包商名称" align="center" prop="companyName" />
<el-table-column label="所属班组" align="center" prop="groupName" /> <el-table-column label="所属班组" align="center" prop="groupName" />
<el-table-column label="工种" align="center" prop="workTypeName" /> <el-table-column label="工种" align="center" prop="workTypeName" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="1==2"> <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
v-if="1 == 2"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button
v-hasPermi="['project:attendance:edit']">修改</el-button> size="mini"
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" type="text"
v-hasPermi="['project:attendance:remove']">删除</el-button> icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['project:attendance:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['project:attendance:remove']"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination
@pagination="getList" /> v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改劳务实名制管理对话框 --> <!-- 添加或修改劳务实名制管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false" :close-on-press-escape="false"> <el-dialog
:title="title"
:visible.sync="open"
width="500px"
append-to-body
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="厂商编号参考字典attendance_vendors" prop="vendorsCode"> <el-form-item label="厂商编号参考字典attendance_vendors" prop="vendorsCode">
<el-input v-model="form.vendorsCode" placeholder="请输入厂商编号参考字典attendance_vendors" /> <el-input
v-model="form.vendorsCode"
placeholder="请输入厂商编号参考字典attendance_vendors"
/>
</el-form-item> </el-form-item>
<el-form-item label="工人Id" prop="workerId"> <el-form-item label="工人Id" prop="workerId">
<el-input v-model="form.workerId" placeholder="请输入工人Id" /> <el-input v-model="form.workerId" placeholder="请输入工人Id" />
</el-form-item> </el-form-item>
<el-form-item label="考勤时间yyyy-MM-dd HH:mm:ss" prop="attendanceTime"> <el-form-item label="考勤时间yyyy-MM-dd HH:mm:ss" prop="attendanceTime">
<el-input v-model="form.attendanceTime" placeholder="请输入考勤时间yyyy-MM-dd HH:mm:ss" /> <el-input
v-model="form.attendanceTime"
placeholder="请输入考勤时间yyyy-MM-dd HH:mm:ss"
/>
</el-form-item> </el-form-item>
<el-form-item label="设备编号" prop="deviceCode"> <el-form-item label="设备编号" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编号" /> <el-input v-model="form.deviceCode" placeholder="请输入设备编号" />
@ -148,9 +266,22 @@
</template> </template>
<script> <script>
import { listAttendance, getAttendance, delAttendance, addAttendance, updateAttendance } from "@/api/project/attendance"; import {
import { listAttendanceWorker, getAttendanceWorker, delAttendanceWorker, addAttendanceWorker, updateAttendanceWorker, queryAttendanceData } from "@/api/project/attendanceWorker"; listAttendance,
import attConfigDrawer from '../attendanceConfig/attendanceConfigDrawer.vue' getAttendance,
delAttendance,
addAttendance,
updateAttendance,
} from "@/api/project/attendance";
import {
listAttendanceWorker,
getAttendanceWorker,
delAttendanceWorker,
addAttendanceWorker,
updateAttendanceWorker,
queryAttendanceData,
} from "@/api/project/attendanceWorker";
import attConfigDrawer from "../attendanceConfig/attendanceConfigDrawer.vue";
export default { export default {
name: "Attendance", name: "Attendance",
components: { components: {
@ -178,131 +309,148 @@ export default {
open: false, open: false,
// //
queryParams: { queryParams: {
vendorsCode:'huazhu', vendorsCode: "huazhu",
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId:null, projectId: null,
workerName:'', workerName: "",
deptId:null, deptId: null,
companyTypeId:"0", companyTypeId: "0",
attendanceTime:new Date(), attendanceTime: new Date(),
attendanceOutTime:undefined attendanceOutTime: undefined,
}, },
// //
form: {}, form: {},
// //
rules: { rules: {},
},
projectOptions: [], projectOptions: [],
depts: [], depts: [],
prjDisabled:false, prjDisabled: false,
cfgList:[], cfgList: [],
disableTime:{ disableTime: {
disabledDate:time=>{ disabledDate: (time) => {
var t1=+this.$dt("2023-1-1").$d var t1 = +this.$dt("2023-1-1").$d;
var t2=+this.$dt(time).$d; var t2 = +this.$dt(time).$d;
var t3=+this.$dt("2028-12-31").$d var t3 = +this.$dt("2028-12-31").$d;
return t2<t1 || t2>t3; return t2 < t1 || t2 > t3;
} },
} },
}; };
}, },
created() { created() {
this.$api.publics.getMyProjectList({}).then((response) => { this.$api.publics.getMyProjectList({}).then((response) => {
this.projectOptions = response.rows; this.projectOptions = response.rows;
}); });
this.$api.publics.findAttendanceCfgList({}).then((response) => { this.$api.publics.findAttendanceCfgList({}).then((response) => {
this.cfgList = response.data||[]; this.cfgList = response.data || [];
}); });
}, },
methods: { methods: {
init(prj){ init(prj) {
this.queryParams.projectId=prj.id; this.queryParams.projectId = prj.id;
this.prjDisabled=true; this.prjDisabled = true;
this.doQuerySub(true); this.doQuerySub(true);
}, },
doQuerySub(init) { doQuerySub(init) {
let tmps = this.prjDept2 && this.prjDept2[this.queryParams.projectId] ? this.prjDept2[this.queryParams.projectId] || [] : []; let tmps =
this.prjDept2 && this.prjDept2[this.queryParams.projectId]
? this.prjDept2[this.queryParams.projectId] || []
: [];
if (tmps.length > 0) { if (tmps.length > 0) {
this.depts = tmps; this.depts = tmps;
if (tmps.length == 1) { if (tmps.length == 1) {
this.queryParams.deptId = tmps[0].deptId; this.queryParams.deptId = tmps[0].deptId;
} else { } else {
this.queryParams.deptId = ''; this.queryParams.deptId = "";
} }
if(init){ if (init) {
this.getList(); this.getList();
} }
return; return;
} }
this.$api.publics.queryUnitList({ this.$api.publics
projectId: this.queryParams.projectId, .queryUnitList({
unitTypes: "2".split(","), projectId: this.queryParams.projectId,
}).then((d) => { unitTypes: "2".split(","),
let objs = d.rows || []; })
if (!this.prjDept2) { .then((d) => {
this.prjDept2 = {}; let objs = d.rows || [];
} if (!this.prjDept2) {
this.prjDept2[this.queryParams.projectId] = objs; this.prjDept2 = {};
this.depts = objs; }
if (objs.length == 1) { this.prjDept2[this.queryParams.projectId] = objs;
this.queryParams.deptId = objs[0].deptId; this.depts = objs;
} else { if (objs.length == 1) {
this.queryParams.deptId = ''; this.queryParams.deptId = objs[0].deptId;
} } else {
if(init){ this.queryParams.deptId = "";
this.getList(); }
} if (init) {
}); this.getList();
}
});
}, },
handleSetting() { handleSetting() {
this.$refs.attDrawer.show(); this.$refs.attDrawer.show();
}, },
/** 查询劳务实名制管理列表 */ /** 查询劳务实名制管理列表 */
getList() { getList() {
this.loading = true; this.loading = true;
let postData={}; let postData = {};
if(this.queryParams.attendanceTime){ if (this.queryParams.attendanceTime) {
postData.attendanceTime=this.$dt(this.queryParams.attendanceTime).format("YYYY-MM-DD"); postData.attendanceTime = this.$dt(this.queryParams.attendanceTime).format(
"YYYY-MM-DD"
);
} }
if(this.queryParams.attendanceOutTime){ if (this.queryParams.attendanceOutTime) {
postData.attendanceOutTime=this.$dt(this.queryParams.attendanceOutTime).format("YYYY-MM-DD"); postData.attendanceOutTime = this.$dt(this.queryParams.attendanceOutTime).format(
"YYYY-MM-DD"
);
} }
let tmps=this.cfgList.filter(d=>d.projectId==this.queryParams.projectId && d.subDeptId==this.queryParams.deptId); let tmps = this.cfgList.filter(
if(tmps.length>0){ (d) =>
postData.cfgid=tmps[0].id; d.projectId == this.queryParams.projectId &&
}else{ d.subDeptId == this.queryParams.deptId
postData.projectId=this.queryParams.projectId; );
postData.deptId=this.queryParams.deptId; if (tmps.length > 0) {
postData.cfgid = tmps[0].id;
} else {
postData.projectId = this.queryParams.projectId;
postData.deptId = this.queryParams.deptId;
} }
postData.pageNum=this.queryParams.pageNum; postData.pageNum = this.queryParams.pageNum;
postData.pageSize=this.queryParams.pageSize; postData.pageSize = this.queryParams.pageSize;
if(this.queryParams.workerName){ if (this.queryParams.workerName) {
postData.workerName=this.queryParams.workerName; postData.workerName = this.queryParams.workerName;
} }
if(this.queryParams.companyTypeId && this.queryParams.companyTypeId>0){ if (this.queryParams.companyTypeId && this.queryParams.companyTypeId > 0) {
postData.companyTypeId=this.queryParams.companyTypeId; postData.companyTypeId = this.queryParams.companyTypeId;
} }
listAttendance(postData).then(response=>{ listAttendance(postData).then((response) => {
this.attendanceList = (response.rows||[]).map(it=>{ this.attendanceList = (response.rows || []).map((it) => {
let dt1=it.attendanceTime; if (it.vendorsCode != "yanzhu") {
let dt2=it.attendanceOutTime; let dt1 = it.attendanceTime;
if((!dt1 || !dt2)||dt1==dt2){ let dt2 = it.attendanceOutTime;
let dt=dt1||dt2; if (!dt1 || !dt2 || dt1 == dt2) {
if(it.remark=="E"){ let dt = dt1 || dt2;
it.attendanceTime=dt; if (it.remark == "E") {
it.attendanceOutTime=""; it.attendanceTime = dt;
}else{ it.attendanceOutTime = "";
it.attendanceTime=""; } else {
it.attendanceOutTime=dt; it.attendanceTime = "";
it.attendanceOutTime = dt;
}
} }
} }
it.scanPhoto=it.scanPhoto && it.scanPhoto.indexOf("/profile")==0?"/jhapi"+it.scanPhoto:it.scanPhoto; it.scanPhoto =
it.scanPhoto && it.scanPhoto.indexOf("/profile") == 0
? "/jhapi" + it.scanPhoto
: it.scanPhoto;
return it; return it;
}); });
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}) });
}, },
// //
cancel() { cancel() {
@ -326,7 +474,7 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -342,9 +490,9 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
@ -355,8 +503,8 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids;
getAttendance(id).then(response => { getAttendance(id).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改劳务实名制管理"; this.title = "修改劳务实名制管理";
@ -364,16 +512,16 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateAttendance(this.form).then(response => { updateAttendance(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addAttendance(this.form).then(response => { addAttendance(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -385,19 +533,27 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除劳务实名制管理编号为"' + ids + '"的数据项?').then(function () { this.$modal
return delAttendance(ids); .confirm('是否确认删除劳务实名制管理编号为"' + ids + '"的数据项?')
}).then(() => { .then(function () {
this.getList(); return delAttendance(ids);
this.$modal.msgSuccess("删除成功"); })
}).catch(() => { }); .then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('project/attendance/export', { this.download(
...this.queryParams "project/attendance/export",
}, `attendance_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
`attendance_${new Date().getTime()}.xlsx`
);
},
},
}; };
</script> </script>

View File

@ -104,7 +104,7 @@ public class SmzSspProblemmodifyController extends BaseController
smzSspProblemmodify.setNowDept(Convert.toStr(getDeptId())); smzSspProblemmodify.setNowDept(Convert.toStr(getDeptId()));
} }
smzSspProblemmodify.setNowUser(getLoginUser().getUsername()); smzSspProblemmodify.setNowUser(getLoginUser().getUsername());
List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSmzSspProblemmodifyList(smzSspProblemmodify); List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSmzSspProblemmodifyListAndUnitName(smzSspProblemmodify);
List<SmzSspProblemmodifyExport> exportList=new ArrayList<>(); List<SmzSspProblemmodifyExport> exportList=new ArrayList<>();
for(SmzSspProblemmodify it :list){ for(SmzSspProblemmodify it :list){
exportList.add(SmzSspProblemmodifyExport.newItem(it)); exportList.add(SmzSspProblemmodifyExport.newItem(it));

View File

@ -772,13 +772,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sp.dept_Name deptName,ssp.dangerLabel,ssp.chkLabel sp.dept_Name deptName,ssp.dangerLabel,ssp.chkLabel
from ( from (
SELECT c.*,a.dict_label dangerLabel,b.dict_label chkLabel FROM SELECT c.*,a.dict_label dangerLabel,b.dict_label chkLabel FROM
vw_smz_ssp_problemmodify_audit c,sys_dict_data a,sys_dict_data b WHERE c.danger_Type=a.dict_value AND a.dict_type='ssp_aqyhlx' vw_smz_ssp_problemmodify_audit c,sys_dict_data a,sys_dict_data b WHERE c.danger_Type=a.dict_value
<if test="infoType == 0 "> and a.dict_type='ssp_aqyhlx'</if>
<if test="infoType == 1 "> and a.dict_type='ssp_aqyhlx'</if>
AND c.checkState=b.dict_value AND b.dict_type='smz_ssp_checkstate' AND c.checkState=b.dict_value AND b.dict_type='smz_ssp_checkstate'
) ssp ) ssp
left join sur_project sp on ssp.projectId=sp.id left join sur_project sp on ssp.projectId=sp.id
left join ( left join (
SELECT p.dept_Name,p.dept_id,u.phonenumber SELECT p.dept_Name,p.dept_id,u.phonenumber
FROM sys_user u,sur_project_userinfo p WHERE u.user_id=p.user_id AND p.dept_type=2 FROM sys_user u,sur_project_userinfo p WHERE p.is_del=0 and u.user_id=p.user_id AND p.dept_type=2
) sp on ssp.lordSentUser = sp.phonenumber ) sp on ssp.lordSentUser = sp.phonenumber
<!--监理单位/总包公司/分包单位--> <!--监理单位/总包公司/分包单位-->
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> left join sur_project_unit_info spui on spui.projectId = ssp.projectId</if> <if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> left join sur_project_unit_info spui on spui.projectId = ssp.projectId</if>