更新
This commit is contained in:
@@ -136,6 +136,14 @@
|
|||||||
<warName>${project.artifactId}</warName>
|
<warName>${project.artifactId}</warName>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<testFailureIgnore>true</testFailureIgnore>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ spring:
|
|||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||||
url: jdbc:mysql://49.233.157.185:3306/fad_oa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://110.41.139.73:3306/fad_oa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
|
||||||
username: root
|
username: root
|
||||||
password: WANGyu11!
|
password: WANGyu11!
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
@@ -57,7 +57,7 @@ spring:
|
|||||||
lazy: true
|
lazy: true
|
||||||
type: ${spring.datasource.type}
|
type: ${spring.datasource.type}
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://49.233.157.185:3306/fad_oa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://110.41.139.73:3306/fad_oa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
|
||||||
username:
|
username:
|
||||||
password:
|
password:
|
||||||
# oracle:
|
# oracle:
|
||||||
@@ -102,7 +102,7 @@ spring:
|
|||||||
spring:
|
spring:
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: 49.233.157.185
|
host: 110.41.139.73
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ public class LaborCostData extends BaseEntity {
|
|||||||
// 当月的所有签到信息
|
// 当月的所有签到信息
|
||||||
private List<SysOaAttendanceVo> attendances;
|
private List<SysOaAttendanceVo> attendances;
|
||||||
|
|
||||||
|
// 小时计时长
|
||||||
|
private Double hourWorkTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,4 +79,7 @@ public class SysOaAttendanceVo extends SysOaAttendance {
|
|||||||
|
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
|
// 小时计单个工作时间
|
||||||
|
private Double hourWorkTimes;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,9 +166,12 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
|
|||||||
|
|
||||||
List<SysOaProjectVo> projectVos = new ArrayList<>();
|
List<SysOaProjectVo> projectVos = new ArrayList<>();
|
||||||
for (SysOaAttendanceVo oaAttendanceVo : sysOaAttendanceVos) {
|
for (SysOaAttendanceVo oaAttendanceVo : sysOaAttendanceVos) {
|
||||||
SysOaProjectVo sysOaProjectVo = projectService.queryById(oaAttendanceVo.getProjectId());
|
// 当projectId等于0时代表 当前为出差状态
|
||||||
oaAttendanceVo.setColor(sysOaProjectVo.getColor());
|
if(oaAttendanceVo.getProjectId()!=0){
|
||||||
projectVos.add(sysOaProjectVo);
|
SysOaProjectVo sysOaProjectVo = projectService.queryById(oaAttendanceVo.getProjectId());
|
||||||
|
oaAttendanceVo.setColor(sysOaProjectVo.getColor());
|
||||||
|
projectVos.add(sysOaProjectVo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sysUser.setProjects(projectVos);
|
sysUser.setProjects(projectVos);
|
||||||
sysUser.setAttendances(sysOaAttendanceVos);
|
sysUser.setAttendances(sysOaAttendanceVos);
|
||||||
@@ -212,15 +215,19 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
|
|||||||
List<SysOaAttendanceVo> sysOaAttendanceVos = baseMapper.selectVoListAndTime(userId, firstDay,lastDay);
|
List<SysOaAttendanceVo> sysOaAttendanceVos = baseMapper.selectVoListAndTime(userId, firstDay,lastDay);
|
||||||
List<SysOaProjectVo> projectVos = new ArrayList<>();
|
List<SysOaProjectVo> projectVos = new ArrayList<>();
|
||||||
Double workTimes = 0.0;
|
Double workTimes = 0.0;
|
||||||
|
Double hourWorkTimes = 0.0;
|
||||||
for (SysOaAttendanceVo oaAttendanceVo : sysOaAttendanceVos) {
|
for (SysOaAttendanceVo oaAttendanceVo : sysOaAttendanceVos) {
|
||||||
SysOaProjectVo sysOaProjectVo = projectService.queryById(oaAttendanceVo.getProjectId());
|
|
||||||
oaAttendanceVo.setColor(sysOaProjectVo.getColor());
|
|
||||||
oaAttendanceVo.setSysOaProjectVo(sysOaProjectVo);
|
|
||||||
oaAttendanceVo.setProjectName(sysOaProjectVo.getProjectName());
|
|
||||||
projectVos.add(sysOaProjectVo);
|
|
||||||
workTimes+=oaAttendanceVo.getWorkTimes();
|
|
||||||
|
|
||||||
|
// 出差问题解决
|
||||||
|
if (oaAttendanceVo.getProjectId()!=0){
|
||||||
|
SysOaProjectVo sysOaProjectVo = projectService.queryById(oaAttendanceVo.getProjectId());
|
||||||
|
oaAttendanceVo.setColor(sysOaProjectVo.getColor());
|
||||||
|
oaAttendanceVo.setSysOaProjectVo(sysOaProjectVo);
|
||||||
|
oaAttendanceVo.setProjectName(sysOaProjectVo.getProjectName());
|
||||||
|
projectVos.add(sysOaProjectVo);
|
||||||
|
workTimes+=oaAttendanceVo.getWorkTimes();
|
||||||
|
hourWorkTimes += oaAttendanceVo.getHourWorkTimes();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
projectVos.stream().distinct().collect(Collectors.toList());
|
projectVos.stream().distinct().collect(Collectors.toList());
|
||||||
LaborCostData laborCostData = new LaborCostData();
|
LaborCostData laborCostData = new LaborCostData();
|
||||||
@@ -228,6 +235,7 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
|
|||||||
laborCostData.setAttendances(sysOaAttendanceVos);
|
laborCostData.setAttendances(sysOaAttendanceVos);
|
||||||
laborCostData.setSysUser(sysUser);
|
laborCostData.setSysUser(sysUser);
|
||||||
laborCostData.setWorkTimes(workTimes);
|
laborCostData.setWorkTimes(workTimes);
|
||||||
|
laborCostData.setHourWorkTime(hourWorkTimes);
|
||||||
costDataList.add(laborCostData);
|
costDataList.add(laborCostData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="delFlag" column="del_flag"/>
|
<result property="delFlag" column="del_flag"/>
|
||||||
<result property="count" column="count"/>
|
<result property="count" column="count"/>
|
||||||
<result property="workTimes" column="work_times"/>
|
<result property="workTimes" column="work_times"/>
|
||||||
|
<result property="hourWorkTimes" column="hour_work_times"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
@@ -37,11 +38,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
ANY_VALUE(remark),
|
ANY_VALUE(remark),
|
||||||
ANY_VALUE(del_flag),
|
ANY_VALUE(del_flag),
|
||||||
count(*) as count,
|
count(*) as count,
|
||||||
sum(day_length) as work_times
|
sum(day_length) as work_times,
|
||||||
|
sum(hour) as hour_work_times
|
||||||
from sys_oa_attendance soa
|
from sys_oa_attendance soa
|
||||||
where user_id = #{userId}
|
where user_id = #{userId}
|
||||||
and #{lastDay} > create_time
|
and #{lastDay} > create_time
|
||||||
and create_time > #{firstDay}
|
and create_time > #{firstDay}
|
||||||
|
and del_flag = '0'
|
||||||
group by soa.project_id
|
group by soa.project_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
|
|
||||||
<el-header> 签到表</el-header>
|
<el-header> 签到表</el-header>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -17,62 +17,66 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(item,index) in userList">
|
<tr v-for="(item,index) in userList">
|
||||||
<td :class="(item.userId===selectUser.userId || selectAll)?'selectBox':''">{{ item.nickName }}</td>
|
<td :class="(item.userId===selectUser.userId || selectAll)?'selectBox':''">{{ item.nickName }}</td>
|
||||||
<td v-for="(item2,index2) in dateLength" @click="selectAttendDay(item,index,index2+1)"
|
<td style="font-size: small" v-for="(item2,index2) in dateLength" @click="selectAttendDay(item,index,index2+1)"
|
||||||
:style="{backgroundColor:(item.attendances.length>0 && item.attendances.findIndex(i=>i.attendanceDay === index2+1) >-1) ?item.attendances[item.attendances.findIndex(i=>i.attendanceDay === index2+1)].color:(index2+1===selectIndex&&(item.userId===selectUser.userId || selectAll)?'#f3ff52':'')}"></td>
|
:style="{backgroundColor:(item.attendances.length>0 && item.attendances.findIndex(i=>i.attendanceDay === index2+1) >-1) ?
|
||||||
|
(item.attendances[item.attendances.findIndex(i=>i.attendanceDay === index2+1)].projectId!==0?item.attendances[item.attendances.findIndex(i=>i.attendanceDay === index2+1)].color:'#fdf6e4'):
|
||||||
|
(index2+1===selectIndex&&(item.userId===selectUser.userId || selectAll)?'#f3ff52':'')}"
|
||||||
|
>{{item.attendances.length>0 && item.attendances.findIndex(i=>i.attendanceDay === index2+1) >-1 && item.attendances[item.attendances.findIndex(i=>i.attendanceDay === index2+1)].projectId===0?'出差':''}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<el-header> 操作栏</el-header>
|
<el-header> 操作栏</el-header>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<el-button @click="removeAttendance" type="danger" plain>取消操作</el-button>
|
<el-button @click="removeAttendance" type="danger" plain>取消操作</el-button>
|
||||||
</el-card>
|
<el-button @click="toTravel" type="warning" plain>出差</el-button>
|
||||||
<el-card class="box-card">
|
</el-card>
|
||||||
<div slot="" class="">
|
<el-card class="box-card">
|
||||||
<span><i class="el-icon-s-order"></i> 项目列表</span>
|
<div slot="" class="">
|
||||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
|
<span><i class="el-icon-s-order"></i> 项目列表</span>
|
||||||
|
<!-- <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
|
||||||
|
</div>
|
||||||
|
<div v-for="(item,index) in projectList" style="display: flex;justify-content: space-between">
|
||||||
|
<el-button class="text" :style="{backgroundColor:item.color===''?'':item.color}" @click="signIn(item)">
|
||||||
|
{{ item.projectName }}
|
||||||
|
</el-button>
|
||||||
|
<el-color-picker class="color-picker" v-model="item.color"
|
||||||
|
@change="changeItemColor(item)"></el-color-picker>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="" class="">
|
||||||
|
<span><i class="el-icon-timer"></i>工作时长</span>
|
||||||
|
<div style="margin: 20px 0 ">
|
||||||
|
<el-radio-group v-model="timeFlag">
|
||||||
|
<el-radio :label="0">天计</el-radio>
|
||||||
|
<el-radio :label="1">小时计</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(item,index) in projectList" style="display: flex;justify-content: space-between">
|
<el-select v-if="timeFlag===0" v-model="form.dayLength" placeholder="请选择工作时长">
|
||||||
<el-button class="text" :style="{backgroundColor:item.color===''?'':item.color}" @click="signIn(item)">
|
<el-option
|
||||||
{{ item.projectName }}
|
v-for="dict in dict.type.work_time_length"
|
||||||
</el-button>
|
:key="dict.value"
|
||||||
<el-color-picker class="color-picker" v-model="item.color" @change="changeItemColor(item)"></el-color-picker>
|
:label="dict.label"
|
||||||
</div>
|
:value="dict.value"
|
||||||
</el-card>
|
></el-option>
|
||||||
<el-card class="box-card">
|
</el-select>
|
||||||
<div slot="" class="">
|
|
||||||
<span><i class="el-icon-timer"></i>工作时长</span>
|
|
||||||
<div style="margin: 20px 0 ">
|
|
||||||
<el-radio-group v-model="timeFlag">
|
|
||||||
<el-radio :label="0">天计</el-radio>
|
|
||||||
<el-radio :label="1">小时计</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</div>
|
|
||||||
<el-select v-if="timeFlag===0" v-model="form.dayLength" placeholder="请选择工作时长">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.work_time_length"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
|
|
||||||
<el-select v-if="timeFlag===1" v-model="form.hour" placeholder="请选择工作时长">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.work_time_length_hour"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<el-select v-if="timeFlag===1" v-model="form.hour" placeholder="请选择工作时长">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.work_time_length_hour"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -199,6 +203,9 @@
|
|||||||
prop="projectName"
|
prop="projectName"
|
||||||
label="项目名"
|
label="项目名"
|
||||||
width="180">
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>{{scope.row.projectId===0?'出差':scope.row.projectName}}</div>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="count"
|
prop="count"
|
||||||
@@ -209,10 +216,15 @@
|
|||||||
prop="workTimes"
|
prop="workTimes"
|
||||||
label="工作时长(天)">
|
label="工作时长(天)">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="hourWorkTimes"
|
||||||
|
label="工作时长(小时计)">
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
<p style="color: red">注:小时计与天计为单独记录计算</p>
|
||||||
<p>© 2024 财务与签到报告 | 由公司财务部门生成</p>
|
<p>© 2024 财务与签到报告 | 由公司财务部门生成</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -310,16 +322,41 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
// 出差标记
|
||||||
|
toTravel(){
|
||||||
|
if (!this.selectAll) {
|
||||||
|
this.form = {
|
||||||
|
projectId: 0,
|
||||||
|
userId: this.selectUser.userId,
|
||||||
|
attendanceDay: this.selectIndex,
|
||||||
|
}
|
||||||
|
addOaAttendance(this.form).then(res => {
|
||||||
|
this.getList()
|
||||||
|
this.selectUser = this.selectArrayIndex >= this.userList.length - 1 ? this.selectUser : this.userList[this.selectArrayIndex + 1]
|
||||||
|
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.form = {
|
||||||
|
projectId: 0,
|
||||||
|
attendanceDay: this.selectIndex,
|
||||||
|
}
|
||||||
|
// 集体赋予状态
|
||||||
|
addBatchOaAttendance(this.form).then(res => {
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 删除签到
|
// 删除签到
|
||||||
removeAttendance(){
|
removeAttendance() {
|
||||||
if (!this.selectAll){
|
if (!this.selectAll) {
|
||||||
const attendanceId = this.selectUser.attendances.find(item=>item.attendanceDay===this.selectIndex).id
|
const attendanceId = this.selectUser.attendances.find(item => item.attendanceDay === this.selectIndex).id
|
||||||
delOaAttendance(attendanceId).then(res=>{
|
delOaAttendance(attendanceId).then(res => {
|
||||||
this.$modal.msgSuccess("操作成功");
|
this.$modal.msgSuccess("操作成功");
|
||||||
this.getList();
|
this.getList();
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
delOaAttendanceAll(this.selectIndex).then(res=>{
|
delOaAttendanceAll(this.selectIndex).then(res => {
|
||||||
this.$modal.msgSuccess("操作成功");
|
this.$modal.msgSuccess("操作成功");
|
||||||
this.getList();
|
this.getList();
|
||||||
})
|
})
|
||||||
@@ -368,16 +405,17 @@ export default {
|
|||||||
listOaAttendance(this.queryParams).then(res => {
|
listOaAttendance(this.queryParams).then(res => {
|
||||||
this.userList = res.data;
|
this.userList = res.data;
|
||||||
this.total = res.total;
|
this.total = res.total;
|
||||||
|
this.loading = false;
|
||||||
});
|
});
|
||||||
listProject(this.projectQueryParams).then(response => {
|
listProject(this.projectQueryParams).then(response => {
|
||||||
this.projectList = response.rows;
|
this.projectList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
changeItemColor(item) {
|
changeItemColor(item) {
|
||||||
updateProject(item).then(res=>{
|
updateProject(item).then(res => {
|
||||||
this.getList();
|
this.getList();
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -465,7 +503,8 @@ table {
|
|||||||
border-bottom: #cccccc 1px dashed;
|
border-bottom: #cccccc 1px dashed;
|
||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
}
|
}
|
||||||
.color-picker{
|
|
||||||
|
.color-picker {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
width: 30%;
|
width: 30%;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user