From 99d71f2d540b83d6645766976d01f7daaafc898e Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期一, 19 八月 2024 14:40:43 +0800 Subject: [PATCH] 删除修改 --- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java | 50 +++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 41 insertions(+), 9 deletions(-) diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java index e3c615e..e91f208 100644 --- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java +++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java @@ -1,21 +1,19 @@ package com.ruoyi.chargingPile.controller; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.chargingPile.api.dto.ApplyChargingQuery; +import com.ruoyi.chargingPile.api.dto.ApplyChargingRemarkDto; import com.ruoyi.chargingPile.api.model.TApplyChargingPile; -import com.ruoyi.chargingPile.api.model.TCarport; -import com.ruoyi.chargingPile.api.vo.TCarportVO; import com.ruoyi.chargingPile.service.TApplyChargingPileService; -import com.ruoyi.chargingPile.service.TCarportService; -import com.ruoyi.chargingPile.service.TVehicleRampService; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.log.enums.OperatorType; +import com.ruoyi.common.security.service.TokenService; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; - -import java.util.List; /** * <p> @@ -30,10 +28,12 @@ public class TApplyChargingPileController { private final TApplyChargingPileService applyChargingPileService; + private final TokenService tokenService; @Autowired - public TApplyChargingPileController(TApplyChargingPileService applyChargingPileService) { + public TApplyChargingPileController(TApplyChargingPileService applyChargingPileService, TokenService tokenService) { this.applyChargingPileService = applyChargingPileService; + this.tokenService = tokenService; } /** @@ -43,10 +43,42 @@ @ApiOperation(tags = {"小程序-建桩申请"},value = "建桩申请") @PostMapping(value = "/add") public AjaxResult<Boolean> add(@RequestBody TApplyChargingPile dto) { - // TODO 用户id - dto.setAppUserId(null); + // 用户id + Long userId = tokenService.getLoginUserApplet().getUserId(); + dto.setAppUserId(userId); return AjaxResult.ok(applyChargingPileService.save(dto)); } + @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "列表") + @PostMapping(value = "/page") + public AjaxResult<Page<TApplyChargingPile>> page(ApplyChargingQuery applyChargingQuery) { + Page<TApplyChargingPile> page = applyChargingPileService.lambdaQuery() + .like(applyChargingQuery.getName() != null && !applyChargingQuery.getName().equals(""), TApplyChargingPile::getAgentPhone, applyChargingQuery.getName()) + .page(Page.of(applyChargingQuery.getPageCurr(), applyChargingQuery.getPageSize())); + return AjaxResult.ok(page); + } + + + @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "详情") + @PostMapping(value = "/detail/{id}") + public AjaxResult<TApplyChargingPile> detail(@PathVariable Integer id) { + + return AjaxResult.ok(applyChargingPileService.getById(id)); + } + + @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "修改备注") + @PostMapping(value = "/remark") + public AjaxResult<TApplyChargingPile> remark(@RequestBody ApplyChargingRemarkDto applyChargingRemarkDt) { + TApplyChargingPile byId = applyChargingPileService.getById(applyChargingRemarkDt.getId()); + byId.setRemark(applyChargingRemarkDt.getRemark()); + applyChargingPileService.updateById(byId); + return AjaxResult.success(); + } + + + + + + } -- Gitblit v1.7.1