Commit e7c53e59 authored by liaoanyuan's avatar liaoanyuan

修改加班天数和漏报天数统计

parent b2b20dab
......@@ -588,7 +588,7 @@
</select>
<select id="getIsOvertime" resultMap="BaseResultMap" parameterType="map">
select project_id,user_id,`type`,is_overtime
select project_id,user_id,`type`,is_overtime,work_time
from work_time_order
<where>
<if test="deptId !=null">
......@@ -599,6 +599,5 @@
AND user_id=#{userId}
</if>
</where>
group by day(work_day),is_overtime
</select>
</mapper>
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
......@@ -40,13 +41,13 @@ public class StatisticsTableDto implements Serializable {
* 用户姓名
*/
@ApiModelProperty(name = "overtimes", value = "员工的加班天数")
private Integer overtimes;
private double overtimes;
/**
* 用户姓名
*/
@ApiModelProperty(name = "underreportings", value = "漏报天数")
private Integer underreportings;
private double underreportings;
/**
* 一天工时类型和工时的集合
......
......@@ -141,19 +141,27 @@ public class StatisticsServiceImpl implements StatisticsService {
for (StatisticsTableDto statisticsTableDto : statisticsTableDtos) {
map.put("userId",statisticsTableDto.getUserId());
//员工的加班天数
Integer overtimes=0;
double overtimes=0.000;
//正常天数
Integer days=0;
double days=0.000;
List<WorkTimeOrder> isOvertime = workTimeOrderMapper.getIsOvertime(map);
for (WorkTimeOrder workTimeOrder : isOvertime) {
if (workTimeOrder.getIsOvertime()==1) {
overtimes+=1;
//当前天数
double overtimes1=workTimeOrder.getWorkTime();
//统计天数
overtimes+=overtimes1/8;
continue;
}
if (workTimeOrder.getIsOvertime()==0) {
days+=1;
//当前天数
double days1=workTimeOrder.getWorkTime();
//统计天数
days +=days1/8;
System.out.println("xxxxxxxxxxxxxxxxxxxxxxxx"+days1);
System.out.println("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"+days);
}
}
statisticsTableDto.setOvertimes(overtimes);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment