xiongchao il y a 3 ans
Parent
commit
6408173f76

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/vo/export/check/ExportCheckJobVO.java

@@ -26,7 +26,7 @@ public class ExportCheckJobVO implements Serializable {
      * 设备新号
      */
     @Excel(name = "设备新号", orderNum = "2")
-    private String no;
+    private String sbNo;
     /**
      * 设备名称
      */

+ 4 - 4
platform-rest/src/main/java/com/platform/rest/controller/check/CheckJobController.java

@@ -136,17 +136,17 @@ public class CheckJobController {
     }
 
   /**
-     * 点检任务导出
+     * 任务导出
      *
      * @param checkJobDTO 点检任务DTO
      * @return R
      */
   @GetMapping("/export")
-  @SysLog("点检任务导出")
+  @SysLog("任务导出")
   @PreAuthorize("@pms.hasPermission('check-spot-jobs-export') or @pms.hasPermission('check-polling-jobs-export')")
   public void export(HttpServletResponse response, CheckJobDTO checkJobDTO) {
-    List<CheckJob> list = checkJobService.getModelListByDTO(checkJobDTO);
-    ExcelUtil.exportResponseDict(response, ExportCheckJobVO.class, BeanConverterUtil.copyListProperties(list, ExportCheckJobVO.class), "点检任务");
+    List<CheckJobVO> list = checkJobService.getVOListByDTO(checkJobDTO);
+    ExcelUtil.exportResponseDict(response, ExportCheckJobVO.class, BeanConverterUtil.copyListProperties(list, ExportCheckJobVO.class), "保养任务");
   }
 
   /**

+ 13 - 0
platform-rest/src/main/java/com/platform/rest/controller/sb/SbInfoController.java

@@ -26,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletResponse;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -63,6 +64,18 @@ public class SbInfoController {
         return new R<>(sbInfoService.getModelByModel(sbInfo));
     }
 
+    /**
+     * 批量查询记录
+     *
+     * @param ids
+     * @return R
+     */
+    @SysLog("批量查询设备基础信息")
+    @PostMapping("/code/batch")
+    public R getByIds(@RequestBody String[] ids) {
+        return new R<>(sbInfoService.getByIds(Arrays.asList(ids)));
+    }
+
     /**
      * 新增记录
      *

+ 1 - 0
platform-service/src/main/java/com/platform/service/check/CheckJobService.java

@@ -34,6 +34,7 @@ public interface CheckJobService extends IBaseService<CheckJob, CheckJobDTO> {
      */
     AbstractPageResultBean<CheckJobVO> selectPageList(CheckJobDTO record, int pageNum, int pageSize);
 
+    public List<CheckJobVO> getVOListByDTO(CheckJobDTO model);
     /**
      * 生成任务
      *

+ 28 - 0
platform-service/src/main/java/com/platform/service/check/impl/CheckJobServiceImpl.java

@@ -112,6 +112,34 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
          return BeanConverterUtil.copyListProperties(voList, CheckJob.class);
     }
 
+    @Override
+    public List<CheckJobVO> getVOListByDTO(CheckJobDTO model) {
+        if (model.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == model.getFilter().intValue()) {
+            UserInfo userInfo = SecurityUtils.getUserInfo();
+            model.setCheckUserId(userInfo.getUserId());
+        }
+        if(model.getSearchMonth() != null){
+            LocalDate firstDay = model.getSearchMonth().with(TemporalAdjusters.firstDayOfMonth());
+            LocalDate lastDay = model.getSearchMonth().with(TemporalAdjusters.lastDayOfMonth());
+            LocalTime.of(0,0,0);
+            //获取月的第一天0时0分0秒
+            LocalDateTime firstDayTime = LocalDateTime.of(firstDay, LocalTime.of(0,0,0));
+            //获取月的第一天0时0分0秒
+            LocalDateTime lastDayTime = LocalDateTime.of(lastDay, LocalTime.of(23,59,59));
+            model.setSearchStartTime(firstDayTime);
+            model.setSearchEndTime(lastDayTime);
+        }
+        if(model.getSearchDay() != null){
+            //获取月的第一天0时0分0秒
+            LocalDateTime firstDayTime = LocalDateTime.of(model.getSearchDay(), LocalTime.of(0,0,0));
+            //获取月的第一天0时0分0秒
+            LocalDateTime lastDayTime = LocalDateTime.of(model.getSearchDay(), LocalTime.of(59,59,59));
+            model.setSearchStartTime(firstDayTime);
+            model.setSearchEndTime(lastDayTime);
+        }
+        return mapper.selectList(model);
+    }
+
     @Override
     public AbstractPageResultBean<CheckJob> selectPageInfo(CheckJobDTO model, int pageNum, int pageSize) {
         if (model.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == model.getFilter().intValue()) {

+ 2 - 0
platform-service/src/main/java/com/platform/service/sb/SbInfoService.java

@@ -207,4 +207,6 @@ public interface SbInfoService extends IBaseService<SbInfo, SbInfoDTO> {
     void submitScrapAudit(SbInfoDTO sbInfoDTO);
 
     void audit(SbInfoDTO sbInfoDTO);
+
+    List<SbInfoVO> getByIds(List<String> ids);
 }

+ 38 - 0
platform-service/src/main/java/com/platform/service/sb/impl/SbInfoServiceImpl.java

@@ -985,6 +985,44 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
         mapper.updateByPrimaryKeySelective(sbInfo);
     }
 
+    /**
+     * 批量查询设备信息,进行贴码的处理,只需要
+     * 设备名称,型号名称,
+     * 分公司,项目部
+     * 资产编号,设备编号
+     *
+     * @param ids
+     * @return
+     */
+    @Override
+    public List<SbInfoVO> getByIds(List<String> ids) {
+
+        Weekend<SbInfo> weekend = new Weekend<>(SbInfo.class);
+        weekend.weekendCriteria().andIn(SbInfo::getId, ids);
+        List<SbInfo> list = mapper.selectByExample(weekend);
+        List<SbInfoVO> voList = BeanConverterUtil.copyListProperties(list, SbInfoVO.class);
+        List<SysDept> deptList = deptMapper.selectAll();
+        for(SbInfoVO vo:voList){
+            if (vo.getUseCompany() != null) {
+                deptList.forEach(sysDept -> {
+                    if (sysDept.getDeptId().equals(vo.getUseCompany())) {
+                        vo.setUseCompanyName(sysDept.getName());
+                        return;
+                    }
+                });
+            }
+            if (vo.getUseProject() != null) {
+                deptList.forEach(sysDept -> {
+                    if (sysDept.getDeptId().equals(vo.getUseProject())) {
+                        vo.setUseProjectName(sysDept.getName());
+                        return;
+                    }
+                });
+            }
+        }
+        return voList;
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String importListByAdd(MultipartFile file) {

+ 3 - 0
platform-service/src/main/java/com/platform/service/store/impl/InStoreFormServiceImpl.java

@@ -92,6 +92,9 @@ public class InStoreFormServiceImpl extends BaseServiceImpl<InStoreFormMapper, I
         BeanConverterUtil.copyObjectProperties(inStoreForm, inStoreFormVO);
         // 查询入库详情列表
         Store store = storeService.getModelById(inStoreFormVO.getStoreId());
+        if(store == null){
+            throw new BusinessException("仓库已经删除,无法查询;");
+        }
         inStoreFormVO.setStoreName(store.getName());
         inStoreFormVO.setDetailList(mapper.selectDetailList(id));
         return inStoreFormVO;