|
@@ -1,37 +1,24 @@
|
|
|
package org.eco.als.service.impl;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.mybatisflex.core.paginate.Page;
|
|
|
import com.mybatisflex.core.query.QueryWrapper;
|
|
|
+import jakarta.annotation.Resource;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.eco.common.core.core.domain.model.LoginUser;
|
|
|
-import org.eco.common.excel.entity.ExcelResultRes;
|
|
|
-import org.eco.common.excel.service.IExcelService;
|
|
|
-import org.eco.common.core.utils.bean.BeanUtils;
|
|
|
+import org.eco.als.domain.JudgeFaultLogic;
|
|
|
+import org.eco.als.domain.bo.JudgeFaultLogicBo;
|
|
|
+import org.eco.als.domain.vo.JudgeFaultLogicVo;
|
|
|
+import org.eco.als.mapper.JudgeFaultLogicMapper;
|
|
|
+import org.eco.als.service.IJudgeFaultLogicService;
|
|
|
+import org.eco.common.core.core.page.PageResult;
|
|
|
import org.eco.common.core.utils.MapstructUtils;
|
|
|
-import org.eco.system.service.IImportExportService;
|
|
|
-import org.eco.common.core.utils.StringUtils;
|
|
|
-import org.eco.system.domain.bo.ImportExportBo;
|
|
|
import org.eco.common.orm.core.page.PageQuery;
|
|
|
-import org.eco.common.core.core.page.PageResult;
|
|
|
import org.eco.common.orm.core.service.impl.BaseServiceImpl;
|
|
|
-import jakarta.annotation.Resource;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
-
|
|
|
-import org.eco.als.mapper.JudgeFaultLogicMapper;
|
|
|
-import org.eco.als.domain.JudgeFaultLogic;
|
|
|
-import org.eco.als.domain.bo.JudgeFaultLogicBo;
|
|
|
-import org.eco.als.domain.vo.JudgeFaultLogicVo;
|
|
|
-import org.eco.als.domain.vo.JudgeFaultLogicImportVo;
|
|
|
-import org.eco.als.listener.JudgeFaultLogicImportListener;
|
|
|
-import org.eco.als.service.IJudgeFaultLogicService;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
|
|
|
import static org.eco.als.domain.table.JudgeFaultLogicTableDef.JUDGE_FAULT_LOGIC;
|
|
|
|
|
@@ -47,12 +34,6 @@ public class JudgeFaultLogicServiceImpl extends BaseServiceImpl<JudgeFaultLogicM
|
|
|
@Resource
|
|
|
private JudgeFaultLogicMapper judgeFaultLogicMapper;
|
|
|
|
|
|
- @Resource
|
|
|
- private IExcelService excelService;
|
|
|
-
|
|
|
- @Resource
|
|
|
- private IImportExportService importExportService;
|
|
|
-
|
|
|
@Override
|
|
|
public QueryWrapper query() {
|
|
|
return super.query().from(JUDGE_FAULT_LOGIC);
|
|
@@ -64,6 +45,12 @@ public class JudgeFaultLogicServiceImpl extends BaseServiceImpl<JudgeFaultLogicM
|
|
|
(judgeFaultLogicBo.getKeyWord()));
|
|
|
queryWrapper.or(JUDGE_FAULT_LOGIC.HMC_CODE.like
|
|
|
(judgeFaultLogicBo.getKeyWord()));
|
|
|
+ queryWrapper.or(JUDGE_FAULT_LOGIC.NAME.like
|
|
|
+ (judgeFaultLogicBo.getKeyWord()));
|
|
|
+ queryWrapper.or(JUDGE_FAULT_LOGIC.SYS_NAME.like
|
|
|
+ (judgeFaultLogicBo.getKeyWord()));
|
|
|
+ queryWrapper.or(JUDGE_FAULT_LOGIC.REMARKS.like
|
|
|
+ (judgeFaultLogicBo.getKeyWord()));
|
|
|
|
|
|
return queryWrapper;
|
|
|
}
|
|
@@ -155,36 +142,11 @@ public class JudgeFaultLogicServiceImpl extends BaseServiceImpl<JudgeFaultLogicM
|
|
|
public boolean update(JudgeFaultLogicBo judgeFaultLogicBo) {
|
|
|
JudgeFaultLogic judgeFaultLogic = MapstructUtils.convert(judgeFaultLogicBo, JudgeFaultLogic.class);
|
|
|
if (ObjectUtil.isNotNull(judgeFaultLogic) && ObjectUtil.isNotNull(judgeFaultLogic.getId())) {
|
|
|
- boolean updated = this.updateById(judgeFaultLogic);
|
|
|
- return updated;
|
|
|
+ return this.updateById(judgeFaultLogic);
|
|
|
}
|
|
|
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, JudgeFaultLogicImportVo.class, new JudgeFaultLogicImportListener(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<JudgeFaultLogicVo> listVo, String sheetName, LoginUser loginUser) {
|
|
|
- ExcelResultRes result = excelService.exportExcel(listVo, sheetName, JudgeFaultLogicVo.class);
|
|
|
- boolean flag = importExportService.saveInfo(result, loginUser, "1");
|
|
|
- if (flag) {
|
|
|
- log.info("异步导出日志写入成功");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 批量删除判故逻辑
|
|
|
*
|