l3能源成本分摊(部分完成留存)
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
package com.klp.ems.controller;
|
||||
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.ems.domain.vo.WmsEnergyAreaLinkVo;
|
||||
import com.klp.ems.domain.bo.WmsEnergyAreaLinkBo;
|
||||
import com.klp.ems.service.IWmsEnergyAreaLinkService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* EMS能源与库区映射关系
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-12-08
|
||||
*/
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/ems/energy/link")
|
||||
public class WmsEnergyAreaLinkController extends BaseController {
|
||||
|
||||
private final IWmsEnergyAreaLinkService iWmsEnergyAreaLinkService;
|
||||
|
||||
public WmsEnergyAreaLinkController(IWmsEnergyAreaLinkService iWmsEnergyAreaLinkService) {
|
||||
this.iWmsEnergyAreaLinkService = iWmsEnergyAreaLinkService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsEnergyAreaLinkVo> list(WmsEnergyAreaLinkBo bo, PageQuery pageQuery) {
|
||||
return iWmsEnergyAreaLinkService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@GetMapping("/{linkId}")
|
||||
public R<WmsEnergyAreaLinkVo> getInfo(@PathVariable @NotNull(message = "主键不能为空") Long linkId) {
|
||||
return R.ok(iWmsEnergyAreaLinkService.queryById(linkId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@Log(title = "EMS能源与库区映射关系", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsEnergyAreaLinkBo bo) {
|
||||
return toAjax(iWmsEnergyAreaLinkService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@Log(title = "EMS能源与库区映射关系", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsEnergyAreaLinkBo bo) {
|
||||
return toAjax(iWmsEnergyAreaLinkService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Log(title = "EMS能源与库区映射关系", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{linkId}")
|
||||
public R<Void> remove(@PathVariable @NotNull(message = "主键不能为空") Long linkId) {
|
||||
return toAjax(iWmsEnergyAreaLinkService.deleteById(linkId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@Log(title = "EMS能源与库区映射关系", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/batch")
|
||||
public R<Void> removeBatch(@RequestBody @NotEmpty(message = "主键集合不能为空") List<Long> linkIds) {
|
||||
return toAjax(iWmsEnergyAreaLinkService.deleteByIds(linkIds));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user