ソースを参照

获取所有的分摊层级数据

ljx 4 年 前
コミット
d0a72d3550

+ 10 - 0
src/main/java/com/imed/costaccount/service/CostShareLevelService.java

@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.imed.costaccount.model.CostShareLevel;
 import com.imed.costaccount.model.dto.CostShareLevelEditDto;
 import com.imed.costaccount.model.dto.CostShareLevelSaveDto;
+import com.imed.costaccount.model.vo.CostShareLevelVO;
 import com.imed.costaccount.utils.PageUtils;
 
+import java.util.List;
+
 /**
  * 分摊层级对照表
  *
@@ -35,5 +38,12 @@ public interface CostShareLevelService extends IService<CostShareLevel> {
      * @param costShareLevelEditDto
      */
     void updateByCostShareLevel(CostShareLevelEditDto costShareLevelEditDto);
+
+    /**
+     * 获取所有的分摊层级数据
+     * @param hospId
+     * @return
+     */
+    List<CostShareLevelVO> getAll(Integer hospId);
 }
 

+ 15 - 0
src/main/java/com/imed/costaccount/service/impl/CostShareLevelServiceImpl.java

@@ -87,4 +87,19 @@ public class CostShareLevelServiceImpl extends ServiceImpl<CostShareLevelMapper,
         costShareLevelRequest.setHospId(hospId);
         baseMapper.insert(costShareLevelRequest);
     }
+
+    /**
+     * 获取所有的分摊层级数据
+     *
+     * @param hospId
+     * @return
+     */
+    @Override
+    public List<CostShareLevelVO> getAll(Integer hospId) {
+        QueryWrapper<CostShareLevel> wrapper = new QueryWrapper<>();
+        wrapper.eq(!StringUtils.isEmpty(hospId),"hosp_id",hospId);
+        List<CostShareLevel> costShareLevels = baseMapper.selectList(wrapper);
+        List<CostShareLevelVO> costShareLevelVOList = BeanUtil.convertList(costShareLevels, CostShareLevelVO.class);
+        return costShareLevelVOList;
+    }
 }

+ 11 - 0
src/main/java/com/imed/costaccount/web/CostShareLevelController.java

@@ -4,6 +4,7 @@ import com.imed.costaccount.common.util.Result;
 import com.imed.costaccount.model.User;
 import com.imed.costaccount.model.dto.CostShareLevelEditDto;
 import com.imed.costaccount.model.dto.CostShareLevelSaveDto;
+import com.imed.costaccount.model.vo.CostShareLevelVO;
 import com.imed.costaccount.service.CostShareLevelService;
 import com.imed.costaccount.utils.PageUtils;
 import io.swagger.annotations.Api;
@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
 import java.util.Arrays;
+import java.util.List;
 
 
 /**
@@ -53,6 +55,15 @@ public class CostShareLevelController {
 //        return Result.ok(costShareLevel);
 //    }
 
+    @GetMapping("/getAll")
+    @ApiOperation("查询所有分摊层级数据")
+    public Result getAll(){
+        User user = (User) SecurityUtils.getSubject().getPrincipal();
+        Integer hospId = user.getHospId();
+        List<CostShareLevelVO> costShareLevelVOList = costShareLevelService.getAll(hospId);
+        return Result.ok(costShareLevelVOList);
+    }
+
     /**
      * 保存
      */