|
|
@@ -0,0 +1,68 @@
|
|
|
+package com.ydtech.modules.esm.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.ydtech.core.page.HttpResult;
|
|
|
+import com.ydtech.modules.esm.model.EsmInsPackage;
|
|
|
+import com.ydtech.modules.esm.model.vo.EsmInsPackagePageVo;
|
|
|
+import com.ydtech.modules.esm.model.vo.EsmInsPackageVo;
|
|
|
+import com.ydtech.modules.esm.service.EsmInsPackageService;
|
|
|
+import com.ydtech.modules.order.entity.BasePageResult;
|
|
|
+import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Api(tags = "保险费用管理")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/esmInsPackage")
|
|
|
+@RequiredArgsConstructor
|
|
|
+public class EsmInsPackageController {
|
|
|
+
|
|
|
+ private final EsmInsPackageService esmInsPackageService;
|
|
|
+
|
|
|
+ @PostMapping("/query")
|
|
|
+ @ApiOperation("查询")
|
|
|
+ public HttpResult<BasePageResult<EsmInsPackage>> queryPage(@RequestBody EsmInsPackagePageVo esmInsPackagePageVo) {
|
|
|
+ BasePageResult<EsmInsPackage> esmInsPackageBasePageResult = esmInsPackageService.queryPage(esmInsPackagePageVo);
|
|
|
+ return HttpResult.ok(esmInsPackageBasePageResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/submit")
|
|
|
+ @ApiOperation("提交")
|
|
|
+ public HttpResult<Object> submit(@RequestBody EsmInsPackageVo esmInsPackageVo) {
|
|
|
+ boolean b = esmInsPackageService.submit(esmInsPackageVo);
|
|
|
+ AssertionUtils.isSucceed(b, "提交失败");
|
|
|
+ return HttpResult.ok("提交成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/modification/{id}")
|
|
|
+ @ApiOperation("修改")
|
|
|
+ public HttpResult<Object> modification(@RequestBody EsmInsPackageVo esmInsPackageVo, @PathVariable String id) {
|
|
|
+ boolean b = esmInsPackageService.modification(esmInsPackageVo, id);
|
|
|
+ AssertionUtils.isSucceed(b, "修改失败");
|
|
|
+ return HttpResult.ok("修改成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/remove/{id}")
|
|
|
+ @ApiOperation("删除")
|
|
|
+ public HttpResult<Object> remove(@PathVariable String id) {
|
|
|
+ boolean b = esmInsPackageService.removeById(id);
|
|
|
+ AssertionUtils.isSucceed(b, "删除失败");
|
|
|
+ return HttpResult.ok("删除成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/packageQuery")
|
|
|
+ @ApiOperation("车险页面套餐查询")
|
|
|
+ public HttpResult<List<EsmInsPackage>> query() {
|
|
|
+ List<EsmInsPackage> list = esmInsPackageService
|
|
|
+ .lambdaQuery()
|
|
|
+ .eq(EsmInsPackage::getUsing, true)
|
|
|
+ .list();
|
|
|
+ return HttpResult.ok(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|