第三方考勤人员管理功能开发

dev_xd
lj7788@126.com 2025-06-23 16:17:44 +08:00
parent 64e18f1e89
commit 5316655572
7 changed files with 459 additions and 17 deletions

View File

@ -85,7 +85,8 @@ function subFeatureSize(that) {
{ name: "构建体积", data: [] },
];
that.info = [];
api.Public.clearHandler(), api.Measurement.clearAllTrace();
api.Public.clearHandler();
api.Measurement.clearAllTrace();
api.Feature.getByEvent(true, (n) => {
if (n && n["id"]) {
let featureId = n.id;
@ -143,7 +144,21 @@ function measurementArea(that) {
//构件体积
function measuringVolume(that) {}
//构件距离
function distance(that) {}
function distance(that) {
let api = bimBriefingApi;
that.info = [];
api.Public.clearHandler();
api.Measurement.clearAllTrace();
//开始测量,左键选点
api.Measurement.distance(true, (data) => {
console.log(data);
});
//右键结束测量
api.Public.event("RIGHT_CLICK", (res) => {
api.Measurement.distance(false);
});
}
//剖切
function initClipping(that) {}

View File

@ -46,13 +46,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="subDeptId" column="dept_id"/>
<result property="companyTypeId" column="companyTypeId"/>
</resultMap>
<sql id="selectSurProjectAttendanceUserVo">
SELECT * FROM (
SELECT a.*,b.project_id,b.sub_dept_id
SELECT a.*,b.project_id,b.dept_id
FROM sur_project_attendance_user a,attendance_cfg b
WHERE a.cfgid=b.id )
sur_project_attendance_user
@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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
c.project_id,c.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">
@ -116,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="subDeptId != null and subDeptId >0 "> and c.dept_id = #{subDeptId}</if>
<if test="isDel != null "> and u.is_del = #{isDel}</if>
</select>
@ -160,9 +160,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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
a.update_time,b.project_id,b.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)
WHERE a.cfgid=b.id
<if test="cfgid != null "> and a.cfgid = #{cfgid}</if>
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>
@ -216,7 +219,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="subDeptId != null and subDeptId >0 "> and dept_id = #{subDeptId}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
</select>
@ -273,7 +276,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="subDeptId != null and subDeptId >0 "> and dept_id = #{subDeptId}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
</select>
@ -458,7 +461,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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}
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId}
) ) xx
</sql>
<select id="queryAttendanceData" parameterType="AttendanceCfg" resultMap="SurProjectAttendanceUserResult">
@ -499,7 +502,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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}
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId}
) group by workerid
)
</select>
@ -520,7 +523,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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}
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId}
) group by workerid
)
order by u.id limit #{index},#{size}
@ -648,8 +651,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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
b.project_id,b.dept_id,u.companyName,u.workTypeName,u.groupName,
b.project_id,b.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">
@ -682,8 +685,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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
b.project_id,b.dept_id,u.companyName,u.workTypeName,u.groupName,
b.project_id,b.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">

View File

@ -0,0 +1,111 @@
package com.yanzhu.manage.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.yanzhu.common.core.utils.poi.ExcelUtil;
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.common.log.annotation.Log;
import com.yanzhu.common.log.enums.BusinessType;
import com.yanzhu.common.security.annotation.RequiresPermissions;
import com.yanzhu.manage.domain.SurProjectAttendanceData;
import com.yanzhu.manage.service.IAttendanceCfgService;
import com.yanzhu.manage.service.ISurProjectAttendanceDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author ruoyi
* @date 2023-09-24
*/
@RestController
@RequestMapping("/project/attendance")
public class SurProjectAttendanceDataController extends BaseController
{
@Autowired
private ISurProjectAttendanceDataService surProjectAttendanceDataService;
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceData: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 = surProjectAttendanceDataService.selectSurProjectAttendanceDataList(surProjectAttendanceData);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceData:list')")
@Log(title = "劳务实名制管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SurProjectAttendanceData surProjectAttendanceData)
{
String tmp=surProjectAttendanceData.getAttendanceTime();
if(StrUtil.isNotEmpty(tmp)){
int year= DateUtil.parse(tmp).year();
surProjectAttendanceData.setYear(year);
}
List<SurProjectAttendanceData> list = surProjectAttendanceDataService.selectSurProjectAttendanceDataList(surProjectAttendanceData);
ExcelUtil<SurProjectAttendanceData> util = new ExcelUtil<SurProjectAttendanceData>(SurProjectAttendanceData.class);
util.exportExcel(response, list, "劳务实名制管理数据");
}
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceData:list')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(surProjectAttendanceDataService.selectSurProjectAttendanceDataById(id));
}
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceData:add')")
@Log(title = "劳务实名制管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SurProjectAttendanceData surProjectAttendanceData)
{
return toAjax(surProjectAttendanceDataService.insertSurProjectAttendanceData(surProjectAttendanceData));
}
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceData:edit')")
@Log(title = "劳务实名制管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SurProjectAttendanceData surProjectAttendanceData)
{
return toAjax(surProjectAttendanceDataService.updateSurProjectAttendanceData(surProjectAttendanceData));
}
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceData:remove')")
@Log(title = "劳务实名制管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(surProjectAttendanceDataService.deleteSurProjectAttendanceDataByIds(ids));
}
}

View File

@ -0,0 +1,137 @@
package com.yanzhu.manage.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.yanzhu.common.core.utils.poi.ExcelUtil;
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.common.log.annotation.Log;
import com.yanzhu.common.log.enums.BusinessType;
import com.yanzhu.common.security.annotation.RequiresPermissions;
import com.yanzhu.manage.domain.SurProjectAttendanceUser;
import com.yanzhu.manage.service.ISurProjectAttendanceUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Controller
*
* @author ruoyi
* @date 2023-09-24
*/
@RestController
@RequestMapping("/project/attendanceWorker")
public class SurProjectAttendanceUserController extends BaseController
{
@Autowired
private ISurProjectAttendanceUserService surProjectAttendanceUserService;
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceWorker:list')")
@GetMapping("/query")
public TableDataInfo query(SurProjectAttendanceUser surProjectAttendanceUser)
{
startPage();
List<SurProjectAttendanceUser> list = surProjectAttendanceUserService.querySurProjectAttendanceUserList(surProjectAttendanceUser);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceWorker:list')")
@GetMapping("/list")
public TableDataInfo list(SurProjectAttendanceUser surProjectAttendanceUser)
{
startPage();
List<SurProjectAttendanceUser> list = surProjectAttendanceUserService.selectSurProjectAttendanceUserList(surProjectAttendanceUser);
return getDataTable(list);
}
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceWorker:list')")
@GetMapping("/listjgw")
public TableDataInfo listjgw(SurProjectAttendanceUser surProjectAttendanceUser)
{
startPage();
List<SurProjectAttendanceUser> list = surProjectAttendanceUserService.selectSurProjectAttendanceUserListJgw(surProjectAttendanceUser);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceWorker:list')")
@Log(title = "考勤人员基本属性", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SurProjectAttendanceUser surProjectAttendanceUser)
{
List<SurProjectAttendanceUser> list = surProjectAttendanceUserService.selectSurProjectAttendanceUserList(surProjectAttendanceUser);
ExcelUtil<SurProjectAttendanceUser> util = new ExcelUtil<SurProjectAttendanceUser>(SurProjectAttendanceUser.class);
util.exportExcel(response, list, "考勤人员基本属性数据");
}
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceWorker:list)")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(surProjectAttendanceUserService.selectSurProjectAttendanceUserById(id));
}
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceWorker:add')")
@Log(title = "考勤人员基本属性", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SurProjectAttendanceUser surProjectAttendanceUser)
{
return toAjax(surProjectAttendanceUserService.insertSurProjectAttendanceUser(surProjectAttendanceUser));
}
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceWorker:edit')")
@Log(title = "考勤人员基本属性", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SurProjectAttendanceUser surProjectAttendanceUser)
{
return toAjax(surProjectAttendanceUserService.updateSurProjectAttendanceUser(surProjectAttendanceUser));
}
/**
*
*/
@RequiresPermissions("@ss.hasPermi('thirdLabor:attendanceWorker:remove')")
@Log(title = "考勤人员基本属性", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(surProjectAttendanceUserService.deleteSurProjectAttendanceUserByIds(ids));
}
@PostMapping("/queryAttendanceData")
public TableDataInfo queryAttendanceData(@RequestBody SurProjectAttendanceUser where){
long cnt=surProjectAttendanceUserService.countAttendance(where);
List<SurProjectAttendanceUser> list =surProjectAttendanceUserService.queryAttendanceData(where);
TableDataInfo dataInfo=new TableDataInfo();
dataInfo.setTotal(cnt);
dataInfo.setRows(list);
return dataInfo;
}
}

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 查询考勤人员基本属性列表
export function queryAttendanceWorker(query) {
return request({
url: '/manage/project/attendanceWorker/query',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,27 @@
<template>
<div class="app-container third-labor-attendance-data">
</div>
</template>
<script>
export default {
name: 'ThirdLaborAttendanceWorker',
data() {
return {
}
},
created() {
},
methods: {
}
}
</script>
<style lang="scss">
.third-labor-attendance-worker{
}
</style>

View File

@ -0,0 +1,139 @@
<template>
<div class="app-container third-labor-attendance-worker">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px" style="position: relative">
<el-form-item label="分包单位类型" prop="companyTypeId">
<el-select v-model="queryParams.companyTypeId" placeholder="请选择分包单位类型" clearable style="width: 100px">
<el-option value="" label="所有"></el-option>
<el-option value="101" label="总包人员"></el-option>
<el-option value="102" label="监理人员"></el-option>
<el-option value="103" label="劳务人员"></el-option>
</el-select>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入姓名" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="" prop="state">
<el-radio-group v-model="queryParams.state" size="small">
<el-radio-button label="">全部人员</el-radio-button>
<el-radio-button label="0">在岗</el-radio-button>
<el-radio-button label="1">已退场</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item style="position: absolute; right: 0px" v-if="cfgInfo">
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="small" @click="resetQuery"></el-button>
<el-button type="warning" plain icon="el-icon-download" size="small" @click="handleExport" v-hasPermi="['project:attendanceWorker:export']"></el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="attendanceWorkerList" >
<el-table-column label="照片" align="center" prop="id">
<template #default="scope">
<el-image :src="scope.row.recentPhoto" :preview-src-list="[scope.row.recentPhoto]" style="height: 60px" />
</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 #default="scope">{{ scope.row.gender == 1 ? "女" : "男" }}</template>
</el-table-column>
<el-table-column label="进场时间" align="center" prop="inTime" v-if="1 == 2">
<template #default="scope">{{ scope.row.enterDate }}</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">{{ scope.row.state == 1 ? "已退场" : "进场" }}</template>
</el-table-column>
<el-table-column label="分包单位名称" align="center" prop="companyName">
<template #default="scope">{{ scope.row.companyName || scoppe.row.remark }}</template>
</el-table-column>
<el-table-column label="所属班组" align="center" prop="groupName" />
<el-table-column label="岗位/工种" align="center" prop="workTypeName" />
</el-table>
<pagination v-show="total > 0" :total="total" :page="queryParams.pageNum" :limit="queryParams.pageSize" @pagination="getList" />
</div>
</template>
<script>
import { queryAttendanceWorker } from "@/api/manage/thirdAttendance";
import { listAttendance_cfg } from "@/api/manage/attendancecfg";
import useUserStore from "@/store/modules/user";
export default {
name: "ThirdLaborAttendanceWorker",
data() {
return {
//
loading: false,
//
ids: [],
total: 0,
queryParams: {
companyTypeId: "",
pageNum: 1,
pageSize: 10,
projectId: null,
subDeptId: null,
name: null,
cfgid: null,
state: "",
},
attendanceWorkerList: [],
currentPrjId: null,
currentComId: null,
cfgInfo: null,
showSearch: true,
};
},
mounted() {
const userStore = useUserStore();
this.currentPrjId = userStore.currentPrjId;
this.currentComId = userStore.currentComId;
listAttendance_cfg({
pageNum: 1,
pageSize: 10,
projectId: this.currentPrjId,
}).then((d) => {
let tmps = d.rows || [];
if (tmps.length == 0) {
this.$modal.msgError("请先配置考勤规则!");
} else {
this.cfgInfo = tmps[0];
this.getList();
}
});
},
methods: {
handleExport() {
this.download('manage/project/attendanceWorker/export', {
...this.queryParams
}, `attendanceWorker_${new Date().getTime()}.xlsx`)
},
resetQuery() {
this.queryParams.pageNum = 1;
this.queryParams.pageSize = 10;
this.queryParams.companyTypeId = "";
this.queryParams.name = "";
this.getList();
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
getList() {
this.loading = true;
this.queryParams.projectId = this.currentPrjId;
this.queryParams.cfgid = this.cfgInfo.id;
return queryAttendanceWorker(this.queryParams).then((res) => {
this.attendanceWorkerList = res.rows;
this.total = res.total;
this.loading = false;
});
},
},
};
</script>
<style lang="scss">
.third-labor-attendance-worker {
}
</style>