|
@@ -0,0 +1,81 @@
|
|
|
|
+package com.imed.costaccount.web;
|
|
|
|
+
|
|
|
|
+import com.imed.costaccount.common.util.PageUtils;
|
|
|
|
+import com.imed.costaccount.common.util.Result;
|
|
|
|
+import com.imed.costaccount.model.CostShareParam;
|
|
|
|
+import com.imed.costaccount.model.User;
|
|
|
|
+import com.imed.costaccount.service.CostShareParamService;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.apache.shiro.SecurityUtils;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+import java.util.Arrays;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 分摊参数对照表
|
|
|
|
+ *
|
|
|
|
+ * @author KCYG
|
|
|
|
+ * @date 2021-07-28 09:23:28
|
|
|
|
+ */
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/costshareparam")
|
|
|
|
+@Api(tags = "成本参数操作")
|
|
|
|
+public class CostShareParamController {
|
|
|
|
+ @Autowired
|
|
|
|
+ private CostShareParamService costShareParamService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 分页查询列表
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/list")
|
|
|
|
+ @ApiOperation("分页查询成本相关参数")
|
|
|
|
+ public Result list(@RequestParam(defaultValue = "1", value = "page") Integer page,
|
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
|
+ @RequestParam(value = "name",required = false) String name){
|
|
|
|
+ User user = (User) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
+ Integer hospId = user.getHospId();
|
|
|
|
+ PageUtils pageUtils= costShareParamService.queryList(page,pageSize,name,hospId);
|
|
|
|
+ return Result.ok(pageUtils);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 信息
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/info/{id}")
|
|
|
|
+ public Result info(@PathVariable("id") Integer id){
|
|
|
|
+ CostShareParam costShareParam = costShareParamService.getById(id);
|
|
|
|
+ return Result.ok(costShareParam);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 保存
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/save")
|
|
|
|
+ public Result save(@RequestBody CostShareParam costShareParam){
|
|
|
|
+ costShareParamService.save(costShareParam);
|
|
|
|
+ return Result.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改
|
|
|
|
+ */
|
|
|
|
+ @PutMapping("/update")
|
|
|
|
+ public Result update(@RequestBody CostShareParam costShareParam){
|
|
|
|
+ costShareParamService.updateById(costShareParam);
|
|
|
|
+ return Result.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除
|
|
|
|
+ */
|
|
|
|
+ @DeleteMapping("/delete")
|
|
|
|
+ public Result delete(@RequestBody Integer[] ids){
|
|
|
|
+ costShareParamService.removeByIds(Arrays.asList(ids));
|
|
|
|
+ return Result.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|