|
@@ -0,0 +1,75 @@
|
|
|
+package com.chelvc.cloud.admin.controller;
|
|
|
+
|
|
|
+import com.chelvc.cloud.uc.api.param.RoleModifyParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.DynamicContentDTO;
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.ProfitRatioConfigDTO;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.*;
|
|
|
+import com.chelvc.cloud.vehicle.api.service.ProfitRatioConfigService;
|
|
|
+import com.chelvc.framework.base.annotation.ResponseWrapping;
|
|
|
+import com.chelvc.framework.base.context.SessionContextHolder;
|
|
|
+import com.chelvc.framework.common.model.PagedDTO;
|
|
|
+import com.chelvc.framework.common.model.Pagination;
|
|
|
+import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
+import org.apache.ibatis.annotations.Delete;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 分佣比例配置管理接口
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@RestController
|
|
|
+@ResponseWrapping
|
|
|
+@PreAuthorize("isScope('EMPLOYEE')")
|
|
|
+public class ProfitRatioConfigController {
|
|
|
+
|
|
|
+ @DubboReference
|
|
|
+ private ProfitRatioConfigService profitRatioConfigService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增
|
|
|
+ *
|
|
|
+ * @param param 新增参数
|
|
|
+ */
|
|
|
+ @PostMapping("/profit-ratio/add")
|
|
|
+ public void add(@RequestBody @Valid AddProfitRatioConfigParams param) {
|
|
|
+ param.setUserId(SessionContextHolder.getId());
|
|
|
+ this.profitRatioConfigService.add(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改
|
|
|
+ *
|
|
|
+ * @param param 修改参数
|
|
|
+ */
|
|
|
+ @PutMapping("/profit-ratio/edit")
|
|
|
+ public void edit(@RequestBody @Valid EditProfitRatioConfigParams param) {
|
|
|
+ param.setUserId(SessionContextHolder.getId());
|
|
|
+ this.profitRatioConfigService.edit(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ * @param id
|
|
|
+ */
|
|
|
+ @Delete("/profit-ratio/del/{id}")
|
|
|
+ public void delete(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
|
|
+ this.profitRatioConfigService.delete(id, SessionContextHolder.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询列表
|
|
|
+ * @param param
|
|
|
+ * @param page
|
|
|
+ * @author igl
|
|
|
+ * @date 2024/2/23 17:25
|
|
|
+ */
|
|
|
+ @GetMapping("/list")
|
|
|
+ public Pagination<ProfitRatioConfigDTO> list(QueryProfitRatioConfigParam param, PagedDTO page) {
|
|
|
+ return this.profitRatioConfigService.queryPageList(param, page.getPageCode(), page.getPageSize());
|
|
|
+ }
|
|
|
+}
|