|
@@ -13,7 +13,6 @@ import com.lantone.daqe.dto.ExportImportDrugErrDTO;
|
|
|
import com.lantone.daqe.dto.GetDrugPageDTO;
|
|
|
import com.lantone.daqe.dto.GetMatchingDrugPageDTO;
|
|
|
import com.lantone.daqe.entity.DrugInfo;
|
|
|
-import com.lantone.daqe.entity.OperationInfo;
|
|
|
import com.lantone.daqe.facade.base.DrugInfoFacade;
|
|
|
import com.lantone.daqe.service.impl.DrugInfoServiceImpl;
|
|
|
import com.lantone.daqe.util.ExcelUtils;
|
|
@@ -117,10 +116,7 @@ public class DrugManagementFacade {
|
|
|
* @return 是否删除成功
|
|
|
*/
|
|
|
public Boolean delDrugById(DelDrugByIdVO delDrugByIdVO) {
|
|
|
- if (drugInfoFacade.getById(delDrugByIdVO.getId()) == null) {
|
|
|
- Asserts.fail("该药品不存在!");
|
|
|
- }
|
|
|
- return drugInfoFacade.removeById(delDrugByIdVO.getId());
|
|
|
+ return drugInfoFacade.removeByIds(delDrugByIdVO.getIds());
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -138,7 +134,7 @@ public class DrugManagementFacade {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *药品匹配信息导入
|
|
|
+ * 药品匹配信息导入
|
|
|
*
|
|
|
* @param response
|
|
|
* @param file
|
|
@@ -162,8 +158,8 @@ public class DrugManagementFacade {
|
|
|
//导入数据转换
|
|
|
temp.stream().forEach(importDrugVO -> {
|
|
|
DrugInfo drugInfo = new DrugInfo();
|
|
|
- BeanUtils.copyProperties(importDrugVO,drugInfo);
|
|
|
- drugInfo.setStandard(importDrugVO.getStandard()+"_"+importDrugVO.getForm());
|
|
|
+ BeanUtils.copyProperties(importDrugVO, drugInfo);
|
|
|
+ drugInfo.setStandard(importDrugVO.getStandard() + "_" + importDrugVO.getForm());
|
|
|
});
|
|
|
boolean out = drugInfoServiceImpl.saveBatch(insert);
|
|
|
CommonResult<String> outMsg = null;
|
|
@@ -187,7 +183,7 @@ public class DrugManagementFacade {
|
|
|
* 数据校验
|
|
|
*
|
|
|
* @param importDrugVOS 导入数据
|
|
|
- * @param errExports 导出异常i
|
|
|
+ * @param errExports 导出异常i
|
|
|
* @Return java.lang.Boolean
|
|
|
*/
|
|
|
private Boolean checkData(List<ImportDrugVO> importDrugVOS, List<ExportImportDrugErrDTO> errExports) {
|
|
@@ -225,7 +221,22 @@ public class DrugManagementFacade {
|
|
|
return tempMap.values().stream().collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取药品匹配分页列表
|
|
|
+ *
|
|
|
+ * @param getMatchingDrugPageVO
|
|
|
+ * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.lantone.daqe.dto.GetMatchingDrugPageDTO>
|
|
|
+ */
|
|
|
public IPage<GetMatchingDrugPageDTO> getMatchingDrugPage(GetMatchingDrugPageVO getMatchingDrugPageVO) {
|
|
|
- return drugInfoServiceImpl.getBaseMapper().getMatchingDrugPage(getMatchingDrugPageVO);
|
|
|
+
|
|
|
+ List<GetMatchingDrugPageDTO> getMatchingDrugPageDTOList = new ArrayList<>();
|
|
|
+ //数据整理组装
|
|
|
+ IPage<GetMatchingDrugPageDTO> drugPages = drugInfoServiceImpl.getBaseMapper().getMatchingDrugPage(getMatchingDrugPageVO);
|
|
|
+ for (GetMatchingDrugPageDTO drug : drugPages.getRecords()) {
|
|
|
+ //目前先按照_切割
|
|
|
+ drug.setForm(drug.getStandard().split("_")[1]);
|
|
|
+ getMatchingDrugPageDTOList.add(drug);
|
|
|
+ }
|
|
|
+ return drugPages.setRecords(getMatchingDrugPageDTOList);
|
|
|
}
|
|
|
}
|