소스 검색

添加判断

ljx 4 년 전
부모
커밋
97ade6d8ed

+ 3 - 0
src/main/java/com/imed/costaccount/service/impl/ShareParamValueServiceImpl.java

@@ -431,6 +431,9 @@ public class ShareParamValueServiceImpl extends ServiceImpl<ShareParamValueMappe
                 new LambdaQueryWrapper<ShareParamValue>()
                         .eq(ShareParamValue::getDateYear, year).eq(ShareParamValue::getDateMonth, month).eq(ShareParamValue::getHospId, hospId)
         );
+        if (list.isEmpty()){
+            throw new CostException(500,parse+"数据未录入");
+        }
         // 得到这些责任中心代码
         List<String> responsibilityCodes = list.stream().map(ShareParamValue::getResponsibilityCode).distinct().collect(Collectors.toList());
         List<IncomeCollection> incomeCollections = incomeCollectionService.list(

+ 2 - 2
src/main/java/com/imed/costaccount/web/ExcelController.java

@@ -402,7 +402,7 @@ public class ExcelController extends AbstractController{
      * 成本分摊参数导出模板
      */
     @GetMapping("/getShareParamTemplate")
-    @ApiOperation("成本分摊参数导出模板")
+    @ApiOperation("成本分摊参数导出模板")
     public void getShareParamTemplate(HttpServletResponse response,String token) throws IOException {
         int userId = jwtUtil.getUserId(token);
         User user = userService.getById(userId);
@@ -522,7 +522,7 @@ public class ExcelController extends AbstractController{
         }
     }
     @PostMapping("/importShareParamGroup")
-    @ApiOperation("成本分摊参数导入")
+    @ApiOperation("成本分摊参数导入")
     public Result importShareParamGroup(@RequestParam("file") MultipartFile file ,Integer fileType,String dateTime){
         if (Objects.isNull(file)) {
             throw new CostException(500, "请选择文件");