|
@@ -133,6 +133,12 @@ public class CheckStandardServiceImpl extends BaseServiceImpl<CheckStandardMappe
|
|
|
return mapper.selectProjectStandardList(projectId);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询list,不包含图片和文件的
|
|
|
+ *
|
|
|
+ * @param record
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public List<CheckStandardVO> selectList(CheckStandardDTO record) {
|
|
|
List<CheckStandardVO> voList = mapper.selectList(record);
|
|
@@ -747,6 +753,54 @@ public class CheckStandardServiceImpl extends BaseServiceImpl<CheckStandardMappe
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 一次只能导入一个设备的
|
|
|
+ * 1:可以修改:id存在
|
|
|
+ * 2:可以删除:数据库查询出来的不在excel里面了
|
|
|
+ * 3:可以新增:id =null
|
|
|
+ *
|
|
|
+ * @param file
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public CheckStandardBatchDTO importReview(MultipartFile file) throws IOException {
|
|
|
+ List<ExportCheckStandardVO2> list = ExcelUtil.importExcel(file.getInputStream(), ExportCheckStandardVO2.class, 1);
|
|
|
+
|
|
|
+ List<String> sbNoList = list.stream().map(item -> item.getSbNo()).collect(Collectors.toList());
|
|
|
+ if (!CollectionUtils.isEmpty(sbNoList) && sbNoList.size() > 1) {
|
|
|
+ sbNoList = sbNoList.stream().distinct().collect(Collectors.toList());
|
|
|
+ if (!CollectionUtils.isEmpty(sbNoList) && sbNoList.size() > 1) {
|
|
|
+ throw new BusinessException("一次只能导致一个设备的标准");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ SbInfo sbInfo = BeanConverterUtil.copyObjectProperties(sbInfoMapper.getByNo(sbNoList.get(0)), SbInfo.class);
|
|
|
+
|
|
|
+ List<CheckStandardDTO> checkStandardDTOS = BeanConverterUtil.copyListProperties(list, CheckStandardDTO.class);
|
|
|
+ CheckStandardBatchDTO checkStandardBatchDTO = new CheckStandardBatchDTO();
|
|
|
+ checkStandardBatchDTO.setSbId(sbInfo.getId());
|
|
|
+ checkStandardBatchDTO.setList(checkStandardDTOS);
|
|
|
+ return checkStandardBatchDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询某个设备的保养标准列表:不带文件?
|
|
|
+ *
|
|
|
+ * @param sbId
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public CheckStandardBatchDTO getBatchBySbId(String sbId){
|
|
|
+ CheckStandardBatchDTO checkStandardBatchDTO = new CheckStandardBatchDTO();
|
|
|
+ checkStandardBatchDTO.setSbId(sbId);
|
|
|
+ CheckStandardDTO record = new CheckStandardDTO();
|
|
|
+ record.setSbId(sbId);
|
|
|
+ List<CheckStandardVO> list = selectList(record);
|
|
|
+ checkStandardBatchDTO.setList(BeanConverterUtil.copyListProperties(list, CheckStandardDTO.class));
|
|
|
+ return checkStandardBatchDTO;
|
|
|
+ }
|
|
|
/**
|
|
|
* 一次批量修改或者新增一个设备的保养标准
|
|
|
* 1:可以修改:id存在
|