临时修改
This commit is contained in:
@ -0,0 +1,51 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import com.xzzn.common.annotation.Log;
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.core.page.TableDataInfo;
|
||||
import com.xzzn.common.enums.BusinessType;
|
||||
import com.xzzn.ems.domain.EmsPointCalcConfig;
|
||||
import com.xzzn.ems.service.IEmsPointCalcConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/ems/pointCalcConfig")
|
||||
public class EmsPointCalcConfigController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IEmsPointCalcConfigService pointCalcConfigService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmsPointCalcConfig pointCalcConfig) {
|
||||
startPage();
|
||||
List<EmsPointCalcConfig> list = pointCalcConfigService.selectPointCalcConfigList(pointCalcConfig);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(pointCalcConfigService.selectPointCalcConfigById(id));
|
||||
}
|
||||
|
||||
@Log(title = "计算点配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmsPointCalcConfig pointCalcConfig) {
|
||||
return toAjax(pointCalcConfigService.insertPointCalcConfig(pointCalcConfig, getUsername()));
|
||||
}
|
||||
|
||||
@Log(title = "计算点配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmsPointCalcConfig pointCalcConfig) {
|
||||
return toAjax(pointCalcConfigService.updatePointCalcConfig(pointCalcConfig, getUsername()));
|
||||
}
|
||||
|
||||
@Log(title = "计算点配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(pointCalcConfigService.deletePointCalcConfigByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsStrategyRuntimeConfig;
|
||||
import com.xzzn.ems.service.IEmsStrategyRuntimeConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 策略运行参数配置Controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/strategyRuntimeConfig")
|
||||
public class EmsStrategyRuntimeConfigController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IEmsStrategyRuntimeConfigService runtimeConfigService;
|
||||
|
||||
/**
|
||||
* 按站点ID获取策略运行参数
|
||||
*/
|
||||
@GetMapping("/getBySiteId")
|
||||
public AjaxResult getBySiteId(String siteId) {
|
||||
if (StringUtils.isEmpty(siteId)) {
|
||||
return error("缺少必填字段siteId");
|
||||
}
|
||||
return success(runtimeConfigService.getBySiteId(siteId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存策略运行参数(按siteId新增/更新)
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
public AjaxResult save(@RequestBody EmsStrategyRuntimeConfig config) {
|
||||
if (config == null || StringUtils.isEmpty(config.getSiteId())) {
|
||||
return error("缺少必填字段siteId");
|
||||
}
|
||||
config.setCreateBy(getUsername());
|
||||
config.setUpdateBy(getUsername());
|
||||
return toAjax(runtimeConfigService.saveBySiteId(config));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user