diff --git a/yanzhu-bigscreen/src/components/project-overview-chart.vue b/yanzhu-bigscreen/src/components/project-overview-chart.vue index b87ad353..bb74d17e 100644 --- a/yanzhu-bigscreen/src/components/project-overview-chart.vue +++ b/yanzhu-bigscreen/src/components/project-overview-chart.vue @@ -174,6 +174,7 @@ export default { legend: [ { right: 10, + data: legendData, align: 'left', ...opt, diff --git a/yanzhu-bigscreen/src/views/projectLabor.vue b/yanzhu-bigscreen/src/views/projectLabor.vue index 5400a617..d3ebab36 100644 --- a/yanzhu-bigscreen/src/views/projectLabor.vue +++ b/yanzhu-bigscreen/src/views/projectLabor.vue @@ -44,14 +44,57 @@ - + +
+
{{ item.inOutType==='out'?'出':'进' }}
+ +
{{ item.name }}
+
+ {{ item.workType }} +
+
+ {{item.inOutType==='in'?'进场时间:':'出场时间:'}} {{ item.inoutDate }} +
+
+
- + + + - + +
+ + + + + + + + + + + + + + + +
姓名单位缺勤天数
{{ item.name }}{{ item.companyName }}{{ item.id }}
+
+
@@ -65,6 +108,8 @@ export default { return { dpi: '', chartKey: 0, + chart4Height: 230, + chart2Height: 230, selProject: null, attendanceNav: 0, attendanceTotal: 0, @@ -73,12 +118,74 @@ export default { { text: '特殊工种', value: 0, id: 0 }, { text: '管理人员', value: 0, id: 0 }, ], + legendOpt: {}, + overviewDatas: [], nativeList: [], ageList: [], weekData: [], + workerTotal: 0, + workerGroupList: [], + realList: [], + alertList: [], } }, methods: { + changeChart4(opt) { + if (this.$dpi() == '1K') { + opt.legend[0].left = 200 + return opt + } else if (this.$dpi() == '2K') { + opt.legend[0].left = 360 + return opt + } else { + opt.legend[0].left = 500 + return opt + } + }, + setOpts() { + let is1K = this.$dpi() == '1K' + let is2K = this.$dpi() == '2K' + this.legendOpt = { + icon: 'rect', + orient: 'vertical', + itemWidth: '50%', + left: 240, + right: '10%', + itemWidth: 20, + itemGap: 20, + itemHeight: 20, + type: 'scroll', + pageTextStyle: { + color: '#c3dbfd', + }, + scroll: { + y: is1K ? 300 : is2K ? 500 : 600, + bar: { + show: true, + width: 5, + height: 10, + }, + }, + textStyle: { + padding: [0, 0, 0, 0], + fontSize: is1K ? 10 : is2K ? 14 : 16, + color: '#c3dbfd', + align: 'center', + rich: { + name: { + fontSize: is1K ? 10 : is2K ? 14 : 16, + color: '#c3dbfd', + padding: [5, 2, 5, 2], + }, + percent: { + fontSize: is1K ? 10 : is2K ? 14 : 16, + color: '#4676FD', + padding: [0, 2, 0, 2], + }, + }, + }, + } + }, init() { if (!this.selProject) { return @@ -86,6 +193,55 @@ export default { this.loadAttendanceData() this.getGroupByWorker() this.groupAttendanceLastWeek() + this.getWorkerCountGroupByType() + this.getRealAttendance() + this.getAttendanceAlert() + }, + resize() { + let is1K = this.$dpi() == '1K' + let is2K = this.$dpi() == '2K' + this.chart4Height = is1K ? 230 : is2K ? 360 : 595 + this.chart2Height = is1K ? 567 : is2K ? 800 : 1250 + this.chartKey++ + }, + getAttendanceAlert() { + this.$api.labor.getAttendanceAlert(this.selProject.vendorsCode, this.selProject.id).then((d) => { + this.alertList = d.data.map((it) => { + return it + }) + }) + }, + getRealAttendance() { + this.$api.labor.getRealAttendance(this.selProject.vendorsCode, this.selProject.id).then((d) => { + this.realList = d.data.map((it) => { + it.name = it.workerName + it.workType = it.workTypeName + it.img = it.scanPhoto + if (it.attendanceOutTime) { + it.inOutType = 'out' + it.inoutDate = it.attendanceInTime + } else { + it.inOutType = 'in' + it.inoutDate = it.attendanceTime + } + return it + }) + }) + }, + getWorkerCountGroupByType() { + this.$api.labor.getWorkerCountGroupByType(this.selProject.vendorsCode, this.selProject.id).then((d) => { + let sum = 0 + d.data.forEach((item) => { + sum += item.id ? item.id : 0 + }) + this.workerTotal = sum + this.workerGroupList = d.data.map((item) => { + return { + name: item.workTypeName, + value: item.id ? item.id : 0, + } + }) + }) }, groupAttendanceLastWeek() { this.$api.labor.groupAttendanceLastWeek(this.selProject.vendorsCode, this.selProject.id).then((d) => { @@ -506,12 +662,93 @@ export default { window.addEventListener('resize', () => { if (this.dpi != this.$dpi()) { this.dpi = this.$dpi() - this.chartKey++ + this.resize() } }) + this.setOpts() }, } - \ No newline at end of file diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceDataMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceDataMapper.xml index 3a09b7b0..1a51ee06 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceDataMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceDataMapper.xml @@ -664,10 +664,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceUserMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceUserMapper.xml index 4de009c0..8d5e42e8 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceUserMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceUserMapper.xml @@ -817,7 +817,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + select u.*,TIMESTAMPDIFF(Day, att.dt,now()) id + from ( + select su.workerId,su.name,pi.project_name companyName, pdept.sub_dept_name teamName + from ( select 11 cfgid, name,workerId + from yanzhu_jh.sur_project_attendance_user where cfgId=1) su + left join attendance_cfg cfg on su.cfgId=cfg.ID + left join pro_project_info pi on pi.id = cfg.project_id + join pro_project_info_subdepts pdept on cfg.dept_id=pdept.id + + ) u + join + + ( + + select workerId,max(ifnull(attendance_time,attendance_out_time)) dt + from yanzhu_jh.sur_project_attendance_data_2024 + where projectid=644 and is_del!=1 + GROUP BY workerId + order by max(ifnull(attendance_time,attendance_out_time)) + ) att on u.workerId=att.workerId + + LIMIT 10 \ No newline at end of file diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProVideoMonitorController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProVideoMonitorController.java index 63027dd5..d0781de3 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProVideoMonitorController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProVideoMonitorController.java @@ -120,12 +120,12 @@ public class ProVideoMonitorController extends BaseController String key="YS_Token__"+ proVideoMonitor.getAppkey()+"_"+proVideoMonitor.getSecret(); JSONObject jo=redisService.getCacheObject(key); String token=""; - if(jo!=null){ - long expireTime= jo.getLong("expireTime"); - if(expireTime> System.currentTimeMillis()+1000*60){ - token=jo.getString("accessToken"); - return AjaxResult.success(token); - } + if (jo != null) { + long expireTime = jo.getLong("expireTime"); + if (expireTime > System.currentTimeMillis() + 1000 * 60) { + token = jo.getString("accessToken"); + return AjaxResult.success(token); + } } String postData="appKey="+proVideoMonitor.getAppkey()+"&appSecret="+proVideoMonitor.getSecret(); String url="https://open.ys7.com/api/lapp/token/get";