|
@@ -4,10 +4,15 @@ import com.imed.costaccount.common.util.PageUtils;
|
|
|
import com.imed.costaccount.common.util.Result;
|
|
|
import com.imed.costaccount.common.util.UserContext;
|
|
|
import com.imed.costaccount.model.CostOtherPaymentsData;
|
|
|
+import com.imed.costaccount.model.dto.CostOtherPaymentsDataEditDto;
|
|
|
+import com.imed.costaccount.model.dto.CostOtherPaymentsDataSaveDto;
|
|
|
import com.imed.costaccount.service.CostOtherPaymentsDataService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.validation.Valid;
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
@@ -19,6 +24,7 @@ import java.util.Arrays;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/costAccount/costotherpaymentsdata")
|
|
|
+@Api(tags = "全院其他收支数据操作")
|
|
|
public class CostOtherPaymentsDataController {
|
|
|
@Autowired
|
|
|
private CostOtherPaymentsDataService costOtherPaymentsDataService;
|
|
@@ -27,21 +33,22 @@ public class CostOtherPaymentsDataController {
|
|
|
* 分页查询列表
|
|
|
* 查询的是
|
|
|
*/
|
|
|
- @RequestMapping("/list")
|
|
|
+ @GetMapping("/list")
|
|
|
+ @ApiOperation("分页查询全院其他收支数据")
|
|
|
public Result list(@RequestParam(value = "current", defaultValue = "1") Integer current,
|
|
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
- @RequestParam(value = "dateTime",required = false) String datetime){
|
|
|
+ @RequestParam(value = "dateTime",required = false) String dateTime){
|
|
|
Long hospId = UserContext.getHospId();
|
|
|
- PageUtils pageUtils = costOtherPaymentsDataService.queryList(current,pageSize,datetime,hospId);
|
|
|
- return Result.ok(pageSize);
|
|
|
+ PageUtils pageUtils = costOtherPaymentsDataService.queryList(current,pageSize,dateTime,hospId);
|
|
|
+ return Result.ok(pageUtils);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 信息
|
|
|
*/
|
|
|
- @RequestMapping("/info/{id}")
|
|
|
- public Result info(@PathVariable("id") Long id){
|
|
|
+ @GetMapping("/info")
|
|
|
+ public Result info( Long id){
|
|
|
CostOtherPaymentsData costOtherPaymentsData = costOtherPaymentsDataService.getById(id);
|
|
|
return Result.ok(costOtherPaymentsData);
|
|
|
}
|
|
@@ -49,25 +56,30 @@ public class CostOtherPaymentsDataController {
|
|
|
/**
|
|
|
* 保存
|
|
|
*/
|
|
|
- @RequestMapping("/save")
|
|
|
- public Result save(@RequestBody CostOtherPaymentsData costOtherPaymentsData){
|
|
|
- costOtherPaymentsDataService.save(costOtherPaymentsData);
|
|
|
+ @PostMapping("/save")
|
|
|
+ @ApiOperation("保存全院其他收支数据")
|
|
|
+ public Result save(@RequestBody @Valid CostOtherPaymentsDataSaveDto costOtherPaymentsDataSaveDto){
|
|
|
+ Long hospId = UserContext.getHospId();
|
|
|
+ costOtherPaymentsDataService.addOtherPaymentData(costOtherPaymentsDataSaveDto,hospId);
|
|
|
return Result.ok();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改
|
|
|
*/
|
|
|
- @RequestMapping("/update")
|
|
|
- public Result update(@RequestBody CostOtherPaymentsData costOtherPaymentsData){
|
|
|
- costOtherPaymentsDataService.updateById(costOtherPaymentsData);
|
|
|
+ @PostMapping("/update")
|
|
|
+ @ApiOperation("修改全院其他收支数据")
|
|
|
+ public Result update(@RequestBody @Valid CostOtherPaymentsDataEditDto costOtherPaymentsDataEditDto){
|
|
|
+ Long hospId = UserContext.getHospId();
|
|
|
+ costOtherPaymentsDataService.updateOtherPaymentData(costOtherPaymentsDataEditDto,hospId);
|
|
|
return Result.ok();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除
|
|
|
*/
|
|
|
- @RequestMapping("/delete")
|
|
|
+ @PostMapping("/delete")
|
|
|
+ @ApiOperation("批量删除全院其他收支数据")
|
|
|
public Result delete(@RequestBody Long[] ids){
|
|
|
costOtherPaymentsDataService.removeByIds(Arrays.asList(ids));
|
|
|
return Result.ok();
|