99 lines
3.7 KiB
Plaintext
99 lines
3.7 KiB
Plaintext
package com.securityControl.task.service.impl;
|
|
|
|
import com.alibaba.nacos.common.utils.CollectionUtils;
|
|
import com.securityControl.task.domain.vo.DailyReportVo;
|
|
import com.securityControl.task.mapper.DailyReportMapper;
|
|
import com.securityControl.task.util.InterfaceUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 值班日报同步1、风险复测变化 2、新进班组 3、当日无施工班组 4.人数变化大的班组 5.存在工法变化数据 及统计作业票数量
|
|
*/
|
|
@Service(value = "DailyReportService")
|
|
public class DailyReportService {
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(DailyReportService.class);
|
|
|
|
@Resource(name = "DailyReportMapper")
|
|
private DailyReportMapper mapper;
|
|
|
|
|
|
public void addOrUpdateDailyReport(){
|
|
// 1.风险复测变化数量 2.新进班组数据 3.当日无施工班组数据 4.人数变化大数据 5.工法变化数量 6.执行中作业票 7.考勤人员
|
|
addOrUpdateDailyReport(1, "风险复测变化");
|
|
addOrUpdateDailyReport(2, "新进班组");
|
|
addOrUpdateDailyReport(3, "当日无施工班组");
|
|
addOrUpdateDailyReport(4, "人数变化大");
|
|
addOrUpdateDailyReport(5, "工法变化");
|
|
addOrUpdateDailyReport(6, "执行中作业票");
|
|
addOrUpdateDailyReport(7, "考勤人员");
|
|
}
|
|
|
|
|
|
/**
|
|
* @return void
|
|
* @author cw chen
|
|
* @description 根据类型获取2、新进班组 3、当日无施工班组 4.人数变化大的班组
|
|
* @Param type
|
|
* @date 2023-03-09 15:11
|
|
*/
|
|
|
|
|
|
public void addOrUpdateDailyReport(int type,String typeName) {
|
|
try {
|
|
if (type == 2 || type == 3 || type == 4) {
|
|
List<DailyReportVo> list = mapper.getDailyTeamList(type);
|
|
List<DailyReportVo> addList = mapper.getAddList(type);
|
|
List<DailyReportVo> delList = mapper.getDelList(type);
|
|
if (CollectionUtils.isEmpty(list) && CollectionUtils.isNotEmpty(addList)) {
|
|
addList.forEach(item -> {
|
|
addOrUpdateInfo(item, 1);
|
|
});
|
|
} else {
|
|
if (CollectionUtils.isNotEmpty(addList)) {
|
|
addList.forEach(item -> {
|
|
addOrUpdateInfo(item, 1);
|
|
});
|
|
}
|
|
if (CollectionUtils.isNotEmpty(delList)) {
|
|
delList.forEach(item -> {
|
|
addOrUpdateInfo(item, 2);
|
|
});
|
|
}
|
|
}
|
|
} else if(type == 1){ // 统计风险复测变化数量
|
|
int num = mapper.getRiskChangeNum();
|
|
mapper.updateTicketNum(num,2);
|
|
}else if(type == 5){ // 统计工法变化数量
|
|
int num = mapper.getConstrChangeNum();
|
|
mapper.updateTicketNum(num,3);
|
|
}else if(type == 6){ // 统计当日执行中作业票数量并入库
|
|
int num = mapper.getUnderTicketNum();
|
|
mapper.updateTicketNum(num,1);
|
|
}else if(type == 7){ // 统计当日考勤人数
|
|
String num = InterfaceUtils.getKqRyData();
|
|
mapper.updateTicketNum(Integer.parseInt(num),4);
|
|
}
|
|
} catch (Exception e) {
|
|
log.error("值班日报-" + typeName + "异常:", e);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @return void
|
|
* @author cw chen
|
|
* @description 更新数据
|
|
* @Param
|
|
* @date 2023-03-09 16:02
|
|
*/
|
|
public void addOrUpdateInfo(DailyReportVo vo,int type) {
|
|
mapper.addOrUpdateInfo(vo, type);
|
|
}
|
|
|
|
}
|