Merge remote-tracking branch 'origin/dunhuan_jdk8' into dunhuang
This commit is contained in:
commit
0b5791cd35
@ -108,7 +108,7 @@ public class Mcs8Call implements PoliceCameraManufacturer {
|
||||
JSONObject jsonObject = Mcs8Util.getRecordFileList(config, page, pageSize, begin, end, true);
|
||||
bos = BeanUtil.copyToList(jsonObject.getJSONArray("data"), Mcs8FileBo.class);
|
||||
for (Mcs8FileBo bo : bos) {
|
||||
if (!Objects.equals(bo.getFType(), 3)) {
|
||||
if (!Objects.equals(bo.getFType(),3)) {
|
||||
downloadFileAndSave(bo, cameraItemMap);
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,7 +36,8 @@ public class CrawlerCraneCurrentDataServiceImpl extends ServiceImpl<CrawlerCrane
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> windSpeedTrend(Map<String, Object> map) {
|
||||
if (MapUtils.getInteger(map, "selectType") == 1) {
|
||||
Integer selectType = MapUtils.getInteger(map, "selectType");
|
||||
if (selectType == 1) {
|
||||
map.put("reportTime_begin", DateUtil.formatDateTime(DateUtil.beginOfDay(new Date())));
|
||||
map.put("reportTime_end", DateUtil.formatDateTime(new Date()));
|
||||
}
|
||||
@ -44,9 +45,9 @@ public class CrawlerCraneCurrentDataServiceImpl extends ServiceImpl<CrawlerCrane
|
||||
List<CrawlerCraneCurrentData> list = this.list(queryWrapper);
|
||||
List<CrawlerCrane> crawlerCraneList = crawlerCraneService.list(Wrappers.<CrawlerCrane>lambdaQuery().eq(CrawlerCrane::getProjectSn, MapUtils.getString(map, "projectSn")));
|
||||
List<String> dayList;
|
||||
if (MapUtils.getInteger(map, "selectType") == 1) {
|
||||
if (selectType == 1) {
|
||||
dayList = DateUtils.getDateTimeStrList(100, "HH:mm");
|
||||
} else if (MapUtils.getInteger(map, "selectType") == 2){
|
||||
} else if (selectType == 2){
|
||||
dayList = DateUtils.getNowFewDaysAgoList(7);
|
||||
} else {
|
||||
dayList = DateUtils.getNowFewDaysAgoList(29);
|
||||
@ -56,7 +57,9 @@ public class CrawlerCraneCurrentDataServiceImpl extends ServiceImpl<CrawlerCrane
|
||||
Map<String, Object> deviceMap = new HashMap<>(16);
|
||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||
for (String day : dayList) {
|
||||
List<CrawlerCraneCurrentData> collect = list.stream().filter(l -> l.getDevSn().equals(crawlerCrane.getDevSn()) && DateUtil.formatDateTime(l.getReportTime()).contains(day)).collect(Collectors.toList());
|
||||
List<CrawlerCraneCurrentData> collect = list.stream().filter(l -> l.getDevSn().equals(crawlerCrane.getDevSn())
|
||||
&& ((selectType != 1 && DateUtil.formatDateTime(l.getReportTime()).contains(day))
|
||||
||(selectType == 1 && DateUtil.format(l.getReportTime(),"HH:00").equals(day)))).collect(Collectors.toList());
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
result.put("dayTitle", day);
|
||||
result.put("windSpeed", collect.size() > 0 ? collect.get(0).getWindSpeed() : 0);
|
||||
|
||||
@ -39,7 +39,8 @@ public class TruckCraneCurrentDataServiceImpl extends ServiceImpl<TruckCraneCurr
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> windSpeedTrend(Map<String, Object> map) {
|
||||
if (MapUtils.getInteger(map, "selectType") == 1) {
|
||||
Integer selectType = MapUtils.getInteger(map, "selectType");
|
||||
if (selectType == 1) {
|
||||
map.put("reportTime_begin", DateUtil.formatDateTime(DateUtil.beginOfDay(new Date())));
|
||||
map.put("reportTime_end", DateUtil.formatDateTime(new Date()));
|
||||
}
|
||||
@ -47,9 +48,9 @@ public class TruckCraneCurrentDataServiceImpl extends ServiceImpl<TruckCraneCurr
|
||||
List<TruckCraneCurrentData> list = this.list(queryWrapper);
|
||||
List<TruckCrane> truckCraneList = truckCraneService.list(Wrappers.<TruckCrane>lambdaQuery().eq(TruckCrane::getProjectSn, MapUtils.getString(map, "projectSn")));
|
||||
List<String> dayList;
|
||||
if (MapUtils.getInteger(map, "selectType") == 1) {
|
||||
if (selectType == 1) {
|
||||
dayList = DateUtils.getDateTimeStrList(100, "HH:mm");
|
||||
} else if (MapUtils.getInteger(map, "selectType") == 2){
|
||||
} else if (selectType == 2){
|
||||
dayList = DateUtils.getNowFewDaysAgoList(7);
|
||||
} else {
|
||||
dayList = DateUtils.getNowFewDaysAgoList(29);
|
||||
@ -59,7 +60,9 @@ public class TruckCraneCurrentDataServiceImpl extends ServiceImpl<TruckCraneCurr
|
||||
Map<String, Object> deviceMap = new HashMap<>(16);
|
||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||
for (String day : dayList) {
|
||||
List<TruckCraneCurrentData> collect = list.stream().filter(l -> l.getDevSn().equals(truckCrane.getDevSn()) && DateUtil.formatDateTime(l.getReportTime()).contains(day)).collect(Collectors.toList());
|
||||
List<TruckCraneCurrentData> collect = list.stream().filter(l -> l.getDevSn().equals(truckCrane.getDevSn())
|
||||
&& ((selectType != 1 && DateUtil.formatDateTime(l.getReportTime()).contains(day))
|
||||
||(selectType == 1 && DateUtil.format(l.getReportTime(),"HH:00").equals(day)))).collect(Collectors.toList());
|
||||
Map<String, Object> result = new HashMap<>(16);
|
||||
result.put("dayTitle", day);
|
||||
result.put("windSpeed", collect.size() > 0 ? collect.get(0).getWindSpeed() : 0);
|
||||
|
||||
@ -18,6 +18,7 @@ import com.zhgd.xmgl.modules.policecamera.entity.PoliceCameraGroup;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.PoliceCameraItem;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.ProjectPoliceCameraConfig;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.dto.PoliceCameraItemBatchMoveDto;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.CountWorkingHoursVo;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.GroupTreeWithDevVo;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.PoliceCameraItemVo;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.VideoItemInfoVo;
|
||||
@ -425,4 +426,15 @@ public class PoliceCameraItemController {
|
||||
policeCameraItemService.batchMove(dto);
|
||||
return Result.ok();
|
||||
}
|
||||
@ApiOperation(value = "统计执法记录仪每日工作时长", notes = "统计执法记录仪每日工作时长", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "itemId", value = "执法记录仪id", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "startDate", value = "开始日期(yyyy-MM-dd)", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "endDate", value = "结束日期(yyyy-MM-dd)", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping("/countWorkingHours")
|
||||
public Result<List<CountWorkingHoursVo>> countWorkingHours(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(policeCameraItemService.countWorkingHours(map));
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,5 +148,10 @@ public class PoliceCameraItem implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(value = "设备位置")
|
||||
private java.lang.String devLocation;
|
||||
/**
|
||||
* 默认码流类型:1、子码流,2、主码流,默认子码流
|
||||
*/
|
||||
@ApiModelProperty(value = "默认码流类型:1、子码流,2、主码流,默认子码流")
|
||||
private Integer defaultStreamType;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
package com.zhgd.xmgl.modules.policecamera.entity.vo;
|
||||
|
||||
import com.zhgd.xmgl.util.DateUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CountWorkingHoursVo implements DateUtils.DateAware {
|
||||
@ApiModelProperty(value = "工作时长中文显示")
|
||||
private String workingTimeName;
|
||||
/**
|
||||
*日期
|
||||
*/
|
||||
@ApiModelProperty("日期")
|
||||
private String date;
|
||||
/**
|
||||
* 文件时长
|
||||
*/
|
||||
@ApiModelProperty(value = "文件时长")
|
||||
private java.lang.Integer duration;
|
||||
}
|
||||
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.DataScope;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.PoliceCameraItem;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.CountWorkingHoursVo;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.PoliceCameraItemVo;
|
||||
import com.zhgd.xmgl.modules.xz.entity.vo.CountStatusVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -85,4 +86,6 @@ public interface PoliceCameraItemMapper extends BaseMapper<PoliceCameraItem> {
|
||||
* @return
|
||||
*/
|
||||
List<Long> getCameraItemIdListByTicketId(String ticketId);
|
||||
|
||||
List<CountWorkingHoursVo> countWorkingHours(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -91,4 +91,26 @@
|
||||
join work_ticket_camera_rel wtcr on wt.id = wtcr.work_ticket_id
|
||||
where wt.id = #{ticketId}
|
||||
</select>
|
||||
|
||||
<select id="countWorkingHours" resultType="com.zhgd.xmgl.modules.policecamera.entity.vo.CountWorkingHoursVo">
|
||||
select
|
||||
date_format(pcif.upload_time, '%Y-%m-%d') date
|
||||
,ifnull(round(sum(pcif.duration),2),0) duration
|
||||
from police_camera_item pci
|
||||
join police_camera_item_file pcif on pci.item_id = pcif.item_id
|
||||
where 1=1
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and pci.project_sn = #{projectSn}
|
||||
</if>
|
||||
<if test="itemId != null and itemId != ''">
|
||||
and pci.item_id = #{itemId}
|
||||
</if>
|
||||
<if test="startDate != null and startDate != ''">
|
||||
and pcif.upload_time >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
and pcif.upload_time <![CDATA[<=]]> concat(#{endDate},' 23:59:59')
|
||||
</if>
|
||||
group by date
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.PoliceCameraItem;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.dto.PoliceCameraItemBatchMoveDto;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.CountWorkingHoursVo;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.PoliceCameraItemVo;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.VideoItemInfoVo;
|
||||
import com.zhgd.xmgl.modules.xz.entity.vo.CountStatusVo;
|
||||
@ -105,4 +106,6 @@ public interface IPoliceCameraItemService extends IService<PoliceCameraItem> {
|
||||
List<PoliceCameraItem> getListByProjectSn(String projectSn);
|
||||
|
||||
void batchMove(PoliceCameraItemBatchMoveDto dto);
|
||||
|
||||
List<CountWorkingHoursVo> countWorkingHours(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -21,6 +21,11 @@ import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.*;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.dto.PoliceCameraItemBatchMoveDto;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.PoliceCameraItem;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.PoliceCameraVideoConfig;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.ProjectPoliceCameraConfig;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.WorkTicketCameraRel;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.CountWorkingHoursVo;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.PoliceCameraItemVo;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.VideoItemInfoVo;
|
||||
import com.zhgd.xmgl.modules.policecamera.entity.vo.VideoItemInfoVo.VideoInfo;
|
||||
@ -369,4 +374,15 @@ public class PoliceCameraItemServiceImpl extends ServiceImpl<PoliceCameraItemMap
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CountWorkingHoursVo> countWorkingHours(Map<String, Object> map) {
|
||||
List<CountWorkingHoursVo> hoursVos = baseMapper.countWorkingHours(map);
|
||||
for (CountWorkingHoursVo hoursVo : hoursVos) {
|
||||
hoursVo.setWorkingTimeName(TimeUtil.toHourMinSecond(hoursVo.getDuration()));
|
||||
}
|
||||
Map<String, CountWorkingHoursVo> hoursVoMap = hoursVos.stream().collect(Collectors.toMap(CountWorkingHoursVo::getDate, Function.identity(), (o1, o2) -> o1));
|
||||
hoursVos = DateUtils.fillDateByStartEndDate(map, hoursVoMap, CountWorkingHoursVo::new);
|
||||
return hoursVos;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -357,6 +357,13 @@ public class Project implements Serializable {
|
||||
private String jntxAppKey;
|
||||
@ApiModelProperty(value = "济南拓兴appSecret")
|
||||
private String jntxAppSecret;
|
||||
/**
|
||||
* 桥梁长度(m)
|
||||
*/
|
||||
@Excel(name = "桥梁长度(m)", width = 15)
|
||||
@ApiModelProperty(value = "桥梁长度(m)")
|
||||
private java.lang.String bridgeLength;
|
||||
|
||||
/**
|
||||
* runde平台token
|
||||
*/
|
||||
|
||||
@ -76,4 +76,9 @@ public class ProjectConfig implements Serializable {
|
||||
private java.lang.Integer workTicketBindCamera;
|
||||
@ApiModelProperty(value = "1开启人脸录入时的人脸检测识别功能0不开启")
|
||||
private java.lang.Integer enableWorkerFaceCheck;
|
||||
/**
|
||||
* worker_month_attendance统计考勤时是否忽略员工打卡时的“进/出”方向标识,1忽略0不忽略
|
||||
*/
|
||||
@ApiModelProperty(value = "worker_month_attendance统计考勤时是否忽略员工打卡时的“进/出”方向标识,1忽略0不忽略")
|
||||
private java.lang.Integer ignoreWorkerMonthAttendanceInOut;
|
||||
}
|
||||
|
||||
@ -37,6 +37,16 @@ public class TreeProjectVideoListVo {
|
||||
private VideoItem videoItem;
|
||||
private ProjectVideoConfig projectVideoConfig;
|
||||
private List<TreeProjectVideoListVo> children;
|
||||
/**
|
||||
*监控总数
|
||||
*/
|
||||
@ApiModelProperty("监控总数")
|
||||
private Integer totalNum;
|
||||
/**
|
||||
*监控在线总数
|
||||
*/
|
||||
@ApiModelProperty("监控在线总数")
|
||||
private Integer onlineNum;
|
||||
/**
|
||||
* 监控类型枚举
|
||||
*/
|
||||
|
||||
@ -108,7 +108,6 @@ import org.springframework.util.CollectionUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@ -532,9 +531,46 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
||||
String name = MapUtils.getString(map, "name");
|
||||
List<TreeProjectVideoListVo> rtVoList = BeanUtil.copyToList(TreeUtils.listToTree(JSONArray.parseArray(JSON.toJSONString(voList)), "id", "parentId", "children", "name", name), TreeProjectVideoListVo.class);
|
||||
rtVoList = rtVoList.stream().filter(v -> Objects.equals(v.getType(), TreeProjectVideoListVo.MonitorType.PROJECT.getCode())).collect(Collectors.toList());
|
||||
for (TreeProjectVideoListVo vo : rtVoList) {
|
||||
getAndSetTotalAndOnlineNum(vo);
|
||||
}
|
||||
return rtVoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归统计总数和在线视频监控数量
|
||||
*
|
||||
* @param vo
|
||||
* @return 包含totalNum和onlineNum的Map
|
||||
*/
|
||||
public static Map<String, Integer> getAndSetTotalAndOnlineNum(TreeProjectVideoListVo vo) {
|
||||
Map<String, Integer> result = new HashMap<>();
|
||||
int totalNum = 0;
|
||||
int onlineNum = 0;
|
||||
if (Objects.equals(vo.getType(), TreeProjectVideoListVo.MonitorType.VIDEO.getCode())) {
|
||||
totalNum = 1;
|
||||
if (Objects.equals(vo.getVideoItem().getDeviceState(), 1)) {
|
||||
onlineNum = 1;
|
||||
}
|
||||
}
|
||||
// 递归处理子节点
|
||||
List<TreeProjectVideoListVo> children = vo.getChildren();
|
||||
if (CollUtil.isNotEmpty(children)) {
|
||||
for (int i = 0; i < children.size(); i++) {
|
||||
TreeProjectVideoListVo child = children.get(i);
|
||||
Map<String, Integer> childStats = getAndSetTotalAndOnlineNum(child);
|
||||
// 累加子节点的统计结果
|
||||
totalNum += childStats.getOrDefault("totalNum", 0);
|
||||
onlineNum += childStats.getOrDefault("onlineNum", 0);
|
||||
}
|
||||
}
|
||||
result.put("totalNum", totalNum);
|
||||
result.put("onlineNum", onlineNum);
|
||||
vo.setTotalNum(totalNum);
|
||||
vo.setOnlineNum(onlineNum);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveZwProject(ZwProjectDataVo zwProjectDataVo) {
|
||||
Project project = new Project();
|
||||
|
||||
@ -19,7 +19,10 @@
|
||||
left join worker_info_to_ai_analyse_hard_ware_alarm_record witaahwar on a.id =
|
||||
witaahwar.ai_analyse_hard_ware_alarm_record_id
|
||||
left join worker_info wi on wi.id = witaahwar.worker_info_id
|
||||
WHERE a.project_sn = #{param.projectSn}
|
||||
WHERE 1=1
|
||||
<if test="param.projectSn != null and param.projectSn != ''">
|
||||
and a.project_sn = #{param.projectSn}
|
||||
</if>
|
||||
<if test="param.handleResult != null">
|
||||
and a.handle_result = #{param.handleResult}
|
||||
</if>
|
||||
@ -110,7 +113,10 @@
|
||||
IFNULL(SUM((CASE WHEN a.alarm_type = 6 THEN 1 ELSE 0 END)), 0) alarmTypeNum6,
|
||||
IFNULL(SUM((CASE WHEN a.alarm_type = 7 THEN 1 ELSE 0 END)), 0) alarmTypeNum7
|
||||
FROM ai_analyse_hard_ware_alarm_record a
|
||||
where a.project_sn = #{projectSn}
|
||||
where 1=1
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and a.project_sn = #{projectSn}
|
||||
</if>
|
||||
<include refid="queryAlarmTime">
|
||||
</include>
|
||||
<if test="selectType == '1'.toString() or selectType == '2'.toString()">
|
||||
@ -161,7 +167,9 @@
|
||||
where 1=1
|
||||
<include refid="queryAlarmTime">
|
||||
</include>
|
||||
and a.project_sn = #{projectSn}
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and a.project_sn = #{projectSn}
|
||||
</if>
|
||||
group by a.alarm_type
|
||||
order by count desc
|
||||
</select>
|
||||
@ -176,7 +184,9 @@
|
||||
ifnull(sum(if(a.create_time >= DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00'),1,0)),0) as todayAlarmNum
|
||||
FROM ai_analyse_hard_ware_alarm_record a
|
||||
where 1=1
|
||||
and a.project_sn = #{projectSn}
|
||||
<if test="projectSn != null and projectSn != ''">
|
||||
and a.project_sn = #{projectSn}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectAiAnalyseHardWareAlarmTypeCount"
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
group by a.id
|
||||
</select>
|
||||
<select id="selectOneWorkerAttendance" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT pass_type, create_time
|
||||
SELECT pass_type, create_time, project_sn
|
||||
FROM worker_attendance
|
||||
WHERE person_sn = #{personSn}
|
||||
AND is_statistics = 0
|
||||
|
||||
@ -11,7 +11,12 @@
|
||||
IF(29>DAY(last_day(str_to_date(CONCAT(#{param.monthTime},'-01'),'%Y-%m-%d'))),NULL,day29) day29,
|
||||
IF(30>DAY(last_day(str_to_date(CONCAT(#{param.monthTime},'-01'),'%Y-%m-%d'))),NULL,day30) day30,
|
||||
IF(31>DAY(last_day(str_to_date(CONCAT(#{param.monthTime},'-01'),'%Y-%m-%d'))),NULL,day31) day31
|
||||
,a.enterprise_id enterprise_id
|
||||
,if(a.person_type=1,b.id,c1.id) dept_id
|
||||
,a.id worker_id
|
||||
from worker_info a
|
||||
LEFT JOIN team_info b ON a.team_id = b.id and a.person_type=1
|
||||
LEFT JOIN department_info c1 ON a.department_id = c1.id and a.person_type=2
|
||||
LEFT JOIN worker_month_attendance_statistics c ON a.person_sn=c.person_sn AND c.query_time=#{param.monthTime}
|
||||
where a.project_sn=#{param.projectSn} and a.inService_type=#{param.inserviceType}
|
||||
<if test="param.personType!=null and param.personType!=''">
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.worker.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -10,7 +11,9 @@ import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl;
|
||||
import com.zhgd.xmgl.modules.govtapi.GovtOpenApiService;
|
||||
import com.zhgd.xmgl.modules.project.entity.Project;
|
||||
import com.zhgd.xmgl.modules.project.entity.ProjectConfig;
|
||||
import com.zhgd.xmgl.modules.project.mapper.ProjectMapper;
|
||||
import com.zhgd.xmgl.modules.project.service.IProjectConfigService;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerAttendanceRule;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerMonthAttendanceDuration;
|
||||
@ -21,7 +24,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;
|
||||
@ -67,7 +69,9 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
||||
private GovtOpenApiService govtOpenApiService;
|
||||
@Autowired
|
||||
private EnvironmentUtil environmentUtil;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IProjectConfigService projectConfigService;
|
||||
|
||||
@Override
|
||||
public IPage<EntityMap> selectMonthAttendanceByPage(Map<String, Object> map) {
|
||||
@ -139,7 +143,6 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
||||
return workerMonthAttendanceStatisticsMapper.getListByProjectSn(projectSn);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getMonthAttendanceStatistics(String inputTime) {
|
||||
try {
|
||||
@ -529,7 +532,6 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//判断考勤情况
|
||||
public Map<String, Integer> getWorkerAttendanceType(String personSn, Long workerAttendanceRuleId, String passTime) {
|
||||
int attendanceType = 0;
|
||||
@ -562,11 +564,14 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
||||
//结果集按时间DESC
|
||||
List<EntityMap> list = workerAttendanceMapper.selectOneWorkerAttendance(param);
|
||||
if (list != null && !list.isEmpty()) {
|
||||
ProjectConfig config = projectConfigService.getOne(new LambdaQueryWrapper<ProjectConfig>()
|
||||
.eq(ProjectConfig::getProjectSn, list.get(0).get("projectSn")));
|
||||
boolean ignoreInOut = config != null && Objects.equals(config.getIgnoreWorkerMonthAttendanceInOut(), 1);
|
||||
String maxTime = null;
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
EntityMap map = list.get(i);
|
||||
//2:出
|
||||
if (map.get("passType") != null && map.get("createTime") != null && NumberUtils.toInt(map.get("passType").toString()) == 2) {
|
||||
if (map.get("createTime") != null && (ignoreInOut || (map.get("passType") != null && NumberUtils.toInt(map.get("passType").toString()) == 2))) {
|
||||
maxTime = map.get("createTime").toString();
|
||||
break;
|
||||
}
|
||||
@ -575,9 +580,11 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
||||
for (int i = (list.size() - 1); i >= 0; i--) {
|
||||
Map<String, Object> map = list.get(i);
|
||||
//1:进
|
||||
if (map.get("passType") != null && map.get("createTime") != null && NumberUtils.toInt(map.get("passType").toString()) == 1) {
|
||||
minTime = map.get("createTime").toString();
|
||||
break;
|
||||
if (map.get("createTime") != null && (ignoreInOut || (map.get("passType") != null && NumberUtils.toInt(map.get("passType").toString()) == 1))) {
|
||||
if (!Objects.equals(maxTime, map.get("createTime").toString())) {
|
||||
minTime = map.get("createTime").toString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
String startTimes = null;
|
||||
|
||||
@ -30,8 +30,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -43,7 +43,7 @@ import java.util.stream.Collectors;
|
||||
* @create: 2021-11-11 18:48
|
||||
**/
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/task/")
|
||||
public class VideoTask {
|
||||
@Autowired
|
||||
|
||||
@ -791,7 +791,7 @@ public class DateUtils {
|
||||
* @param paramMap
|
||||
* @param dateMap
|
||||
* @param instanceSupplier
|
||||
* @param <T>
|
||||
* @param <T> 类要实现DateAware
|
||||
* @return
|
||||
*/
|
||||
public static <T extends DateAware> List<T> fillDateByStartEndDate(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user