201 lines
5.8 KiB
Plaintext
201 lines
5.8 KiB
Plaintext
package com.sercurityControl.proteam.service.impl;
|
|
|
|
import com.google.common.collect.Maps;
|
|
import com.securityControl.common.core.web.domain.AjaxResult;
|
|
import com.sercurityControl.proteam.domain.TeamData;
|
|
import com.sercurityControl.proteam.domain.dto.LoginDto;
|
|
import com.sercurityControl.proteam.domain.vo.StagingVo;
|
|
import com.sercurityControl.proteam.dutyTask.domain.NoticeVioEntity;
|
|
import com.sercurityControl.proteam.dutyTask.domain.TodayTaskVo;
|
|
import com.sercurityControl.proteam.dutyTask.domain.VoiInfoEntity;
|
|
import com.sercurityControl.proteam.mapper.StagingMapper;
|
|
import com.sercurityControl.proteam.service.StagingService;
|
|
import com.sercurityControl.proteam.util.DateTimeHelper;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
*工作台接口实现层
|
|
*/
|
|
@Service
|
|
@Slf4j
|
|
public class StagingServiceImpl implements StagingService {
|
|
|
|
|
|
@Autowired
|
|
private StagingMapper mapper;
|
|
|
|
/**
|
|
* 查询 当日施工班组状态
|
|
* @param loginDto
|
|
* @return
|
|
*/
|
|
@Override
|
|
public Map<String, Object> getWorkTeamList(LoginDto loginDto) {
|
|
Map<String,Object> map= Maps.newHashMap();
|
|
try{
|
|
List<TeamData> list=mapper.getWorkTeamList(loginDto);
|
|
map.put("code",200);
|
|
map.put("msg","success");
|
|
map.put("data",list);
|
|
}catch (Exception e){
|
|
map.put("code",201);
|
|
map.put("msg",e.toString());
|
|
map.put("data","err");
|
|
log.error(e.toString(),e);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* 今日施工计划数量
|
|
* @param loginDto
|
|
* @return
|
|
*/
|
|
@Override
|
|
public Map<String, Object> getWorkPlan(LoginDto loginDto) {
|
|
Map<String,Object> map= Maps.newHashMap();
|
|
try{
|
|
Integer planNum=mapper.getPlanNum(loginDto);//计划数量
|
|
Integer sgNum=mapper.getSgNum(loginDto);//施工数量
|
|
map.put("planNum",planNum);
|
|
map.put("sgNum",sgNum);
|
|
map.put("code",200);
|
|
map.put("msg","success");
|
|
}catch (Exception e){
|
|
map.put("planNum",0);
|
|
map.put("sgNum",0);
|
|
map.put("code",201);
|
|
map.put("msg",e.toString());
|
|
map.put("data","err");
|
|
log.error(e.toString(),e);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* 集合數據
|
|
* @param loginDto
|
|
* @return
|
|
*/
|
|
@Override
|
|
public Map<String, Object> getWorkPlanList(LoginDto loginDto) {
|
|
Map<String,Object> map= Maps.newHashMap();
|
|
|
|
String type=loginDto.getType();
|
|
switch (type){
|
|
case "1":
|
|
return plan(loginDto);//计划
|
|
case "2":
|
|
return construction(loginDto);//实施
|
|
default:
|
|
return plan(loginDto);
|
|
}
|
|
|
|
}
|
|
|
|
private Map<String, Object> construction(LoginDto loginDto) {
|
|
Map<String,Object> map= Maps.newHashMap();
|
|
try{
|
|
List<StagingVo> list=mapper.getConstruction(loginDto);
|
|
map.put("code",200);
|
|
map.put("msg","success");
|
|
map.put("data",list);
|
|
}catch (Exception e){
|
|
map.put("code",201);
|
|
map.put("msg",e.toString());
|
|
map.put("data","err");
|
|
log.error(e.toString(),e);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* 施工计划
|
|
* @param loginDto
|
|
* @return
|
|
*/
|
|
private Map<String, Object> plan(LoginDto loginDto) {
|
|
Map<String,Object> map= Maps.newHashMap();
|
|
try{
|
|
List<StagingVo> list=mapper.getPlanList(loginDto);
|
|
map.put("code",200);
|
|
map.put("msg","success");
|
|
map.put("data",list);
|
|
}catch (Exception e){
|
|
map.put("code",201);
|
|
map.put("msg",e.toString());
|
|
map.put("data","err");
|
|
log.error(e.toString(),e);
|
|
}
|
|
return map;
|
|
|
|
|
|
}
|
|
|
|
@Override
|
|
public AjaxResult getTodayTask(LoginDto loginDto) {
|
|
List<TodayTaskVo> list = new ArrayList<>();
|
|
loginDto.setStartTime(DateTimeHelper.getNowDate());
|
|
loginDto.setEndTime(DateTimeHelper.getNowDate());
|
|
try {
|
|
list = mapper.getTodayTask(loginDto);
|
|
} catch (Exception e) {
|
|
log.error("当日站班会",e);
|
|
}
|
|
return AjaxResult.success(list);
|
|
}
|
|
|
|
@Override
|
|
public AjaxResult getVoiList(LoginDto loginDto) {
|
|
List<NoticeVioEntity> list = new ArrayList<>();
|
|
try {
|
|
list = mapper.getVoiList(loginDto);
|
|
} catch (Exception e) {
|
|
log.error("违章信息",e);
|
|
}
|
|
return AjaxResult.success(list);
|
|
}
|
|
|
|
@Override
|
|
public AjaxResult getVoiNum(LoginDto loginDto) {
|
|
List<Integer> list = new ArrayList<>();
|
|
try {
|
|
list = mapper.getVoiNum(loginDto);
|
|
} catch (Exception e) {
|
|
log.error("违章信息",e);
|
|
list.add(0);
|
|
list.add(0);
|
|
}
|
|
return AjaxResult.success(list);
|
|
}
|
|
|
|
@Override
|
|
public AjaxResult isJobApplication(LoginDto loginDto) {
|
|
int result = 0;
|
|
try {
|
|
result = mapper.isJobApplication(loginDto);
|
|
} catch (Exception e) {
|
|
log.error("地市 每日是否报岗",e);
|
|
}
|
|
return AjaxResult.success(result);
|
|
}
|
|
|
|
@Override
|
|
public AjaxResult getVoiDataById(LoginDto loginDto) {
|
|
NoticeVioEntity noticeVioEntity = new NoticeVioEntity();
|
|
try {
|
|
noticeVioEntity = mapper.getVoiDataById(loginDto);
|
|
} catch (Exception e) {
|
|
log.error("根据ID获取违章信息",e);
|
|
}
|
|
return AjaxResult.success(noticeVioEntity);
|
|
}
|
|
}
|