包头bug修改
This commit is contained in:
parent
4746c58208
commit
9b085f1e7e
@ -49,5 +49,11 @@
|
||||
<if test="departmentId!=null and departmentId!=''">
|
||||
and w1.department_id=#{departmentId}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND st.query_time >= DATE_FORMAT(#{startTime}, "%Y-%m")
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and st.query_time <= DATE_FORMAT(#{endTime}, "%Y-%m")
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@ -5,13 +5,10 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.exceptions.ExceptionUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.xuyanwu.spring.file.storage.FileInfo;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
//import com.arcsoft.face.FaceFeature;
|
||||
//import com.arcsoft.face.FaceInfo;
|
||||
//import com.arcsoft.face.FaceSimilar;
|
||||
//import com.arcsoft.face.toolkit.ImageInfo;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -139,6 +136,8 @@ public class WorkerAttendanceServiceImpl extends ServiceImpl<WorkerAttendanceMap
|
||||
private Integer imageType;
|
||||
@Value("${arcsoft.ufaceSorce}")
|
||||
private Integer ufaceSorce;
|
||||
@Autowired
|
||||
private WorkerMonthAttendanceDurationMapper workerMonthAttendanceDurationMapper;
|
||||
|
||||
@Override
|
||||
public List<EntityMap> viewDayAttendanceList(Map<String, Object> map) {
|
||||
@ -315,7 +314,7 @@ public class WorkerAttendanceServiceImpl extends ServiceImpl<WorkerAttendanceMap
|
||||
int hour = Integer.valueOf(time.substring(11, 13));
|
||||
if (dev != null && dev.getIsEnter() != null && dev.getIsEnter() == 1 && dev.getIsOut() != null && dev.getIsOut() == 1) {
|
||||
String entTime = "," + dev.getEnterTime() + ",";
|
||||
if (entTime.indexOf(Cts.COMMA + hour +Cts.COMMA) > -1) {
|
||||
if (entTime.indexOf(Cts.COMMA + hour + Cts.COMMA) > -1) {
|
||||
type = 1;
|
||||
} else {
|
||||
type = 2;
|
||||
@ -373,10 +372,66 @@ public class WorkerAttendanceServiceImpl extends ServiceImpl<WorkerAttendanceMap
|
||||
}
|
||||
}
|
||||
|
||||
String[] heads = {"姓名", "人员类型", "身份证号", "在职状态", "岗位(工种)", "所属单位", "进入/离开", "进出时间", "进出位置"};
|
||||
String[] headsStr = {"workerName", "persontypename", "idCard", "inservicename", "departmentgroupname", "enterpriseName", "typename", "createTime", PASSAGEWAY_NAME};
|
||||
JxlExcelUtils.excelExport("考勤明细列表", heads, headsStr, list, response);
|
||||
// String[] heads = {"姓名", "人员类型", "身份证号", "在职状态", "岗位(工种)", "所属单位", "进入/离开", "进出时间", "进出位置"};
|
||||
// String[] headsStr = {"workerName", "persontypename", "idCard", "inservicename", "departmentgroupname", "enterpriseName", "typename", "createTime", PASSAGEWAY_NAME};
|
||||
// JxlExcelUtils.excelExport("考勤明细列表", heads, headsStr, list, response);
|
||||
|
||||
String[] heads1 = {"姓名", "人员类型", "身份证号", "在职状态", "岗位(工种)", "所属单位", "进入/离开", "进出时间", "进出位置"};
|
||||
String[] headsStr1 = {"workerName", "persontypename", "idCard", "inservicename", "departmentgroupname", "enterpriseName", "typename", "createTime", PASSAGEWAY_NAME};
|
||||
Map<String, Object> map1 = new HashMap<>(16);
|
||||
map1.put("heads", heads1);
|
||||
map1.put("headsStr", headsStr1);
|
||||
map1.put("dataList", list);
|
||||
map1.put("sheetName", MapUtils.getString(map, "monthTime") + "单位工时汇总");
|
||||
List<Map<String, Object>> sheetList = new ArrayList<>();
|
||||
sheetList.add(map1);
|
||||
|
||||
List<EntityMap> durationList = workerMonthAttendanceDurationMapper.getMonthWorkerAttendanceDurationList(map);
|
||||
Map<String, BigDecimal> dataList4Map = new HashMap<>();
|
||||
for (Map<String, Object> demo : durationList) {
|
||||
BigDecimal min = new BigDecimal("0");
|
||||
for (int i = 1; i <= 31; i++) {
|
||||
//1、正常 2、迟到 3、早退 4、加班5、缺卡
|
||||
if (demo.get("day" + i) != null) {
|
||||
if (DateUtil.compare(DateUtil.parse(MapUtils.getString(demo, "queryTime") + "-" + i), DateUtil.parse(MapUtils.getString(map, "startTime"))) >= 0
|
||||
&& DateUtil.compare(DateUtil.parse(MapUtils.getString(demo, "queryTime") + "-" + i), DateUtil.parse(MapUtils.getString(map, "endTime"))) <= 0
|
||||
&& Integer.valueOf(demo.get("day" + i).toString()) > 0) {
|
||||
int minuteTime = Integer.valueOf(demo.get("day" + i).toString()).intValue();
|
||||
min = NumberUtil.add(min, new BigDecimal(minuteTime));
|
||||
}
|
||||
}
|
||||
}
|
||||
String enterpriseName = MapUtils.getString(demo, "enterpriseName");
|
||||
BigDecimal d = dataList4Map.get(enterpriseName);
|
||||
if (d == null) {
|
||||
d = new BigDecimal("0");
|
||||
} else {
|
||||
d = NumberUtil.add(d, min);
|
||||
}
|
||||
dataList4Map.put("enterpriseName", d);
|
||||
}
|
||||
List<Map<String, Object>> dataList4 = dataList4Map.entrySet().stream().map(o -> {
|
||||
Map<String, Object> m = new HashMap<>();
|
||||
m.put("enterpriseName", o.getKey());
|
||||
int minuteTime = o.getValue().intValue();
|
||||
if (minuteTime == 0) {
|
||||
m.put("total", 0);
|
||||
} else {
|
||||
int hours = (int) Math.floor(minuteTime / 60);
|
||||
int minute = minuteTime % 60;
|
||||
m.put("total", hours + "小时" + minute + "分钟");
|
||||
}
|
||||
return m;
|
||||
}).collect(Collectors.toList());
|
||||
String[] heads2 = {"所属单位", "工时总和"};
|
||||
String[] headsStr2 = {"enterpriseName", "total"};
|
||||
Map<String, Object> map2 = new HashMap<>(16);
|
||||
map2.put("heads", heads2);
|
||||
map2.put("headsStr", headsStr2);
|
||||
map2.put("dataList", list);
|
||||
map2.put("sheetName", "单位工时汇总");
|
||||
sheetList.add(map2);
|
||||
JxlExcelUtils.excelManySheetExport("考勤明细列表", sheetList, response);
|
||||
} catch (Exception e) {
|
||||
log.error("error:", e);
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.worker.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -21,7 +22,6 @@ import com.zhgd.xmgl.util.DateUtils;
|
||||
import com.zhgd.xmgl.util.EnvironmentUtil;
|
||||
import com.zhgd.xmgl.util.JxlExcelUtils;
|
||||
import com.zhgd.xmgl.util.ReflectUtils;
|
||||
import lombok.extern.log4j.Log4j;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
@ -31,6 +31,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -469,6 +470,49 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
||||
map3.put("dataList", dataList3);
|
||||
map3.put("sheetName", MapUtils.getString(map, "monthTime") + "工作时长汇总");
|
||||
sheetList.add(map3);
|
||||
|
||||
String[] heads4 = {"所属单位", "工时总和"};
|
||||
String[] headsStr4 = {"enterpriseName", "total"};
|
||||
Map<String, BigDecimal> dataList4Map = new HashMap<>();
|
||||
for (Map<String, Object> demo : durationList) {
|
||||
BigDecimal min = new BigDecimal("0");
|
||||
for (int i = 1; i <= maxDate; i++) {
|
||||
//1、正常 2、迟到 3、早退 4、加班5、缺卡
|
||||
if (demo.get("day" + i) != null) {
|
||||
if (Integer.valueOf(demo.get("day" + i).toString()) > 0) {
|
||||
int minuteTime = Integer.valueOf(demo.get("day" + i).toString()).intValue();
|
||||
min = NumberUtil.add(min, new BigDecimal(minuteTime));
|
||||
}
|
||||
}
|
||||
}
|
||||
String enterpriseName = MapUtils.getString(demo, "enterpriseName");
|
||||
BigDecimal d = dataList4Map.get(enterpriseName);
|
||||
if (d == null) {
|
||||
d = new BigDecimal("0");
|
||||
} else {
|
||||
d = NumberUtil.add(d, min);
|
||||
}
|
||||
dataList4Map.put("enterpriseName", d);
|
||||
}
|
||||
List<Map<String, Object>> dataList4 = dataList4Map.entrySet().stream().map(o -> {
|
||||
Map<String, Object> m = new HashMap<>();
|
||||
m.put("enterpriseName", o.getKey());
|
||||
int minuteTime = o.getValue().intValue();
|
||||
if (minuteTime == 0) {
|
||||
m.put("total", 0);
|
||||
} else {
|
||||
int hours = (int) Math.floor(minuteTime / 60);
|
||||
int minute = minuteTime % 60;
|
||||
m.put("total", hours + "小时" + minute + "分钟");
|
||||
}
|
||||
return m;
|
||||
}).collect(Collectors.toList());
|
||||
Map<String, Object> map4 = new HashMap<>(16);
|
||||
map4.put("heads", heads4);
|
||||
map4.put("headsStr", headsStr4);
|
||||
map4.put("dataList", dataList4);
|
||||
map4.put("sheetName", MapUtils.getString(map, "monthTime") + "单位工时汇总");
|
||||
sheetList.add(map4);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String excelName = "考勤统计-" + sdf.format(new Date());
|
||||
JxlExcelUtils.excelManySheetExport(excelName, sheetList, response);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user