Compare commits

..

No commits in common. "3dc0328cbe78a5c3bfc0a9b1befeaf8c3b2c8219" and "faa9c0110c592a92c91ccc7e9d1f8e84f33ff6a2" have entirely different histories.

4 changed files with 170 additions and 321 deletions

View File

@ -9,6 +9,7 @@ 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;
@ -18,6 +19,7 @@ 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;
@ -26,6 +28,8 @@ 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;
@ -45,10 +49,7 @@ 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.PostMapping; import org.springframework.web.bind.annotation.*;
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;
@ -483,7 +484,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,60, TimeUnit.SECONDS); redisCache.setCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId(),false,30, 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()));
@ -542,7 +543,10 @@ public class LabourApiController extends BaseController {
throw new ServiceException("人员部门类型信息不完整",HttpStatusEnum.DARA_EXCEPTION.getCode()); throw new ServiceException("人员部门类型信息不完整",HttpStatusEnum.DARA_EXCEPTION.getCode());
} }
//进出门逻辑判断 //进出门逻辑判断
//if(Objects.equals("L",surProjectAttendanceData.getAttendanceType())){
//surProjectAttendanceData.setAttendanceOutTime(labourDataVo.getAttendanceTime());
surProjectAttendanceData.setAttendanceTime(labourDataVo.getAttendanceTime()); surProjectAttendanceData.setAttendanceTime(labourDataVo.getAttendanceTime());
//}
surProjectAttendanceData.setCfgid(sysApplyConfig.getCfgId()); surProjectAttendanceData.setCfgid(sysApplyConfig.getCfgId());
surProjectAttendanceData.setAppId(sysApplyConfig.getAppId()); surProjectAttendanceData.setAppId(sysApplyConfig.getAppId());
surProjectAttendanceData.setProjectId(sysApplyConfig.getProjectId()); surProjectAttendanceData.setProjectId(sysApplyConfig.getProjectId());
@ -639,7 +643,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,60, TimeUnit.SECONDS); redisCache.setCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId(),false,30, 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()));
@ -690,7 +694,10 @@ public class LabourApiController extends BaseController {
throw new ServiceException("人员部门类型信息不完整",HttpStatusEnum.DARA_EXCEPTION.getCode()); throw new ServiceException("人员部门类型信息不完整",HttpStatusEnum.DARA_EXCEPTION.getCode());
} }
//进出门逻辑判断 //进出门逻辑判断
surProjectAttendanceData.setAttendanceTime(surProjectAttendanceData.getAttendanceTime()); //if(Objects.equals("L",surProjectAttendanceData.getAttendanceType())){
//surProjectAttendanceData.setAttendanceOutTime(surProjectAttendanceData.getAttendanceTime());
surProjectAttendanceData.setAttendanceTime(surProjectAttendanceData.getAttendanceTime());
//}
surProjectAttendanceData.setCfgid(sysApplyConfig.getCfgId()); surProjectAttendanceData.setCfgid(sysApplyConfig.getCfgId());
surProjectAttendanceData.setAppId(sysApplyConfig.getAppId()); surProjectAttendanceData.setAppId(sysApplyConfig.getAppId());
surProjectAttendanceData.setProjectId(sysApplyConfig.getProjectId()); surProjectAttendanceData.setProjectId(sysApplyConfig.getProjectId());

View File

@ -1,47 +1,20 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="82px">
: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 <el-select :disabled="prjDisabled" v-model="queryParams.projectId" placeholder="请选择项目" clearable @change="doQuerySub()">
:disabled="prjDisabled" <el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
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 <el-option v-for="(item, index) in depts" :key="index" :label="item.deptName" :value="item.deptId">
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 <el-select v-model="queryParams.companyTypeId" placeholder="请选择分包商类型" clearable>
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>
@ -49,193 +22,102 @@
</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 <el-date-picker v-model="queryParams.attendanceTime" :picker-options="disableTime" type="date" placeholder="选择日期">
v-model="queryParams.attendanceTime"
:picker-options="disableTime"
type="date"
placeholder="选择日期"
>
</el-date-picker> </el-date-picker>
- -
<el-date-picker <el-date-picker v-model="queryParams.attendanceOutTime" :picker-options="disableTime" type="date" placeholder="选择日期">
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 type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
>搜索</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 <el-button type="warning" plain icon="el-icon-setting" size="mini" @click="handleSetting" v-if="!prjDisabled"
type="warning" v-hasPermi="['project:attendanceConfig:edit']">设置</el-button>
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 <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
type="primary" v-hasPermi="['project:attendance:add']">新增</el-button>
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 <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
type="success" v-hasPermi="['project:attendance:edit']">修改</el-button>
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 <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
type="danger" v-hasPermi="['project:attendance:remove']">删除</el-button>
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 <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
type="warning" v-hasPermi="['project:attendance:export']">导出</el-button>
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 <el-table v-loading="loading" :data="attendanceList" @selection-change="handleSelectionChange">
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 <el-image :src="row.scanPhoto||row.workerPhoto" :preview-src-list="[row.scanPhoto||row.workerPhoto]" style="height:60px"/>
: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 }">{{ <template slot-scope="{row}">{{ row.workerGender==1?'女':'男' }}</template>
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 <el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="1==2">
label="操作"
align="center"
class-name="small-padding fixed-width"
v-if="1 == 2"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
size="mini" v-hasPermi="['project:attendance:edit']">修改</el-button>
type="text" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
icon="el-icon-edit" v-hasPermi="['project:attendance:remove']">删除</el-button>
@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 <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
v-show="total > 0" @pagination="getList" />
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改劳务实名制管理对话框 --> <!-- 添加或修改劳务实名制管理对话框 -->
<el-dialog <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false" :close-on-press-escape="false">
: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 <el-input v-model="form.vendorsCode" placeholder="请输入厂商编号参考字典attendance_vendors" />
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 <el-input v-model="form.attendanceTime" placeholder="请输入考勤时间yyyy-MM-dd HH:mm:ss" />
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="请输入设备编号" />
@ -266,22 +148,9 @@
</template> </template>
<script> <script>
import { import { listAttendance, getAttendance, delAttendance, addAttendance, updateAttendance } from "@/api/project/attendance";
listAttendance, import { listAttendanceWorker, getAttendanceWorker, delAttendanceWorker, addAttendanceWorker, updateAttendanceWorker, queryAttendanceData } from "@/api/project/attendanceWorker";
getAttendance, import attConfigDrawer from '../attendanceConfig/attendanceConfigDrawer.vue'
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: {
@ -309,148 +178,131 @@ 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 = let tmps = this.prjDept2 && this.prjDept2[this.queryParams.projectId] ? this.prjDept2[this.queryParams.projectId] || [] : [];
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 this.$api.publics.queryUnitList({
.queryUnitList({ projectId: this.queryParams.projectId,
projectId: this.queryParams.projectId, unitTypes: "2".split(","),
unitTypes: "2".split(","), }).then((d) => {
}) let objs = d.rows || [];
.then((d) => { if (!this.prjDept2) {
let objs = d.rows || []; this.prjDept2 = {};
if (!this.prjDept2) { }
this.prjDept2 = {}; this.prjDept2[this.queryParams.projectId] = objs;
} this.depts = objs;
this.prjDept2[this.queryParams.projectId] = objs; if (objs.length == 1) {
this.depts = objs; this.queryParams.deptId = objs[0].deptId;
if (objs.length == 1) { } else {
this.queryParams.deptId = objs[0].deptId; this.queryParams.deptId = '';
} else { }
this.queryParams.deptId = ""; if(init){
} 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( postData.attendanceTime=this.$dt(this.queryParams.attendanceTime).format("YYYY-MM-DD");
"YYYY-MM-DD"
);
} }
if (this.queryParams.attendanceOutTime) { if(this.queryParams.attendanceOutTime){
postData.attendanceOutTime = this.$dt(this.queryParams.attendanceOutTime).format( postData.attendanceOutTime=this.$dt(this.queryParams.attendanceOutTime).format("YYYY-MM-DD");
"YYYY-MM-DD"
);
} }
let tmps = this.cfgList.filter( let tmps=this.cfgList.filter(d=>d.projectId==this.queryParams.projectId && d.subDeptId==this.queryParams.deptId);
(d) => if(tmps.length>0){
d.projectId == this.queryParams.projectId && postData.cfgid=tmps[0].id;
d.subDeptId == this.queryParams.deptId }else{
); postData.projectId=this.queryParams.projectId;
if (tmps.length > 0) { postData.deptId=this.queryParams.deptId;
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=>{
if (it.vendorsCode != "yanzhu") { let dt1=it.attendanceTime;
let dt1 = it.attendanceTime; let dt2=it.attendanceOutTime;
let dt2 = it.attendanceOutTime; if((!dt1 || !dt2)||dt1==dt2){
if (!dt1 || !dt2 || dt1 == dt2) { let dt=dt1||dt2;
let dt = dt1 || dt2; if(it.remark=="E"){
if (it.remark == "E") { it.attendanceTime=dt;
it.attendanceTime = dt; it.attendanceOutTime="";
it.attendanceOutTime = ""; }else{
} else { it.attendanceTime="";
it.attendanceTime = ""; it.attendanceOutTime=dt;
it.attendanceOutTime = dt;
}
} }
} }
it.scanPhoto = it.scanPhoto=it.scanPhoto && it.scanPhoto.indexOf("/profile")==0?"/jhapi"+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() {
@ -474,7 +326,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");
}, },
@ -490,9 +342,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() {
@ -503,8 +355,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 = "修改劳务实名制管理";
@ -512,16 +364,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();
@ -533,27 +385,19 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal this.$modal.confirm('是否确认删除劳务实名制管理编号为"' + ids + '"的数据项?').then(function () {
.confirm('是否确认删除劳务实名制管理编号为"' + ids + '"的数据项?') return delAttendance(ids);
.then(function () { }).then(() => {
return delAttendance(ids); this.getList();
}) this.$modal.msgSuccess("删除成功");
.then(() => { }).catch(() => { });
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.download('project/attendance/export', {
"project/attendance/export", ...this.queryParams
{ }, `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.selectSmzSspProblemmodifyListAndUnitName(smzSspProblemmodify); List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSmzSspProblemmodifyList(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,15 +772,13 @@ 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 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'
<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 p.is_del=0 and u.user_id=p.user_id AND p.dept_type=2 FROM sys_user u,sur_project_userinfo p WHERE 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>