xuhy
2024-08-09 2bae01db4eab159eb004ebf1e2d7fa3ae40fbeb9
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java
@@ -1,6 +1,9 @@
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;
@@ -48,5 +51,35 @@
        return AjaxResult.ok(applyChargingPileService.save(dto));
    }
    @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "列表")
    @PostMapping(value = "/page")
    public AjaxResult<Page<TApplyChargingPile>> page(ApplyChargingQuery applyChargingQuery) {
        // TODO 用户id
        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();
    }
}