Merge remote-tracking branch 'origin/dunhuan_jdk8' into dunhuan_jdk8
This commit is contained in:
commit
3613777169
@ -37,6 +37,16 @@ public class TreeProjectVideoListVo {
|
|||||||
private VideoItem videoItem;
|
private VideoItem videoItem;
|
||||||
private ProjectVideoConfig projectVideoConfig;
|
private ProjectVideoConfig projectVideoConfig;
|
||||||
private List<TreeProjectVideoListVo> children;
|
private List<TreeProjectVideoListVo> children;
|
||||||
|
/**
|
||||||
|
*监控总数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("监控总数")
|
||||||
|
private Integer totalNum;
|
||||||
|
/**
|
||||||
|
*监控在线总数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("监控在线总数")
|
||||||
|
private Integer onlineNum;
|
||||||
/**
|
/**
|
||||||
* 监控类型枚举
|
* 监控类型枚举
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -108,7 +108,6 @@ import org.springframework.util.CollectionUtils;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@ -531,9 +530,46 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|||||||
String name = MapUtils.getString(map, "name");
|
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);
|
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());
|
rtVoList = rtVoList.stream().filter(v -> Objects.equals(v.getType(), TreeProjectVideoListVo.MonitorType.PROJECT.getCode())).collect(Collectors.toList());
|
||||||
|
for (TreeProjectVideoListVo vo : rtVoList) {
|
||||||
|
getAndSetTotalAndOnlineNum(vo);
|
||||||
|
}
|
||||||
return rtVoList;
|
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
|
@Override
|
||||||
public void saveZwProject(ZwProjectDataVo zwProjectDataVo) {
|
public void saveZwProject(ZwProjectDataVo zwProjectDataVo) {
|
||||||
Project project = new Project();
|
Project project = new Project();
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
group by a.id
|
group by a.id
|
||||||
</select>
|
</select>
|
||||||
<select id="selectOneWorkerAttendance" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
<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
|
FROM worker_attendance
|
||||||
WHERE person_sn = #{personSn}
|
WHERE person_sn = #{personSn}
|
||||||
AND is_statistics = 0
|
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(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(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
|
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
|
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}
|
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}
|
where a.project_sn=#{param.projectSn} and a.inService_type=#{param.inserviceType}
|
||||||
<if test="param.personType!=null and param.personType!=''">
|
<if test="param.personType!=null and param.personType!=''">
|
||||||
|
|||||||
@ -69,7 +69,9 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
|||||||
private GovtOpenApiService govtOpenApiService;
|
private GovtOpenApiService govtOpenApiService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private EnvironmentUtil environmentUtil;
|
private EnvironmentUtil environmentUtil;
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private IProjectConfigService projectConfigService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<EntityMap> selectMonthAttendanceByPage(Map<String, Object> map) {
|
public IPage<EntityMap> selectMonthAttendanceByPage(Map<String, Object> map) {
|
||||||
@ -141,7 +143,6 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
|||||||
return workerMonthAttendanceStatisticsMapper.getListByProjectSn(projectSn);
|
return workerMonthAttendanceStatisticsMapper.getListByProjectSn(projectSn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getMonthAttendanceStatistics(String inputTime) {
|
public void getMonthAttendanceStatistics(String inputTime) {
|
||||||
try {
|
try {
|
||||||
@ -531,10 +532,6 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Lazy
|
|
||||||
@Autowired
|
|
||||||
private IProjectConfigService projectConfigService;
|
|
||||||
|
|
||||||
//判断考勤情况
|
//判断考勤情况
|
||||||
public Map<String, Integer> getWorkerAttendanceType(String personSn, Long workerAttendanceRuleId, String passTime) {
|
public Map<String, Integer> getWorkerAttendanceType(String personSn, Long workerAttendanceRuleId, String passTime) {
|
||||||
int attendanceType = 0;
|
int attendanceType = 0;
|
||||||
|
|||||||
@ -30,8 +30,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -43,7 +43,7 @@ import java.util.stream.Collectors;
|
|||||||
* @create: 2021-11-11 18:48
|
* @create: 2021-11-11 18:48
|
||||||
**/
|
**/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Controller
|
@RestController
|
||||||
@RequestMapping("/xmgl/task/")
|
@RequestMapping("/xmgl/task/")
|
||||||
public class VideoTask {
|
public class VideoTask {
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user