更新
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,10 +166,13 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
|
|||||||
|
|
||||||
List<SysOaProjectVo> projectVos = new ArrayList<>();
|
List<SysOaProjectVo> projectVos = new ArrayList<>();
|
||||||
for (SysOaAttendanceVo oaAttendanceVo : sysOaAttendanceVos) {
|
for (SysOaAttendanceVo oaAttendanceVo : sysOaAttendanceVos) {
|
||||||
|
// 当projectId等于0时代表 当前为出差状态
|
||||||
|
if(oaAttendanceVo.getProjectId()!=0){
|
||||||
SysOaProjectVo sysOaProjectVo = projectService.queryById(oaAttendanceVo.getProjectId());
|
SysOaProjectVo sysOaProjectVo = projectService.queryById(oaAttendanceVo.getProjectId());
|
||||||
oaAttendanceVo.setColor(sysOaProjectVo.getColor());
|
oaAttendanceVo.setColor(sysOaProjectVo.getColor());
|
||||||
projectVos.add(sysOaProjectVo);
|
projectVos.add(sysOaProjectVo);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
sysUser.setProjects(projectVos);
|
sysUser.setProjects(projectVos);
|
||||||
sysUser.setAttendances(sysOaAttendanceVos);
|
sysUser.setAttendances(sysOaAttendanceVos);
|
||||||
sysUserVos.add(sysUser);
|
sysUserVos.add(sysUser);
|
||||||
@@ -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) {
|
||||||
|
|
||||||
|
// 出差问题解决
|
||||||
|
if (oaAttendanceVo.getProjectId()!=0){
|
||||||
SysOaProjectVo sysOaProjectVo = projectService.queryById(oaAttendanceVo.getProjectId());
|
SysOaProjectVo sysOaProjectVo = projectService.queryById(oaAttendanceVo.getProjectId());
|
||||||
oaAttendanceVo.setColor(sysOaProjectVo.getColor());
|
oaAttendanceVo.setColor(sysOaProjectVo.getColor());
|
||||||
oaAttendanceVo.setSysOaProjectVo(sysOaProjectVo);
|
oaAttendanceVo.setSysOaProjectVo(sysOaProjectVo);
|
||||||
oaAttendanceVo.setProjectName(sysOaProjectVo.getProjectName());
|
oaAttendanceVo.setProjectName(sysOaProjectVo.getProjectName());
|
||||||
projectVos.add(sysOaProjectVo);
|
projectVos.add(sysOaProjectVo);
|
||||||
workTimes+=oaAttendanceVo.getWorkTimes();
|
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>
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,11 @@
|
|||||||
<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>
|
||||||
@@ -30,6 +33,7 @@
|
|||||||
<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-button @click="toTravel" type="warning" plain>出差</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<div slot="" class="">
|
<div slot="" class="">
|
||||||
@@ -40,7 +44,8 @@
|
|||||||
<el-button class="text" :style="{backgroundColor:item.color===''?'':item.color}" @click="signIn(item)">
|
<el-button class="text" :style="{backgroundColor:item.color===''?'':item.color}" @click="signIn(item)">
|
||||||
{{ item.projectName }}
|
{{ item.projectName }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-color-picker class="color-picker" v-model="item.color" @change="changeItemColor(item)"></el-color-picker>
|
<el-color-picker class="color-picker" v-model="item.color"
|
||||||
|
@change="changeItemColor(item)"></el-color-picker>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
@@ -74,7 +79,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
@@ -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,6 +322,31 @@ 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) {
|
||||||
@@ -368,11 +405,12 @@ 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;
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -465,6 +503,7 @@ 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