|
@@ -12,18 +12,14 @@ import jakarta.annotation.Resource;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.eco.als.domain.FaultStatistics;
|
|
import org.eco.als.domain.FaultStatistics;
|
|
import org.eco.als.domain.bo.FaultStatisticsBo;
|
|
import org.eco.als.domain.bo.FaultStatisticsBo;
|
|
-import org.eco.als.domain.vo.FaultStatisticsImportVo;
|
|
|
|
import org.eco.als.domain.vo.FaultStatisticsVo;
|
|
import org.eco.als.domain.vo.FaultStatisticsVo;
|
|
import org.eco.als.domain.vo.FaultStatisticsWbVo;
|
|
import org.eco.als.domain.vo.FaultStatisticsWbVo;
|
|
-import org.eco.als.listener.FaultStatisticsImportListener;
|
|
|
|
import org.eco.als.mapper.FaultStatisticsMapper;
|
|
import org.eco.als.mapper.FaultStatisticsMapper;
|
|
import org.eco.als.service.IFaultStatisticsService;
|
|
import org.eco.als.service.IFaultStatisticsService;
|
|
-import org.eco.common.core.core.domain.model.LoginUser;
|
|
|
|
import org.eco.common.core.core.page.PageResult;
|
|
import org.eco.common.core.core.page.PageResult;
|
|
import org.eco.common.core.exception.BusinessException;
|
|
import org.eco.common.core.exception.BusinessException;
|
|
import org.eco.common.core.utils.HttpUtils;
|
|
import org.eco.common.core.utils.HttpUtils;
|
|
import org.eco.common.core.utils.MapstructUtils;
|
|
import org.eco.common.core.utils.MapstructUtils;
|
|
-import org.eco.common.excel.entity.ExcelResultRes;
|
|
|
|
import org.eco.common.excel.service.IExcelService;
|
|
import org.eco.common.excel.service.IExcelService;
|
|
import org.eco.common.orm.core.page.PageQuery;
|
|
import org.eco.common.orm.core.page.PageQuery;
|
|
import org.eco.common.orm.core.service.impl.BaseServiceImpl;
|
|
import org.eco.common.orm.core.service.impl.BaseServiceImpl;
|
|
@@ -31,9 +27,7 @@ import org.eco.system.service.IImportExportService;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
import static org.eco.als.domain.table.FaultStatisticsTableDef.FAULT_STATISTICS;
|
|
import static org.eco.als.domain.table.FaultStatisticsTableDef.FAULT_STATISTICS;
|
|
@@ -153,7 +147,8 @@ public class FaultStatisticsServiceImpl extends BaseServiceImpl<FaultStatisticsM
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<FaultStatisticsVo> getExtraStatistics() {
|
|
public List<FaultStatisticsVo> getExtraStatistics() {
|
|
-// this.remove()
|
|
|
|
|
|
+ int count = faultStatisticsMapper.deleteByCondition(FAULT_STATISTICS.CREATE_TIME.lt(DateUtil.date()));
|
|
|
|
+ log.info("删除数据条数:{}", count);
|
|
String pageNo = "1";
|
|
String pageNo = "1";
|
|
JSONArray rows = getStatisticsData(pageNo);
|
|
JSONArray rows = getStatisticsData(pageNo);
|
|
while (CollUtil.isNotEmpty(rows)) {
|
|
while (CollUtil.isNotEmpty(rows)) {
|
|
@@ -165,7 +160,6 @@ public class FaultStatisticsServiceImpl extends BaseServiceImpl<FaultStatisticsM
|
|
}
|
|
}
|
|
|
|
|
|
private JSONArray getStatisticsData(String pageNo) {
|
|
private JSONArray getStatisticsData(String pageNo) {
|
|
- int count = faultStatisticsMapper.deleteByCondition(FAULT_STATISTICS.CREATE_TIME.lt(DateUtil.date()));
|
|
|
|
Map<String, String> map = new HashMap<>();
|
|
Map<String, String> map = new HashMap<>();
|
|
map.put("pager.pageNo", pageNo);
|
|
map.put("pager.pageNo", pageNo);
|
|
map.put("pager.pageSize", "1000");
|
|
map.put("pager.pageSize", "1000");
|
|
@@ -227,7 +221,6 @@ public class FaultStatisticsServiceImpl extends BaseServiceImpl<FaultStatisticsM
|
|
@Override
|
|
@Override
|
|
public boolean insert(FaultStatisticsBo faultStatisticsBo) {
|
|
public boolean insert(FaultStatisticsBo faultStatisticsBo) {
|
|
FaultStatistics faultStatistics = MapstructUtils.convert(faultStatisticsBo, FaultStatistics.class);
|
|
FaultStatistics faultStatistics = MapstructUtils.convert(faultStatisticsBo, FaultStatistics.class);
|
|
-
|
|
|
|
return this.save(faultStatistics);//使用全局配置的雪花算法主键生成器生成ID值
|
|
return this.save(faultStatistics);//使用全局配置的雪花算法主键生成器生成ID值
|
|
}
|
|
}
|
|
|
|
|
|
@@ -235,7 +228,7 @@ public class FaultStatisticsServiceImpl extends BaseServiceImpl<FaultStatisticsM
|
|
public boolean saveBatch(List<FaultStatisticsBo> faultStatisticsBos) {
|
|
public boolean saveBatch(List<FaultStatisticsBo> faultStatisticsBos) {
|
|
List<FaultStatistics> faultStatisticsList = new ArrayList<>();
|
|
List<FaultStatistics> faultStatisticsList = new ArrayList<>();
|
|
faultStatisticsBos.forEach(faultStatisticsBo -> faultStatisticsList.add(MapstructUtils.convert(faultStatisticsBo, FaultStatistics.class)));
|
|
faultStatisticsBos.forEach(faultStatisticsBo -> faultStatisticsList.add(MapstructUtils.convert(faultStatisticsBo, FaultStatistics.class)));
|
|
- return this.saveBatch(faultStatisticsList, 500);
|
|
|
|
|
|
+ return this.saveBatch(faultStatisticsList, 100);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -247,8 +240,6 @@ public class FaultStatisticsServiceImpl extends BaseServiceImpl<FaultStatisticsM
|
|
@Override
|
|
@Override
|
|
public boolean insertWithPk(FaultStatisticsBo faultStatisticsBo) {
|
|
public boolean insertWithPk(FaultStatisticsBo faultStatisticsBo) {
|
|
FaultStatistics faultStatistics = MapstructUtils.convert(faultStatisticsBo, FaultStatistics.class);
|
|
FaultStatistics faultStatistics = MapstructUtils.convert(faultStatisticsBo, FaultStatistics.class);
|
|
-
|
|
|
|
-
|
|
|
|
return faultStatisticsMapper.insertWithPk(faultStatistics) > 0;//前台传来主键值
|
|
return faultStatisticsMapper.insertWithPk(faultStatistics) > 0;//前台传来主键值
|
|
}
|
|
}
|
|
|
|
|
|
@@ -262,36 +253,11 @@ public class FaultStatisticsServiceImpl extends BaseServiceImpl<FaultStatisticsM
|
|
public boolean update(FaultStatisticsBo faultStatisticsBo) {
|
|
public boolean update(FaultStatisticsBo faultStatisticsBo) {
|
|
FaultStatistics faultStatistics = MapstructUtils.convert(faultStatisticsBo, FaultStatistics.class);
|
|
FaultStatistics faultStatistics = MapstructUtils.convert(faultStatisticsBo, FaultStatistics.class);
|
|
if (ObjectUtil.isNotNull(faultStatistics) && ObjectUtil.isNotNull(faultStatistics.getId())) {
|
|
if (ObjectUtil.isNotNull(faultStatistics) && ObjectUtil.isNotNull(faultStatistics.getId())) {
|
|
- boolean updated = this.updateById(faultStatistics);
|
|
|
|
- return updated;
|
|
|
|
|
|
+ return this.updateById(faultStatistics);
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public void asyncImportData(MultipartFile file, boolean updateSupport, LoginUser loginUser) {
|
|
|
|
- ExcelResultRes result;
|
|
|
|
- try {
|
|
|
|
- String name = file.getOriginalFilename();
|
|
|
|
- result = excelService.importExcel(file.getInputStream(), name, FaultStatisticsImportVo.class, new FaultStatisticsImportListener(updateSupport, loginUser));
|
|
|
|
- } catch (IOException e) {
|
|
|
|
- throw new RuntimeException(e);
|
|
|
|
- }
|
|
|
|
- boolean flag = importExportService.saveInfo(result, loginUser, "0");
|
|
|
|
- if (flag) {
|
|
|
|
- log.info("异步导入日志写入成功");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void asyncExport(List<FaultStatisticsVo> listVo, String sheetName, LoginUser loginUser) {
|
|
|
|
- ExcelResultRes result = excelService.exportExcel(listVo, sheetName, FaultStatisticsVo.class);
|
|
|
|
- boolean flag = importExportService.saveInfo(result, loginUser, "1");
|
|
|
|
- if (flag) {
|
|
|
|
- log.info("异步导出日志写入成功");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 批量删除故障统计
|
|
* 批量删除故障统计
|
|
*
|
|
*
|
|
@@ -303,81 +269,4 @@ public class FaultStatisticsServiceImpl extends BaseServiceImpl<FaultStatisticsM
|
|
public boolean deleteByIds(Long[] ids) {
|
|
public boolean deleteByIds(Long[] ids) {
|
|
return this.removeByIds(Arrays.asList(ids));
|
|
return this.removeByIds(Arrays.asList(ids));
|
|
}
|
|
}
|
|
-
|
|
|
|
- public void get() {
|
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
|
- map.put("id", "8uijkmnbhgty56tyhji89iujk");
|
|
|
|
- map.put("gzbs", "iujkgfretgfhjkijm");
|
|
|
|
- map.put("gzpcxxbs", "8uijkmnbhgty56tyhji89iujk");
|
|
|
|
- map.put("havepcxx", "1");
|
|
|
|
- map.put("sjc", "2025-01-06 09:00:00");
|
|
|
|
- map.put("dwid", "1212304");
|
|
|
|
- map.put("dwbm", "1212304");
|
|
|
|
- map.put("scbz", "0");
|
|
|
|
- map.put("是否历史", "否");
|
|
|
|
- map.put("日期", "2025-01-03");
|
|
|
|
- map.put("战区", "中部空军");
|
|
|
|
- map.put("军", "武汉基地");
|
|
|
|
- map.put("师", null);
|
|
|
|
- map.put("团", "空77旅");
|
|
|
|
- map.put("中队", "机务77中队");
|
|
|
|
- map.put("飞机号", "789456");
|
|
|
|
- map.put("机型", "J10");
|
|
|
|
- map.put("出厂号码", "CB778899");
|
|
|
|
- map.put("机件类型", "飞机");
|
|
|
|
- map.put("机件号", null);
|
|
|
|
- map.put("机件型别", "J10");
|
|
|
|
- map.put("机件名称", null);
|
|
|
|
- map.put("起落", null);
|
|
|
|
- map.put("专业", "电子");
|
|
|
|
- map.put("发动机序号", null);
|
|
|
|
- map.put("发动机型别", null);
|
|
|
|
- map.put("发动机号码", null);
|
|
|
|
- map.put("故障现象", "xxxxxxxxx发生故障");
|
|
|
|
- map.put("故障发生地点", "大海");
|
|
|
|
- map.put("发现时机", "启动前");
|
|
|
|
- map.put("故障件名称", "xxx单元");
|
|
|
|
- map.put("故障件型别", "D/SHG-12");
|
|
|
|
- map.put("故障件位置", "");
|
|
|
|
- map.put("系统", "XXX综合系统");
|
|
|
|
- map.put("计时类型", "");
|
|
|
|
- map.put("故障件号码", "22-88-041");
|
|
|
|
- map.put("制造厂1", "xx厂");
|
|
|
|
- map.put("工作时次1", "20");
|
|
|
|
- map.put("翻修厂1", null);
|
|
|
|
- map.put("故换件号码", "55-55-021");
|
|
|
|
- map.put("故换件型别", "D/YSH-01");
|
|
|
|
- map.put("制造厂2", "xx厂");
|
|
|
|
- map.put("工作时次2", "20");
|
|
|
|
- map.put("翻修厂2", null);
|
|
|
|
- map.put("故障失常码", "A001:功能失效");
|
|
|
|
- map.put("故障件装机日期", "2025-01-01");
|
|
|
|
- map.put("故障原因", "xxxxxx电路故障");
|
|
|
|
- map.put("故障性质", "一般故障");
|
|
|
|
- map.put("故障责任", "制造");
|
|
|
|
- map.put("故障后果", "未影响");
|
|
|
|
- map.put("故障次数", null);
|
|
|
|
- map.put("误飞次数", null);
|
|
|
|
- map.put("判明方法", "通电");
|
|
|
|
- map.put("发现人", "xxx");
|
|
|
|
- map.put("排除方法", "更换");
|
|
|
|
- map.put("排故人", "XXX");
|
|
|
|
- map.put("审核人", "XXX");
|
|
|
|
- map.put("审核时间", "XXX");
|
|
|
|
- map.put("排除日期", "2025-01-01");
|
|
|
|
- map.put("排故工时", "44:44:44");
|
|
|
|
- map.put("排除人数", "2");
|
|
|
|
- map.put("排故时间", "2:00:00");
|
|
|
|
- map.put("是否立功", "否");
|
|
|
|
- map.put("需要试飞", "否");
|
|
|
|
- map.put("故障件工作时次_全部", "");
|
|
|
|
- map.put("故障件修后时次_全部", "");
|
|
|
|
- map.put("故换件工作时次_全部", "");
|
|
|
|
- map.put("故换件修后时次_全部", "");
|
|
|
|
- map.put("备注", "");
|
|
|
|
- map.put("处理意见", null);
|
|
|
|
- map.put("装本机工作时次", "20");
|
|
|
|
- map.put("sffdjgz", "0");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
}
|
|
}
|