Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@ -1,17 +1,19 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import com.xzzn.common.config.RuoYiConfig;
|
||||
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.utils.file.FileUploadUtils;
|
||||
import com.xzzn.common.utils.file.MimeTypeUtils;
|
||||
import com.xzzn.ems.domain.EmsDevicesSetting;
|
||||
import com.xzzn.ems.domain.EmsSiteSetting;
|
||||
import com.xzzn.ems.domain.vo.SiteDeviceListVo;
|
||||
import com.xzzn.ems.service.IEmsDeviceSettingService;
|
||||
import com.xzzn.ems.service.IEmsSiteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -42,7 +44,7 @@ public class EmsSiteConfigController extends BaseController{
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备列表
|
||||
* 获取设备列表-分页
|
||||
*/
|
||||
@GetMapping("/getDeviceInfoList")
|
||||
public TableDataInfo getDeviceInfoList(@RequestParam String siteId)
|
||||
@ -56,8 +58,82 @@ public class EmsSiteConfigController extends BaseController{
|
||||
* 获取设备详细信息
|
||||
*/
|
||||
@GetMapping("/getDeviceDetailInfo")
|
||||
public AjaxResult getDeviceDetailInfo(@RequestParam String deviceId)
|
||||
public AjaxResult getDeviceDetailInfo(@RequestParam Long id)
|
||||
{
|
||||
return success(iEmsDeviceSettingService.getDeviceDetailInfo(deviceId));
|
||||
return success(iEmsDeviceSettingService.getDeviceDetailInfo(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备列表-不分页
|
||||
*/
|
||||
@GetMapping("/getDeviceList")
|
||||
public AjaxResult getDeviceInfoList2(@RequestParam String siteId)
|
||||
{
|
||||
return success(iEmsSiteService.getAllDeviceList(siteId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有设备类别
|
||||
*/
|
||||
@GetMapping("/getDeviceCategory")
|
||||
public AjaxResult getDeviceCategory()
|
||||
{
|
||||
return success(iEmsDeviceSettingService.getDeviceCategory());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
*/
|
||||
@PostMapping("/addDevice")
|
||||
public AjaxResult addDevice(@RequestBody EmsDevicesSetting devicesSetting)
|
||||
{
|
||||
int result = iEmsDeviceSettingService.addDevice(devicesSetting);
|
||||
if (result > 0) {
|
||||
return AjaxResult.success(result);
|
||||
} else {
|
||||
return AjaxResult.error("该设备已存在");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传设备图片
|
||||
*/
|
||||
@PostMapping("/uploadDeviceImg")
|
||||
public AjaxResult uploadDeviceImg(@RequestParam("avatarfile") MultipartFile file) throws Exception
|
||||
{
|
||||
if (!file.isEmpty()) {
|
||||
String avatar = FileUploadUtils.upload(RuoYiConfig.getDevicePath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
||||
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("imgUrl", avatar);
|
||||
return ajax;
|
||||
}
|
||||
return error("上传图片异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改Modbus设备配置
|
||||
*/
|
||||
@PostMapping("/updateDevice")
|
||||
public AjaxResult updateDevice(@RequestBody EmsDevicesSetting emsDevicesSetting)
|
||||
{
|
||||
int result = iEmsDeviceSettingService.updateDevice(emsDevicesSetting);
|
||||
if (result > 0) {
|
||||
return AjaxResult.success(result);
|
||||
} else if (result == -1) {
|
||||
return AjaxResult.error("数据不存在");
|
||||
} else if (result == -2) {
|
||||
return AjaxResult.error("该设备已存在");
|
||||
}
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除Modbus设备配置
|
||||
*/
|
||||
@DeleteMapping("/deleteService/{id}")
|
||||
public AjaxResult deleteService(@PathVariable Long id)
|
||||
{
|
||||
return toAjax(iEmsDeviceSettingService.deleteEmsDevicesSettingById(id));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsStrategyRunning;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -60,8 +61,16 @@ public class EmsStrategyController extends BaseController
|
||||
@PostMapping(value = "/configStrategy")
|
||||
public AjaxResult configStrategy(@RequestBody EmsStrategyRunning emsStrategyRunning)
|
||||
{
|
||||
if (emsStrategyRunning.getMainStrategyId() == null
|
||||
|| StringUtils.isEmpty(emsStrategyRunning.getSiteId())){
|
||||
return error("缺少必填字段");
|
||||
}
|
||||
emsStrategyRunning.setCreateBy(getUsername());
|
||||
emsStrategyRunning.setUpdateBy(getUsername());
|
||||
return toAjax(emsStrategyService.configStrategy(emsStrategyRunning));
|
||||
int result = emsStrategyService.configStrategy(emsStrategyRunning);
|
||||
if (result == -1){
|
||||
return error("不支持重复添加");
|
||||
}
|
||||
return success(result);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,102 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.xzzn.common.annotation.Log;
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.enums.BusinessType;
|
||||
import com.xzzn.ems.domain.EmsStrategyCurve;
|
||||
import com.xzzn.ems.service.IEmsStrategyCurveService;
|
||||
import com.xzzn.common.utils.poi.ExcelUtil;
|
||||
import com.xzzn.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 策曲线Controller
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/strategy/curve")
|
||||
public class EmsStrategyCurveController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmsStrategyCurveService emsStrategyCurveService;
|
||||
|
||||
/**
|
||||
* 查询策曲线列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:curve:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(EmsStrategyCurve emsStrategyCurve)
|
||||
{
|
||||
return success(emsStrategyCurveService.selectEmsStrategyCurveList(emsStrategyCurve));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出策曲线列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:curve:export')")
|
||||
@Log(title = "策曲线", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmsStrategyCurve emsStrategyCurve)
|
||||
{
|
||||
List<EmsStrategyCurve> list = emsStrategyCurveService.selectEmsStrategyCurveList(emsStrategyCurve);
|
||||
ExcelUtil<EmsStrategyCurve> util = new ExcelUtil<EmsStrategyCurve>(EmsStrategyCurve.class);
|
||||
util.exportExcel(response, list, "策曲线数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取策曲线详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:curve:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(emsStrategyCurveService.selectEmsStrategyCurveById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增策曲线
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:curve:add')")
|
||||
@Log(title = "策曲线", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmsStrategyCurve emsStrategyCurve)
|
||||
{
|
||||
return toAjax(emsStrategyCurveService.insertEmsStrategyCurve(emsStrategyCurve));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改策曲线
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:curve:edit')")
|
||||
@Log(title = "策曲线", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmsStrategyCurve emsStrategyCurve)
|
||||
{
|
||||
return toAjax(emsStrategyCurveService.updateEmsStrategyCurve(emsStrategyCurve));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除策曲线
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:curve:remove')")
|
||||
@Log(title = "策曲线", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(emsStrategyCurveService.deleteEmsStrategyCurveByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import com.xzzn.ems.domain.vo.StrategyTempConfigRequest;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.xzzn.common.annotation.Log;
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.enums.BusinessType;
|
||||
import com.xzzn.ems.service.IEmsStrategyTempService;
|
||||
|
||||
/**
|
||||
* 模板Controller
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/strategy/temp")
|
||||
public class EmsStrategyTempController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmsStrategyTempService emsStrategyTempService;
|
||||
|
||||
/**
|
||||
* 根据策略id站点id获取所有模板名称
|
||||
*/
|
||||
@GetMapping("/getTempNameList")
|
||||
public AjaxResult getTempNameList(Long strategyId, String siteId)
|
||||
{
|
||||
return success(emsStrategyTempService.getTempNameList(strategyId, siteId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个模板时间配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:temp:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(String templateId)
|
||||
{
|
||||
return success(emsStrategyTempService.selectEmsStrategyTempList(templateId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增模板及时间配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:temp:add')")
|
||||
@Log(title = "模板", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody StrategyTempConfigRequest requestVo)
|
||||
{
|
||||
boolean result = emsStrategyTempService.addNewTempAndTimeConfig(requestVo);
|
||||
if (result) {
|
||||
return success();
|
||||
} else {
|
||||
return AjaxResult.error("新增失败请重试!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改模板
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:temp:edit')")
|
||||
@Log(title = "模板", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody StrategyTempConfigRequest requestVo)
|
||||
{
|
||||
boolean result = emsStrategyTempService.updateEmsStrategyTemp(requestVo);
|
||||
if (result) {
|
||||
return success();
|
||||
} else {
|
||||
return AjaxResult.error("更新失败,请重试!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除模板
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:temp:remove')")
|
||||
@Log(title = "模板", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{templateId}")
|
||||
public AjaxResult remove(@PathVariable String templateId)
|
||||
{
|
||||
return success(emsStrategyTempService.deleteStrategyTempById(templateId));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.xzzn.common.annotation.Log;
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.enums.BusinessType;
|
||||
import com.xzzn.ems.domain.EmsStrategyTimeConfig;
|
||||
import com.xzzn.ems.service.IEmsStrategyTimeConfigService;
|
||||
|
||||
/**
|
||||
* 时间配置Controller
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/strategy/timeConfig")
|
||||
public class EmsStrategyTimeConfigController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmsStrategyTimeConfigService emsStrategyTimeConfigService;
|
||||
|
||||
/**
|
||||
* 查询时间配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(EmsStrategyTimeConfig emsStrategyTimeConfig)
|
||||
{
|
||||
return success(emsStrategyTimeConfigService.getStrategyTimeList(emsStrategyTimeConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取时间配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(emsStrategyTimeConfigService.selectEmsStrategyTimeConfigById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增时间配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:add')")
|
||||
@Log(title = "时间配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody List<EmsStrategyTimeConfig> emsStrategyTimeConfigList)
|
||||
{
|
||||
boolean result = emsStrategyTimeConfigService.insertEmsStrategyTimeConfig(emsStrategyTimeConfigList);
|
||||
if (result){
|
||||
return success();
|
||||
}else {
|
||||
return error("编辑失败请重试!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改时间配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
||||
@Log(title = "时间配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmsStrategyTimeConfig emsStrategyTimeConfig)
|
||||
{
|
||||
return toAjax(emsStrategyTimeConfigService.updateEmsStrategyTimeConfig(emsStrategyTimeConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除时间配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||
@Log(title = "时间配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(emsStrategyTimeConfigService.deleteEmsStrategyTimeConfigByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xzzn.common.utils.poi.ExcelUtil;
|
||||
import com.xzzn.ems.domain.EmsTicket;
|
||||
import com.xzzn.ems.domain.vo.TicketListVo;
|
||||
import com.xzzn.ems.service.IEmsTicketService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -43,7 +44,7 @@ public class EmsTicketController extends BaseController
|
||||
public TableDataInfo list(EmsTicket emsTicket)
|
||||
{
|
||||
startPage();
|
||||
List<EmsTicket> list = emsTicketService.selectEmsTicketList(emsTicket);
|
||||
List<TicketListVo> list = emsTicketService.getAllTicketList(emsTicket);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,8 @@ package com.xzzn.web.controller.system;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xzzn.system.service.impl.SysUserServiceImpl;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -52,6 +54,8 @@ public class SysUserController extends BaseController
|
||||
|
||||
@Autowired
|
||||
private ISysPostService postService;
|
||||
@Autowired
|
||||
private SysUserServiceImpl sysUserServiceImpl;
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
@ -253,4 +257,13 @@ public class SysUserController extends BaseController
|
||||
{
|
||||
return success(deptService.selectDeptTreeList(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有用户
|
||||
*/
|
||||
@GetMapping("/getAllUser")
|
||||
public AjaxResult getAllUser(SysUser user)
|
||||
{
|
||||
return success(userService.selectUserList(user));
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ server:
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.xzzn: debug
|
||||
com.xzzn: info
|
||||
org.springframework: warn
|
||||
|
||||
# 用户配置
|
||||
|
||||
@ -119,4 +119,12 @@ public class RuoYiConfig
|
||||
{
|
||||
return getProfile() + "/upload";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取头像上传路径
|
||||
*/
|
||||
public static String getDevicePath()
|
||||
{
|
||||
return getProfile() + "/device";
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,8 @@ public enum DeviceCategory
|
||||
STACK("STACK", "电池堆"),
|
||||
CLUSTER("CLUSTER", "电池簇"),
|
||||
BATTERY("BATTERY", "单体电池"),
|
||||
AMMETER("AMMETER", "电表");
|
||||
AMMETER("AMMETER", "电表"),
|
||||
COOLING("COOLING", "冷液体");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package com.xzzn.common.enums;
|
||||
|
||||
/**
|
||||
* strategy模板-sdc限制
|
||||
*
|
||||
* @author xzzn
|
||||
*/
|
||||
public enum SdcLimitType
|
||||
{
|
||||
OFF("0", "关"), ON("1", "开");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
SdcLimitType(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
||||
@ -22,6 +22,10 @@
|
||||
<groupId>com.xzzn</groupId>
|
||||
<artifactId>ems-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>jaxb-runtime</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ import com.xzzn.common.annotation.Excel;
|
||||
* Modbus设备配置对象 ems_devices_setting
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-02
|
||||
* @date 2025-07-12
|
||||
*/
|
||||
public class EmsDevicesSetting extends BaseEntity
|
||||
{
|
||||
@ -102,6 +102,10 @@ public class EmsDevicesSetting extends BaseEntity
|
||||
@Excel(name = "设备类别,例如“STACK/CLUSTER/PCS等”")
|
||||
private String deviceCategory;
|
||||
|
||||
/** 设备图像地址 */
|
||||
@Excel(name = "设备图像地址")
|
||||
private String pictureUrl;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
@ -312,6 +316,16 @@ public class EmsDevicesSetting extends BaseEntity
|
||||
return deviceCategory;
|
||||
}
|
||||
|
||||
public void setPictureUrl(String pictureUrl)
|
||||
{
|
||||
this.pictureUrl = pictureUrl;
|
||||
}
|
||||
|
||||
public String getPictureUrl()
|
||||
{
|
||||
return pictureUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -336,6 +350,7 @@ public class EmsDevicesSetting extends BaseEntity
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("parentId", getParentId())
|
||||
.append("deviceCategory", getDeviceCategory())
|
||||
.append("pictureUrl", getPictureUrl())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,136 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 策曲线对象 ems_strategy_curve
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
public class EmsStrategyCurve extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 关联的策略ID */
|
||||
@Excel(name = "关联的策略ID")
|
||||
private Long strategyId;
|
||||
|
||||
/** 任务编号 */
|
||||
@Excel(name = "任务编号")
|
||||
private Long taskNumber;
|
||||
|
||||
/** 开始日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date startDate;
|
||||
|
||||
/** 结束日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "结束日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date endDate;
|
||||
|
||||
/** 功率数据,可以是JSON格式存储曲线数据 */
|
||||
@Excel(name = "功率数据,可以是JSON格式存储曲线数据")
|
||||
private String powerData;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setStrategyId(Long strategyId)
|
||||
{
|
||||
this.strategyId = strategyId;
|
||||
}
|
||||
|
||||
public Long getStrategyId()
|
||||
{
|
||||
return strategyId;
|
||||
}
|
||||
|
||||
public void setTaskNumber(Long taskNumber)
|
||||
{
|
||||
this.taskNumber = taskNumber;
|
||||
}
|
||||
|
||||
public Long getTaskNumber()
|
||||
{
|
||||
return taskNumber;
|
||||
}
|
||||
|
||||
public void setStartDate(Date startDate)
|
||||
{
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public Date getStartDate()
|
||||
{
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setEndDate(Date endDate)
|
||||
{
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public Date getEndDate()
|
||||
{
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setPowerData(String powerData)
|
||||
{
|
||||
this.powerData = powerData;
|
||||
}
|
||||
|
||||
public String getPowerData()
|
||||
{
|
||||
return powerData;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("strategyId", getStrategyId())
|
||||
.append("taskNumber", getTaskNumber())
|
||||
.append("startDate", getStartDate())
|
||||
.append("endDate", getEndDate())
|
||||
.append("powerData", getPowerData())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("siteId", getSiteId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,212 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 模板对象 ems_strategy_temp
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-13
|
||||
*/
|
||||
public class EmsStrategyTemp extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 关联的策略ID */
|
||||
@Excel(name = "关联的策略ID")
|
||||
private Long strategyId;
|
||||
|
||||
/** 模板名称,如“模板一” */
|
||||
@Excel(name = "模板名称,如“模板一”")
|
||||
private String templateName;
|
||||
|
||||
/** SDC限制 (%) 1 = 开,0 = 关 */
|
||||
@Excel(name = "SDC限制 (%) 1 = 开,0 = 关")
|
||||
private Integer sdcLimit;
|
||||
|
||||
/** SDC下限 (%) */
|
||||
@Excel(name = "SDC下限 (%)")
|
||||
private BigDecimal sdcDown;
|
||||
|
||||
/** SDC上限 (%) */
|
||||
@Excel(name = "SDC上限 (%)")
|
||||
private BigDecimal sdcUp;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(pattern = "HH:mm")
|
||||
@Excel(name = "开始时间", width = 30, dateFormat = "HH:mm")
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@JsonFormat(pattern = "HH:mm")
|
||||
@Excel(name = "结束时间", width = 30, dateFormat = "HH:mm")
|
||||
private Date endTime;
|
||||
|
||||
/** 充放功率 (kW) */
|
||||
@Excel(name = "充放功率 (kW)")
|
||||
private BigDecimal chargeDischargePower;
|
||||
|
||||
/** 充电状态,如“1-充电”、“2-待机” */
|
||||
@Excel(name = "充电状态,如“1-充电”、“2-待机”")
|
||||
private String chargeStatus;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 模板id */
|
||||
@Excel(name = "模板id")
|
||||
private String templateId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setStrategyId(Long strategyId)
|
||||
{
|
||||
this.strategyId = strategyId;
|
||||
}
|
||||
|
||||
public Long getStrategyId()
|
||||
{
|
||||
return strategyId;
|
||||
}
|
||||
|
||||
public void setTemplateName(String templateName)
|
||||
{
|
||||
this.templateName = templateName;
|
||||
}
|
||||
|
||||
public String getTemplateName()
|
||||
{
|
||||
return templateName;
|
||||
}
|
||||
|
||||
public void setSdcLimit(Integer sdcLimit)
|
||||
{
|
||||
this.sdcLimit = sdcLimit;
|
||||
}
|
||||
|
||||
public Integer getSdcLimit()
|
||||
{
|
||||
return sdcLimit;
|
||||
}
|
||||
|
||||
public void setSdcDown(BigDecimal sdcDown)
|
||||
{
|
||||
this.sdcDown = sdcDown;
|
||||
}
|
||||
|
||||
public BigDecimal getSdcDown()
|
||||
{
|
||||
return sdcDown;
|
||||
}
|
||||
|
||||
public void setSdcUp(BigDecimal sdcUp)
|
||||
{
|
||||
this.sdcUp = sdcUp;
|
||||
}
|
||||
|
||||
public BigDecimal getSdcUp()
|
||||
{
|
||||
return sdcUp;
|
||||
}
|
||||
|
||||
public void setStartTime(Date startTime)
|
||||
{
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public Date getStartTime()
|
||||
{
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Date endTime)
|
||||
{
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public Date getEndTime()
|
||||
{
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setChargeDischargePower(BigDecimal chargeDischargePower)
|
||||
{
|
||||
this.chargeDischargePower = chargeDischargePower;
|
||||
}
|
||||
|
||||
public BigDecimal getChargeDischargePower()
|
||||
{
|
||||
return chargeDischargePower;
|
||||
}
|
||||
|
||||
public void setChargeStatus(String chargeStatus)
|
||||
{
|
||||
this.chargeStatus = chargeStatus;
|
||||
}
|
||||
|
||||
public String getChargeStatus()
|
||||
{
|
||||
return chargeStatus;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setTemplateId(String templateId)
|
||||
{
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
public String getTemplateId()
|
||||
{
|
||||
return templateId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("strategyId", getStrategyId())
|
||||
.append("templateName", getTemplateName())
|
||||
.append("sdcLimit", getSdcLimit())
|
||||
.append("sdcDown", getSdcDown())
|
||||
.append("sdcUp", getSdcUp())
|
||||
.append("startTime", getStartTime())
|
||||
.append("endTime", getEndTime())
|
||||
.append("chargeDischargePower", getChargeDischargePower())
|
||||
.append("chargeStatus", getChargeStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("siteId", getSiteId())
|
||||
.append("templateId", getTemplateId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,122 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 模板配置对象 ems_strategy_temp_time_config
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-12
|
||||
*/
|
||||
public class EmsStrategyTempTimeConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(pattern = "HH:mm")
|
||||
@Excel(name = "开始时间", width = 30, dateFormat = "HH:mm")
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@JsonFormat(pattern = "HH:mm")
|
||||
@Excel(name = "结束时间", width = 30, dateFormat = "HH:mm")
|
||||
private Date endTime;
|
||||
|
||||
/** 充放功率 (kW) */
|
||||
@Excel(name = "充放功率 (kW)")
|
||||
private BigDecimal chargeDischargePower;
|
||||
|
||||
/** 充电状态,如“1-充电”、“2-待机” */
|
||||
@Excel(name = "充电状态,如“1-充电”、“2-待机”")
|
||||
private String chargeStatus;
|
||||
|
||||
/** 模板id */
|
||||
@Excel(name = "模板id")
|
||||
private String templateId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setStartTime(Date startTime)
|
||||
{
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public Date getStartTime()
|
||||
{
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Date endTime)
|
||||
{
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public Date getEndTime()
|
||||
{
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setChargeDischargePower(BigDecimal chargeDischargePower)
|
||||
{
|
||||
this.chargeDischargePower = chargeDischargePower;
|
||||
}
|
||||
|
||||
public BigDecimal getChargeDischargePower()
|
||||
{
|
||||
return chargeDischargePower;
|
||||
}
|
||||
|
||||
public void setChargeStatus(String chargeStatus)
|
||||
{
|
||||
this.chargeStatus = chargeStatus;
|
||||
}
|
||||
|
||||
public String getChargeStatus()
|
||||
{
|
||||
return chargeStatus;
|
||||
}
|
||||
|
||||
public void setTemplateId(String templateId)
|
||||
{
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
public String getTemplateId()
|
||||
{
|
||||
return templateId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("startTime", getStartTime())
|
||||
.append("endTime", getEndTime())
|
||||
.append("chargeDischargePower", getChargeDischargePower())
|
||||
.append("chargeStatus", getChargeStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("templateId", getTemplateId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,117 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 时间配置对象 ems_strategy_time_config
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-12
|
||||
*/
|
||||
public class EmsStrategyTimeConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 关联的策略ID */
|
||||
@Excel(name = "关联的策略ID")
|
||||
private Long strategyId;
|
||||
|
||||
/** 月份,1-12 */
|
||||
@Excel(name = "月份,1-12")
|
||||
private Long month;
|
||||
|
||||
/** 充放电模式,如“两充两放” */
|
||||
@Excel(name = "充放电模式,如“两充两放”")
|
||||
private String chargeDischargeMode;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 模版id */
|
||||
@Excel(name = "模版id")
|
||||
private String templateId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setStrategyId(Long strategyId)
|
||||
{
|
||||
this.strategyId = strategyId;
|
||||
}
|
||||
|
||||
public Long getStrategyId()
|
||||
{
|
||||
return strategyId;
|
||||
}
|
||||
|
||||
public void setMonth(Long month)
|
||||
{
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public Long getMonth()
|
||||
{
|
||||
return month;
|
||||
}
|
||||
|
||||
public void setChargeDischargeMode(String chargeDischargeMode)
|
||||
{
|
||||
this.chargeDischargeMode = chargeDischargeMode;
|
||||
}
|
||||
|
||||
public String getChargeDischargeMode()
|
||||
{
|
||||
return chargeDischargeMode;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setTemplateId(String templateId)
|
||||
{
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
public String getTemplateId()
|
||||
{
|
||||
return templateId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("strategyId", getStrategyId())
|
||||
.append("month", getMonth())
|
||||
.append("chargeDischargeMode", getChargeDischargeMode())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("siteId", getSiteId())
|
||||
.append("templateId", getTemplateId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -26,7 +26,7 @@ public class EmsTicket extends BaseEntity
|
||||
|
||||
/** 提交用户ID */
|
||||
@Excel(name = "提交用户ID")
|
||||
private String userId;
|
||||
private Long userId;
|
||||
|
||||
/** 工单标题 */
|
||||
@Excel(name = "工单标题")
|
||||
@ -77,12 +77,12 @@ public class EmsTicket extends BaseEntity
|
||||
return ticketNo;
|
||||
}
|
||||
|
||||
public void setUserId(String userId)
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserId()
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
|
||||
@ -19,6 +19,10 @@ public class SiteDeviceListVo {
|
||||
private String communicationStatus;
|
||||
/** 设备类型 */
|
||||
private String deviceCategory;
|
||||
/** 设备类型 */
|
||||
private String pictureUrl;
|
||||
/** 唯一标识 */
|
||||
private String id;
|
||||
|
||||
public String getSiteId() {
|
||||
return siteId;
|
||||
@ -75,4 +79,20 @@ public class SiteDeviceListVo {
|
||||
public void setDeviceCategory(String deviceCategory) {
|
||||
this.deviceCategory = deviceCategory;
|
||||
}
|
||||
|
||||
public String getPictureUrl() {
|
||||
return pictureUrl;
|
||||
}
|
||||
|
||||
public void setPictureUrl(String pictureUrl) {
|
||||
this.pictureUrl = pictureUrl;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,6 +26,12 @@ public class StrategyRunningVo
|
||||
/** 策略运行id */
|
||||
private Long id;
|
||||
|
||||
/** 主策略id */
|
||||
private Long mainStrategyId;
|
||||
|
||||
/** 辅助策略id */
|
||||
private Long auxStrategyId;
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
@ -79,4 +85,20 @@ public class StrategyRunningVo
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getAuxStrategyId() {
|
||||
return auxStrategyId;
|
||||
}
|
||||
|
||||
public void setAuxStrategyId(Long auxStrategyId) {
|
||||
this.auxStrategyId = auxStrategyId;
|
||||
}
|
||||
|
||||
public Long getMainStrategyId() {
|
||||
return mainStrategyId;
|
||||
}
|
||||
|
||||
public void setMainStrategyId(Long mainStrategyId) {
|
||||
this.mainStrategyId = mainStrategyId;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,115 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.xzzn.ems.domain.EmsStrategyTempTimeConfig;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新增模板+模板时间数据
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-12
|
||||
*/
|
||||
public class StrategyTempConfigRequest
|
||||
{
|
||||
|
||||
/** 模板id */
|
||||
private String templateId;
|
||||
/** 站点id */
|
||||
private String siteId;
|
||||
|
||||
/** 关联的策略ID */
|
||||
private Long strategyId;
|
||||
|
||||
/** 模板名称,如“模板一” */
|
||||
private String templateName;
|
||||
|
||||
/** SDC限制 (%) 1 = 开,0 = 关 */
|
||||
private Integer sdcLimit;
|
||||
|
||||
/** SDC下限 (%) */
|
||||
private BigDecimal sdcDown;
|
||||
|
||||
/** SDC上限 (%) */
|
||||
private BigDecimal sdcUp;
|
||||
|
||||
/** 模板时间 */
|
||||
private List<EmsStrategyTempTimeConfig> timeConfigList;
|
||||
|
||||
public String getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public void setTemplateId(String templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
public void setStrategyId(Long strategyId)
|
||||
{
|
||||
this.strategyId = strategyId;
|
||||
}
|
||||
|
||||
public Long getStrategyId()
|
||||
{
|
||||
return strategyId;
|
||||
}
|
||||
|
||||
public void setTemplateName(String templateName)
|
||||
{
|
||||
this.templateName = templateName;
|
||||
}
|
||||
|
||||
public String getTemplateName()
|
||||
{
|
||||
return templateName;
|
||||
}
|
||||
|
||||
public void setSdcLimit(Integer sdcLimit)
|
||||
{
|
||||
this.sdcLimit = sdcLimit;
|
||||
}
|
||||
|
||||
public Integer getSdcLimit()
|
||||
{
|
||||
return sdcLimit;
|
||||
}
|
||||
|
||||
public void setSdcDown(BigDecimal sdcDown)
|
||||
{
|
||||
this.sdcDown = sdcDown;
|
||||
}
|
||||
|
||||
public BigDecimal getSdcDown()
|
||||
{
|
||||
return sdcDown;
|
||||
}
|
||||
|
||||
public void setSdcUp(BigDecimal sdcUp)
|
||||
{
|
||||
this.sdcUp = sdcUp;
|
||||
}
|
||||
|
||||
public BigDecimal getSdcUp()
|
||||
{
|
||||
return sdcUp;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public List<EmsStrategyTempTimeConfig> getTimeConfigList() {
|
||||
return timeConfigList;
|
||||
}
|
||||
|
||||
public void setTimeConfigList(List<EmsStrategyTempTimeConfig> timeConfigList) {
|
||||
this.timeConfigList = timeConfigList;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,152 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 模板+模板时间数据
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-12
|
||||
*/
|
||||
public class StrategyTempTimeConfigVo
|
||||
{
|
||||
/** 模版id */
|
||||
private Long id;
|
||||
|
||||
/** 关联的策略ID */
|
||||
private Long strategyId;
|
||||
|
||||
/** 模板名称,如“模板一” */
|
||||
private String templateName;
|
||||
|
||||
/** SDC限制 (%) 1 = 开,0 = 关 */
|
||||
private Integer sdcLimit;
|
||||
|
||||
/** SDC下限 (%) */
|
||||
private BigDecimal sdcDown;
|
||||
|
||||
/** SDC上限 (%) */
|
||||
private BigDecimal sdcUp;
|
||||
|
||||
/** 站点id */
|
||||
private String siteId;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
/** 充放功率 (kW) */
|
||||
private BigDecimal chargeDischargePower;
|
||||
|
||||
/** 充电状态,如“1-充电”、“2-待机” */
|
||||
private String chargeStatus;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setStrategyId(Long strategyId)
|
||||
{
|
||||
this.strategyId = strategyId;
|
||||
}
|
||||
|
||||
public Long getStrategyId()
|
||||
{
|
||||
return strategyId;
|
||||
}
|
||||
|
||||
public void setTemplateName(String templateName)
|
||||
{
|
||||
this.templateName = templateName;
|
||||
}
|
||||
|
||||
public String getTemplateName()
|
||||
{
|
||||
return templateName;
|
||||
}
|
||||
|
||||
public void setSdcLimit(Integer sdcLimit)
|
||||
{
|
||||
this.sdcLimit = sdcLimit;
|
||||
}
|
||||
|
||||
public Integer getSdcLimit()
|
||||
{
|
||||
return sdcLimit;
|
||||
}
|
||||
|
||||
public void setSdcDown(BigDecimal sdcDown)
|
||||
{
|
||||
this.sdcDown = sdcDown;
|
||||
}
|
||||
|
||||
public BigDecimal getSdcDown()
|
||||
{
|
||||
return sdcDown;
|
||||
}
|
||||
|
||||
public void setSdcUp(BigDecimal sdcUp)
|
||||
{
|
||||
this.sdcUp = sdcUp;
|
||||
}
|
||||
|
||||
public BigDecimal getSdcUp()
|
||||
{
|
||||
return sdcUp;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public Date getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(Date startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public Date getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Date endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public BigDecimal getChargeDischargePower() {
|
||||
return chargeDischargePower;
|
||||
}
|
||||
|
||||
public void setChargeDischargePower(BigDecimal chargeDischargePower) {
|
||||
this.chargeDischargePower = chargeDischargePower;
|
||||
}
|
||||
|
||||
public String getChargeStatus() {
|
||||
return chargeStatus;
|
||||
}
|
||||
|
||||
public void setChargeStatus(String chargeStatus) {
|
||||
this.chargeStatus = chargeStatus;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
/**
|
||||
* 时间配置显示对象
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-12
|
||||
*/
|
||||
public class StrategyTimeConfigVo
|
||||
{
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 关联的策略ID */
|
||||
private Long strategyId;
|
||||
|
||||
/** 月份,1-12 */
|
||||
private Long month;
|
||||
|
||||
/** 站点id */
|
||||
private String siteId;
|
||||
|
||||
/** 充放电模式 */
|
||||
private String chargeDischargeMode;
|
||||
|
||||
/** 模板id */
|
||||
private String templateId;
|
||||
|
||||
/** 模板名称 */
|
||||
private String templateName;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setStrategyId(Long strategyId)
|
||||
{
|
||||
this.strategyId = strategyId;
|
||||
}
|
||||
|
||||
public Long getStrategyId()
|
||||
{
|
||||
return strategyId;
|
||||
}
|
||||
|
||||
public void setMonth(Long month)
|
||||
{
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public Long getMonth()
|
||||
{
|
||||
return month;
|
||||
}
|
||||
|
||||
public void setChargeDischargeMode(String chargeDischargeMode)
|
||||
{
|
||||
this.chargeDischargeMode = chargeDischargeMode;
|
||||
}
|
||||
|
||||
public String getChargeDischargeMode()
|
||||
{
|
||||
return chargeDischargeMode;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setTemplateId(String templateId)
|
||||
{
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
public String getTemplateId()
|
||||
{
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public String getTemplateName() {
|
||||
return templateName;
|
||||
}
|
||||
|
||||
public void setTemplateName(String templateName) {
|
||||
this.templateName = templateName;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import com.xzzn.ems.domain.EmsTicket;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 工单列表对象
|
||||
*
|
||||
*/
|
||||
public class TicketListVo extends EmsTicket
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// 提交人姓名
|
||||
private String userName;
|
||||
// 处理人姓名
|
||||
private String workName;
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getWorkName() {
|
||||
return workName;
|
||||
}
|
||||
|
||||
public void setWorkName(String workName) {
|
||||
this.workName = workName;
|
||||
}
|
||||
}
|
||||
@ -76,17 +76,12 @@ public interface EmsDevicesSettingMapper
|
||||
*/
|
||||
public List<Map<String, Object>> getDeviceInfosBySiteIdAndCategory(@Param("siteId")String siteId, @Param("deviceCategory")String deviceCategory);
|
||||
|
||||
/**
|
||||
* 获取该设备的详细数据
|
||||
* @param deviceId
|
||||
* @return
|
||||
*/
|
||||
public EmsDevicesSetting getDeviceDetailInfo(String deviceId);
|
||||
|
||||
/**
|
||||
* 获取该设备下的总表
|
||||
* @param siteId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> getLoadNameList(String siteId);
|
||||
|
||||
public EmsDevicesSetting getDeviceBySiteAndDeviceId(@Param("deviceId")String deviceId, @Param("siteId")String siteId);
|
||||
}
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package com.xzzn.ems.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.ems.domain.EmsStrategyCurve;
|
||||
|
||||
/**
|
||||
* 策曲线Mapper接口
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
public interface EmsStrategyCurveMapper
|
||||
{
|
||||
/**
|
||||
* 查询策曲线
|
||||
*
|
||||
* @param id 策曲线主键
|
||||
* @return 策曲线
|
||||
*/
|
||||
public EmsStrategyCurve selectEmsStrategyCurveById(Long id);
|
||||
|
||||
/**
|
||||
* 查询策曲线列表
|
||||
*
|
||||
* @param emsStrategyCurve 策曲线
|
||||
* @return 策曲线集合
|
||||
*/
|
||||
public List<EmsStrategyCurve> selectEmsStrategyCurveList(EmsStrategyCurve emsStrategyCurve);
|
||||
|
||||
/**
|
||||
* 新增策曲线
|
||||
*
|
||||
* @param emsStrategyCurve 策曲线
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsStrategyCurve(EmsStrategyCurve emsStrategyCurve);
|
||||
|
||||
/**
|
||||
* 修改策曲线
|
||||
*
|
||||
* @param emsStrategyCurve 策曲线
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsStrategyCurve(EmsStrategyCurve emsStrategyCurve);
|
||||
|
||||
/**
|
||||
* 删除策曲线
|
||||
*
|
||||
* @param id 策曲线主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsStrategyCurveById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除策曲线
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsStrategyCurveByIds(Long[] ids);
|
||||
}
|
||||
@ -60,7 +60,7 @@ public interface EmsStrategyRunningMapper
|
||||
*/
|
||||
public int deleteEmsStrategyRunningByIds(Long[] ids);
|
||||
|
||||
// 获取站点运行策略
|
||||
// 获取站点运行策略列表
|
||||
public List<StrategyRunningVo> getRunningList(String siteId);
|
||||
|
||||
// 停止策略
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
package com.xzzn.ems.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.xzzn.ems.domain.EmsStrategyTemp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 模板Mapper接口
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
public interface EmsStrategyTempMapper
|
||||
{
|
||||
/**
|
||||
* 查询模板
|
||||
*
|
||||
* @param id 模板主键
|
||||
* @return 模板
|
||||
*/
|
||||
public EmsStrategyTemp selectEmsStrategyTempById(Long id);
|
||||
|
||||
/**
|
||||
* 查询模板列表
|
||||
*
|
||||
* @param emsStrategyTemp 模板
|
||||
* @return 模板集合
|
||||
*/
|
||||
public List<EmsStrategyTemp> selectEmsStrategyTempList(EmsStrategyTemp emsStrategyTemp);
|
||||
|
||||
/**
|
||||
* 新增模板
|
||||
*
|
||||
* @param emsStrategyTemp 模板
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsStrategyTemp(EmsStrategyTemp emsStrategyTemp);
|
||||
|
||||
/**
|
||||
* 修改模板
|
||||
*
|
||||
* @param emsStrategyTemp 模板
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsStrategyTemp(EmsStrategyTemp emsStrategyTemp);
|
||||
|
||||
/**
|
||||
* 删除模板
|
||||
*
|
||||
* @param id 模板主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsStrategyTempById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除模板
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsStrategyTempByIds(Long[] ids);
|
||||
|
||||
// 获取模板名称和id
|
||||
public List<Map<String,String>> getTempNameList(@Param("strategyId")Long strategyId, @Param("siteId")String siteId);
|
||||
|
||||
// 根据模板id获取模板所有的时间配置
|
||||
public List<EmsStrategyTemp> selectStrategyTempByTempId(String templateId);
|
||||
|
||||
// 根据模板id全部删除
|
||||
public int deleteTempByTempId(String templateId);
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package com.xzzn.ems.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.ems.domain.EmsStrategyTimeConfig;
|
||||
import com.xzzn.ems.domain.vo.StrategyTimeConfigVo;
|
||||
|
||||
/**
|
||||
* 时间配置Mapper接口
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
public interface EmsStrategyTimeConfigMapper
|
||||
{
|
||||
/**
|
||||
* 查询时间配置
|
||||
*
|
||||
* @param id 时间配置主键
|
||||
* @return 时间配置
|
||||
*/
|
||||
public EmsStrategyTimeConfig selectEmsStrategyTimeConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询时间配置列表
|
||||
*
|
||||
* @param emsStrategyTimeConfig 时间配置
|
||||
* @return 时间配置集合
|
||||
*/
|
||||
public List<EmsStrategyTimeConfig> selectEmsStrategyTimeConfigList(EmsStrategyTimeConfig emsStrategyTimeConfig);
|
||||
|
||||
/**
|
||||
* 新增时间配置
|
||||
*
|
||||
* @param emsStrategyTimeConfig 时间配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsStrategyTimeConfig(EmsStrategyTimeConfig emsStrategyTimeConfig);
|
||||
|
||||
/**
|
||||
* 修改时间配置
|
||||
*
|
||||
* @param emsStrategyTimeConfig 时间配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsStrategyTimeConfig(EmsStrategyTimeConfig emsStrategyTimeConfig);
|
||||
|
||||
/**
|
||||
* 删除时间配置
|
||||
*
|
||||
* @param id 时间配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsStrategyTimeConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除时间配置
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsStrategyTimeConfigByIds(Long[] ids);
|
||||
|
||||
// 获取该策略下的时间配置
|
||||
public List<StrategyTimeConfigVo> getStrategyTimeList(EmsStrategyTimeConfig emsStrategyTimeConfig);
|
||||
|
||||
// 清空该月的模板信息
|
||||
public void cleanTemplateId(String templateId);
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xzzn.ems.mapper;
|
||||
|
||||
import com.xzzn.ems.domain.EmsTicket;
|
||||
import com.xzzn.ems.domain.vo.TicketListVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -66,4 +67,11 @@ public interface EmsTicketMapper
|
||||
* @return
|
||||
*/
|
||||
public int dropEmsTicketById(String id);
|
||||
|
||||
/**
|
||||
* 获取工单列表
|
||||
* @param emsTicket
|
||||
* @return
|
||||
*/
|
||||
public List<TicketListVo> getAllTicketList(EmsTicket emsTicket);
|
||||
}
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package com.xzzn.ems.service;
|
||||
|
||||
import com.xzzn.common.enums.DeviceCategory;
|
||||
import com.xzzn.ems.domain.EmsDevicesSetting;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备信息 服务层
|
||||
*
|
||||
@ -9,5 +12,13 @@ import com.xzzn.ems.domain.EmsDevicesSetting;
|
||||
public interface IEmsDeviceSettingService
|
||||
{
|
||||
|
||||
public EmsDevicesSetting getDeviceDetailInfo(String deviceId);
|
||||
public EmsDevicesSetting getDeviceDetailInfo(Long deviceId);
|
||||
|
||||
public int addDevice(EmsDevicesSetting devicesSetting);
|
||||
|
||||
public int updateDevice(EmsDevicesSetting emsDevicesSetting);
|
||||
|
||||
public int deleteEmsDevicesSettingById(Long id);
|
||||
|
||||
public List<DeviceCategory> getDeviceCategory();
|
||||
}
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package com.xzzn.ems.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.ems.domain.EmsStrategyCurve;
|
||||
|
||||
/**
|
||||
* 策曲线Service接口
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
public interface IEmsStrategyCurveService
|
||||
{
|
||||
/**
|
||||
* 查询策曲线
|
||||
*
|
||||
* @param id 策曲线主键
|
||||
* @return 策曲线
|
||||
*/
|
||||
public EmsStrategyCurve selectEmsStrategyCurveById(Long id);
|
||||
|
||||
/**
|
||||
* 查询策曲线列表
|
||||
*
|
||||
* @param emsStrategyCurve 策曲线
|
||||
* @return 策曲线集合
|
||||
*/
|
||||
public List<EmsStrategyCurve> selectEmsStrategyCurveList(EmsStrategyCurve emsStrategyCurve);
|
||||
|
||||
/**
|
||||
* 新增策曲线
|
||||
*
|
||||
* @param emsStrategyCurve 策曲线
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsStrategyCurve(EmsStrategyCurve emsStrategyCurve);
|
||||
|
||||
/**
|
||||
* 修改策曲线
|
||||
*
|
||||
* @param emsStrategyCurve 策曲线
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsStrategyCurve(EmsStrategyCurve emsStrategyCurve);
|
||||
|
||||
/**
|
||||
* 批量删除策曲线
|
||||
*
|
||||
* @param ids 需要删除的策曲线主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsStrategyCurveByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除策曲线信息
|
||||
*
|
||||
* @param id 策曲线主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsStrategyCurveById(Long id);
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.xzzn.ems.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.xzzn.ems.domain.EmsStrategyTemp;
|
||||
import com.xzzn.ems.domain.vo.StrategyTempConfigRequest;
|
||||
|
||||
/**
|
||||
* 模板Service接口
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
public interface IEmsStrategyTempService
|
||||
{
|
||||
/**
|
||||
* 修改模板
|
||||
*
|
||||
* @param requestVo 模板
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean updateEmsStrategyTemp(StrategyTempConfigRequest requestVo);
|
||||
|
||||
public List<Map<String,String>> getTempNameList(Long strategyId, String siteId);
|
||||
|
||||
// 获取该模板下的时间配置
|
||||
public List<EmsStrategyTemp> selectEmsStrategyTempList(String templateId);
|
||||
|
||||
// 新增模板及时间配置
|
||||
public boolean addNewTempAndTimeConfig(StrategyTempConfigRequest requestVo);
|
||||
|
||||
//根据templateId删除模板
|
||||
public int deleteStrategyTempById(String templateId);
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.xzzn.ems.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.ems.domain.EmsStrategyTimeConfig;
|
||||
import com.xzzn.ems.domain.vo.StrategyTimeConfigVo;
|
||||
|
||||
/**
|
||||
* 时间配置Service接口
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
public interface IEmsStrategyTimeConfigService
|
||||
{
|
||||
/**
|
||||
* 查询时间配置
|
||||
*
|
||||
* @param id 时间配置主键
|
||||
* @return 时间配置
|
||||
*/
|
||||
public EmsStrategyTimeConfig selectEmsStrategyTimeConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询时间配置列表
|
||||
*
|
||||
* @param emsStrategyTimeConfig 时间配置
|
||||
* @return 时间配置集合
|
||||
*/
|
||||
public List<EmsStrategyTimeConfig> selectEmsStrategyTimeConfigList(EmsStrategyTimeConfig emsStrategyTimeConfig);
|
||||
|
||||
/**
|
||||
* 新增时间配置
|
||||
*
|
||||
* @param emsStrategyTimeConfig 时间配置
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean insertEmsStrategyTimeConfig(List<EmsStrategyTimeConfig> emsStrategyTimeConfig);
|
||||
|
||||
/**
|
||||
* 修改时间配置
|
||||
*
|
||||
* @param emsStrategyTimeConfig 时间配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsStrategyTimeConfig(EmsStrategyTimeConfig emsStrategyTimeConfig);
|
||||
|
||||
/**
|
||||
* 批量删除时间配置
|
||||
*
|
||||
* @param ids 需要删除的时间配置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsStrategyTimeConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除时间配置信息
|
||||
*
|
||||
* @param id 时间配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsStrategyTimeConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 获取策略的时间配置列表
|
||||
*
|
||||
* @param emsStrategyTimeConfig 时间配置
|
||||
* @return 时间配置集合
|
||||
*/
|
||||
public List<StrategyTimeConfigVo> getStrategyTimeList(EmsStrategyTimeConfig emsStrategyTimeConfig);
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xzzn.ems.service;
|
||||
|
||||
import com.xzzn.ems.domain.EmsTicket;
|
||||
import com.xzzn.ems.domain.vo.TicketListVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -66,4 +67,12 @@ public interface IEmsTicketService
|
||||
* @return
|
||||
*/
|
||||
public int dropEmsTicketById(String id);
|
||||
|
||||
/**
|
||||
* 获取工单列表
|
||||
*
|
||||
* @param emsTicket 工单主
|
||||
* @return 工单主集合
|
||||
*/
|
||||
public List<TicketListVo> getAllTicketList(EmsTicket emsTicket);
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ public class EmsAlarmRecordsServiceImpl implements IEmsAlarmRecordsService
|
||||
emsTicket.setTicketNo(ticketNo);
|
||||
emsTicket.setTitle("工单"+id.toString());
|
||||
emsTicket.setContent(emsAlarmRecords.getAlarmContent());
|
||||
emsTicket.setUserId(userId.toString());
|
||||
emsTicket.setUserId(userId);
|
||||
emsTicket.setWorkUserId(userId);
|
||||
emsTicket.setCreateTime(DateUtils.getNowDate());
|
||||
emsTicket.setCreateBy(user.getUserName());
|
||||
|
||||
@ -1,11 +1,17 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import com.xzzn.common.enums.DeviceCategory;
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsDevicesSetting;
|
||||
import com.xzzn.ems.mapper.EmsDevicesSettingMapper;
|
||||
import com.xzzn.ems.service.IEmsDeviceSettingService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 站点信息 服务层实现
|
||||
*
|
||||
@ -18,11 +24,86 @@ public class EmsDeviceSettingServiceImpl implements IEmsDeviceSettingService
|
||||
|
||||
/**
|
||||
* 获取设备详细信息
|
||||
* @param deviceId
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public EmsDevicesSetting getDeviceDetailInfo(String deviceId) {
|
||||
return emsDevicesMapper.getDeviceDetailInfo(deviceId);
|
||||
public EmsDevicesSetting getDeviceDetailInfo(Long id) {
|
||||
return emsDevicesMapper.selectEmsDevicesSettingById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
* @param devicesSetting
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int addDevice(EmsDevicesSetting devicesSetting) {
|
||||
boolean flag = checkDeviceExist(devicesSetting);
|
||||
if (flag) {
|
||||
return -1;
|
||||
}
|
||||
devicesSetting.setCreateTime(DateUtils.getNowDate());
|
||||
return emsDevicesMapper.insertEmsDevicesSetting(devicesSetting);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设备
|
||||
* @param devicesSetting
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateDevice(EmsDevicesSetting devicesSetting) {
|
||||
boolean checkExist = false;
|
||||
if (devicesSetting.getId() != null) {
|
||||
// 根据id判断该数据是否存在
|
||||
EmsDevicesSetting existDevice = emsDevicesMapper.selectEmsDevicesSettingById(devicesSetting.getId());
|
||||
if (existDevice == null) {
|
||||
return -1;
|
||||
}
|
||||
// 存在判断是否修改deviceId和siteId
|
||||
String deviceId = existDevice.getDeviceId();
|
||||
String siteId = existDevice.getSiteId();
|
||||
if (!deviceId.equals(devicesSetting.getDeviceId())
|
||||
|| !siteId.equals(devicesSetting.getSiteId())) {
|
||||
checkExist = checkDeviceExist(devicesSetting);
|
||||
}
|
||||
}
|
||||
// 已修改校验修改后数据是否存在
|
||||
if (checkExist) {
|
||||
return -2;
|
||||
}
|
||||
devicesSetting.setUpdateTime(DateUtils.getNowDate());
|
||||
return emsDevicesMapper.updateEmsDevicesSetting(devicesSetting);
|
||||
}
|
||||
|
||||
private boolean checkDeviceExist(EmsDevicesSetting devicesSetting) {
|
||||
String deviceId = devicesSetting.getDeviceId();
|
||||
String siteId = devicesSetting.getSiteId();
|
||||
if (!StringUtils.isEmpty(deviceId) && !StringUtils.isEmpty(siteId)) {
|
||||
EmsDevicesSetting emsDevicesSetting = emsDevicesMapper.getDeviceBySiteAndDeviceId(deviceId, siteId);
|
||||
if (emsDevicesSetting != null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备配置信息
|
||||
*
|
||||
* @param id Modbus设备配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsDevicesSettingById(Long id){
|
||||
|
||||
return emsDevicesMapper.deleteEmsDevicesSettingById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceCategory> getDeviceCategory() {
|
||||
List<DeviceCategory> deviceList = Arrays.asList(DeviceCategory.values());
|
||||
return deviceList;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,96 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.xzzn.ems.mapper.EmsStrategyCurveMapper;
|
||||
import com.xzzn.ems.domain.EmsStrategyCurve;
|
||||
import com.xzzn.ems.service.IEmsStrategyCurveService;
|
||||
|
||||
/**
|
||||
* 策曲线Service业务层处理
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@Service
|
||||
public class EmsStrategyCurveServiceImpl implements IEmsStrategyCurveService
|
||||
{
|
||||
@Autowired
|
||||
private EmsStrategyCurveMapper emsStrategyCurveMapper;
|
||||
|
||||
/**
|
||||
* 查询策曲线
|
||||
*
|
||||
* @param id 策曲线主键
|
||||
* @return 策曲线
|
||||
*/
|
||||
@Override
|
||||
public EmsStrategyCurve selectEmsStrategyCurveById(Long id)
|
||||
{
|
||||
return emsStrategyCurveMapper.selectEmsStrategyCurveById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询策曲线列表
|
||||
*
|
||||
* @param emsStrategyCurve 策曲线
|
||||
* @return 策曲线
|
||||
*/
|
||||
@Override
|
||||
public List<EmsStrategyCurve> selectEmsStrategyCurveList(EmsStrategyCurve emsStrategyCurve)
|
||||
{
|
||||
return emsStrategyCurveMapper.selectEmsStrategyCurveList(emsStrategyCurve);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增策曲线
|
||||
*
|
||||
* @param emsStrategyCurve 策曲线
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEmsStrategyCurve(EmsStrategyCurve emsStrategyCurve)
|
||||
{
|
||||
emsStrategyCurve.setCreateTime(DateUtils.getNowDate());
|
||||
return emsStrategyCurveMapper.insertEmsStrategyCurve(emsStrategyCurve);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改策曲线
|
||||
*
|
||||
* @param emsStrategyCurve 策曲线
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEmsStrategyCurve(EmsStrategyCurve emsStrategyCurve)
|
||||
{
|
||||
emsStrategyCurve.setUpdateTime(DateUtils.getNowDate());
|
||||
return emsStrategyCurveMapper.updateEmsStrategyCurve(emsStrategyCurve);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除策曲线
|
||||
*
|
||||
* @param ids 需要删除的策曲线主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsStrategyCurveByIds(Long[] ids)
|
||||
{
|
||||
return emsStrategyCurveMapper.deleteEmsStrategyCurveByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除策曲线信息
|
||||
*
|
||||
* @param id 策曲线主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsStrategyCurveById(Long id)
|
||||
{
|
||||
return emsStrategyCurveMapper.deleteEmsStrategyCurveById(id);
|
||||
}
|
||||
}
|
||||
@ -27,8 +27,7 @@ public class EmsStrategyServiceImpl implements IEmsStrategyService
|
||||
|
||||
@Override
|
||||
public List<StrategyRunningVo> selectEmsStrategyRunningList(String siteId) {
|
||||
List<StrategyRunningVo> dataList = emsStrategyRunningMapper.getRunningList(siteId);
|
||||
return dataList;
|
||||
return emsStrategyRunningMapper.getRunningList(siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -48,15 +47,19 @@ public class EmsStrategyServiceImpl implements IEmsStrategyService
|
||||
|
||||
@Override
|
||||
public int configStrategy(EmsStrategyRunning emsStrategyRunning) {
|
||||
// 校验改策略是否已存在
|
||||
// 校验是否已存在已运行的相同策略
|
||||
EmsStrategyRunning existStrategy = emsStrategyRunningMapper.selectEmsStrategyRunning(emsStrategyRunning);
|
||||
if (existStrategy != null) {
|
||||
return -1;
|
||||
}
|
||||
// 不存在则插入
|
||||
// 传策略组id-更新
|
||||
if (emsStrategyRunning.getId() != null){
|
||||
emsStrategyRunning.setUpdateTime(DateUtils.getNowDate());
|
||||
return emsStrategyRunningMapper.updateEmsStrategyRunning(emsStrategyRunning);
|
||||
}
|
||||
// 否则新增
|
||||
emsStrategyRunning.setStatus("1");
|
||||
emsStrategyRunning.setCreateTime(DateUtils.getNowDate());
|
||||
emsStrategyRunning.setUpdateTime(DateUtils.getNowDate());
|
||||
return emsStrategyRunningMapper.insertEmsStrategyRunning(emsStrategyRunning);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,116 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.common.utils.bean.BeanUtils;
|
||||
import com.xzzn.ems.domain.EmsStrategyTempTimeConfig;
|
||||
import com.xzzn.ems.domain.vo.StrategyTempConfigRequest;
|
||||
import com.xzzn.ems.mapper.EmsStrategyTimeConfigMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.xzzn.ems.mapper.EmsStrategyTempMapper;
|
||||
import com.xzzn.ems.domain.EmsStrategyTemp;
|
||||
import com.xzzn.ems.service.IEmsStrategyTempService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 模板Service业务层处理
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@Service
|
||||
public class EmsStrategyTempServiceImpl implements IEmsStrategyTempService
|
||||
{
|
||||
private static final String PREFIX= "Temp";
|
||||
@Autowired
|
||||
private EmsStrategyTempMapper emsStrategyTempMapper;
|
||||
@Autowired
|
||||
private EmsStrategyTimeConfigMapper emsStrategyTimeConfigMapper;
|
||||
|
||||
/**
|
||||
* 查询模板列表
|
||||
*
|
||||
* @param templateId 模板
|
||||
* @return 模板
|
||||
*/
|
||||
@Override
|
||||
public List<EmsStrategyTemp> selectEmsStrategyTempList(String templateId)
|
||||
{
|
||||
return emsStrategyTempMapper.selectStrategyTempByTempId(templateId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增模板和时间配置
|
||||
* @param requestVo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean addNewTempAndTimeConfig(StrategyTempConfigRequest requestVo) {
|
||||
// 随机生产模板id格式:Temp+时间戳
|
||||
String templateId = requestVo.getTemplateId();
|
||||
if (StringUtils.isEmpty(templateId)) {
|
||||
templateId = PREFIX + DateUtils.dateTimeNow();
|
||||
}
|
||||
|
||||
EmsStrategyTemp publicTemp = new EmsStrategyTemp();
|
||||
BeanUtils.copyProperties(requestVo, publicTemp);
|
||||
publicTemp.setTemplateId(templateId);
|
||||
publicTemp.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
List<EmsStrategyTempTimeConfig> timeList = requestVo.getTimeConfigList();
|
||||
if (timeList != null && !timeList.isEmpty()) {
|
||||
for (EmsStrategyTempTimeConfig timeConfig : timeList) {
|
||||
EmsStrategyTemp temp = new EmsStrategyTemp();
|
||||
BeanUtils.copyProperties(publicTemp, temp);
|
||||
// 时间设置
|
||||
temp.setStartTime(timeConfig.getStartTime());
|
||||
temp.setEndTime(timeConfig.getEndTime());
|
||||
temp.setChargeDischargePower(timeConfig.getChargeDischargePower());
|
||||
temp.setChargeStatus(timeConfig.getChargeStatus());
|
||||
emsStrategyTempMapper.insertEmsStrategyTemp(temp);
|
||||
}
|
||||
} else {// 无时间配置只配置模板基本信息
|
||||
emsStrategyTempMapper.insertEmsStrategyTemp(publicTemp);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改模板
|
||||
*
|
||||
* @param requestVo 模板
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateEmsStrategyTemp(StrategyTempConfigRequest requestVo)
|
||||
{
|
||||
String templateId = requestVo.getTemplateId();
|
||||
// 无发匹配原数据
|
||||
// 全删
|
||||
emsStrategyTempMapper.deleteTempByTempId(templateId);
|
||||
|
||||
// 重新新增
|
||||
addNewTempAndTimeConfig(requestVo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String,String>> getTempNameList(Long strategyId, String siteId) {
|
||||
return emsStrategyTempMapper.getTempNameList(strategyId, siteId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteStrategyTempById(String templateId) {
|
||||
// 先更新配置该模板的月份数据
|
||||
emsStrategyTimeConfigMapper.cleanTemplateId(templateId);
|
||||
return emsStrategyTempMapper.deleteTempByTempId(templateId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,121 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
import com.xzzn.ems.domain.vo.StrategyTimeConfigVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.xzzn.ems.mapper.EmsStrategyTimeConfigMapper;
|
||||
import com.xzzn.ems.domain.EmsStrategyTimeConfig;
|
||||
import com.xzzn.ems.service.IEmsStrategyTimeConfigService;
|
||||
|
||||
/**
|
||||
* 时间配置Service业务层处理
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@Service
|
||||
public class EmsStrategyTimeConfigServiceImpl implements IEmsStrategyTimeConfigService
|
||||
{
|
||||
@Autowired
|
||||
private EmsStrategyTimeConfigMapper emsStrategyTimeConfigMapper;
|
||||
|
||||
/**
|
||||
* 查询时间配置
|
||||
*
|
||||
* @param id 时间配置主键
|
||||
* @return 时间配置
|
||||
*/
|
||||
@Override
|
||||
public EmsStrategyTimeConfig selectEmsStrategyTimeConfigById(Long id)
|
||||
{
|
||||
return emsStrategyTimeConfigMapper.selectEmsStrategyTimeConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询时间配置列表
|
||||
*
|
||||
* @param emsStrategyTimeConfig 时间配置
|
||||
* @return 时间配置
|
||||
*/
|
||||
@Override
|
||||
public List<EmsStrategyTimeConfig> selectEmsStrategyTimeConfigList(EmsStrategyTimeConfig emsStrategyTimeConfig)
|
||||
{
|
||||
return emsStrategyTimeConfigMapper.selectEmsStrategyTimeConfigList(emsStrategyTimeConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增时间配置
|
||||
*
|
||||
* @param timeConfigList 时间配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean insertEmsStrategyTimeConfig(List<EmsStrategyTimeConfig> timeConfigList)
|
||||
{
|
||||
if (timeConfigList != null) {
|
||||
for (EmsStrategyTimeConfig strategyTimeConfig : timeConfigList) {
|
||||
Long id = strategyTimeConfig.getId();
|
||||
// 新增
|
||||
if (id == null) {
|
||||
strategyTimeConfig.setCreateTime(DateUtils.getNowDate());
|
||||
emsStrategyTimeConfigMapper.insertEmsStrategyTimeConfig(strategyTimeConfig);
|
||||
} else {//更新
|
||||
strategyTimeConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
emsStrategyTimeConfigMapper.updateEmsStrategyTimeConfig(strategyTimeConfig);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改时间配置
|
||||
*
|
||||
* @param emsStrategyTimeConfig 时间配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEmsStrategyTimeConfig(EmsStrategyTimeConfig emsStrategyTimeConfig)
|
||||
{
|
||||
emsStrategyTimeConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
return emsStrategyTimeConfigMapper.updateEmsStrategyTimeConfig(emsStrategyTimeConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除时间配置
|
||||
*
|
||||
* @param ids 需要删除的时间配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsStrategyTimeConfigByIds(Long[] ids)
|
||||
{
|
||||
return emsStrategyTimeConfigMapper.deleteEmsStrategyTimeConfigByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除时间配置信息
|
||||
*
|
||||
* @param id 时间配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsStrategyTimeConfigById(Long id)
|
||||
{
|
||||
return emsStrategyTimeConfigMapper.deleteEmsStrategyTimeConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取策略时间配置显示数据
|
||||
* @param emsStrategyTimeConfig 时间配置
|
||||
* @return
|
||||
*/
|
||||
public List<StrategyTimeConfigVo> getStrategyTimeList(EmsStrategyTimeConfig emsStrategyTimeConfig)
|
||||
{
|
||||
return emsStrategyTimeConfigMapper.getStrategyTimeList(emsStrategyTimeConfig);
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,11 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
import com.xzzn.ems.domain.EmsTicket;
|
||||
import com.xzzn.ems.domain.vo.TicketListVo;
|
||||
import com.xzzn.ems.mapper.EmsTicketMapper;
|
||||
import com.xzzn.ems.service.IEmsTicketService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -54,6 +57,11 @@ public class EmsTicketServiceImpl implements IEmsTicketService
|
||||
@Override
|
||||
public int insertEmsTicket(EmsTicket emsTicket)
|
||||
{
|
||||
// 工单号随机生产
|
||||
String ticketNo = "";
|
||||
String nowDate = DateUtils.dateTime();
|
||||
ticketNo = "T" + nowDate + String.format("%06d", new Random().nextInt(1000000));
|
||||
emsTicket.setTicketNo(ticketNo);
|
||||
emsTicket.setCreateTime(DateUtils.getNowDate());
|
||||
return emsTicketMapper.insertEmsTicket(emsTicket);
|
||||
}
|
||||
@ -106,4 +114,9 @@ public class EmsTicketServiceImpl implements IEmsTicketService
|
||||
{
|
||||
return emsTicketMapper.dropEmsTicketById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TicketListVo> getAllTicketList(EmsTicket emsTicket) {
|
||||
return emsTicketMapper.getAllTicketList(emsTicket);
|
||||
}
|
||||
}
|
||||
|
||||
@ -402,7 +402,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
} else if (AMMETER_DEVICE_METE.equals(ammeterId)) {
|
||||
AmmeterMeteDataVo ammeterMeteDataVo = new AmmeterMeteDataVo();
|
||||
ammeterMeteDataVo.setDeviceName(ammeterDevice.get("deviceName").toString());
|
||||
ammeterMeteDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus").toString());
|
||||
ammeterMeteDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus") == null? "" :
|
||||
ammeterDevice.get("communicationStatus").toString());
|
||||
// 处理储能表数据
|
||||
dealAmmeterMeteData(ammeterData,ammeterMeteDataVo);
|
||||
ammeterResponse.setAmmeterMeteDataVoList(ammeterMeteDataVo);
|
||||
|
||||
@ -26,10 +26,11 @@
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="deviceCategory" column="device_category" />
|
||||
<result property="pictureUrl" column="picture_url" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsDevicesSettingVo">
|
||||
select id, device_name, device_type, slave_id, timeout_ms, retries, ip_address, ip_port, serial_port, baud_rate, data_bits, stop_bits, parity, description, created_at, updated_at, site_id, communication_status, device_id, parent_id, device_category from ems_devices_setting
|
||||
select id, device_name, device_type, slave_id, timeout_ms, retries, ip_address, ip_port, serial_port, baud_rate, data_bits, stop_bits, parity, description, created_at, updated_at, site_id, communication_status, device_id, parent_id, device_category, picture_url from ems_devices_setting
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsDevicesSettingList" parameterType="EmsDevicesSetting" resultMap="EmsDevicesSettingResult">
|
||||
@ -55,6 +56,7 @@
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
|
||||
<if test="deviceCategory != null and deviceCategory != ''"> and device_category = #{deviceCategory}</if>
|
||||
<if test="pictureUrl != null and pictureUrl != ''"> and picture_url = #{pictureUrl}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -86,6 +88,7 @@
|
||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="deviceCategory != null">device_category,</if>
|
||||
<if test="pictureUrl != null">picture_url,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
@ -108,6 +111,7 @@
|
||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="deviceCategory != null">#{deviceCategory},</if>
|
||||
<if test="pictureUrl != null">#{pictureUrl},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -134,6 +138,7 @@
|
||||
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="deviceCategory != null">device_category = #{deviceCategory},</if>
|
||||
<if test="pictureUrl != null">picture_url = #{pictureUrl},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -180,9 +185,10 @@
|
||||
from ems_devices_setting where site_id = #{siteId} and device_category = #{deviceCategory}
|
||||
</select>
|
||||
|
||||
<select id="getDeviceDetailInfo" parameterType="String" resultMap="EmsDevicesSettingResult">
|
||||
<select id="getDeviceBySiteAndDeviceId" parameterType="String" resultMap="EmsDevicesSettingResult">
|
||||
<include refid="selectEmsDevicesSettingVo"/>
|
||||
where device_id = #{deviceId}
|
||||
AND site_id = #{siteId}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
@ -137,7 +137,9 @@
|
||||
select es.site_id as siteId,es.site_name as siteName,
|
||||
ed.device_id as deviceId,ed.device_name as deviceName,
|
||||
ed.device_type as deviceType,ed.communication_status as communicationStatus,
|
||||
ed.device_category as deviceCategory
|
||||
ed.device_category as deviceCategory,
|
||||
ed.picture_url as pictureUrl,
|
||||
ed.id
|
||||
from ems_site_setting es INNER JOIN ems_devices_setting ed on es.site_id = ed.site_id
|
||||
where 1=1
|
||||
<if test="siteId != null and siteId != ''">
|
||||
|
||||
@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xzzn.ems.mapper.EmsStrategyCurveMapper">
|
||||
|
||||
<resultMap type="EmsStrategyCurve" id="EmsStrategyCurveResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="strategyId" column="strategy_id" />
|
||||
<result property="taskNumber" column="task_number" />
|
||||
<result property="startDate" column="start_date" />
|
||||
<result property="endDate" column="end_date" />
|
||||
<result property="powerData" column="power_data" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="siteId" column="site_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsStrategyCurveVo">
|
||||
select id, strategy_id, task_number, start_date, end_date, power_data, create_by, create_time, update_by, update_time, remark, site_id from ems_strategy_curve
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsStrategyCurveList" parameterType="EmsStrategyCurve" resultMap="EmsStrategyCurveResult">
|
||||
<include refid="selectEmsStrategyCurveVo"/>
|
||||
<where>
|
||||
<if test="strategyId != null "> and strategy_id = #{strategyId}</if>
|
||||
<if test="taskNumber != null "> and task_number = #{taskNumber}</if>
|
||||
<if test="startDate != null "> and start_date = #{startDate}</if>
|
||||
<if test="endDate != null "> and end_date = #{endDate}</if>
|
||||
<if test="powerData != null and powerData != ''"> and power_data = #{powerData}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsStrategyCurveById" parameterType="Long" resultMap="EmsStrategyCurveResult">
|
||||
<include refid="selectEmsStrategyCurveVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsStrategyCurve" parameterType="EmsStrategyCurve" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ems_strategy_curve
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="strategyId != null">strategy_id,</if>
|
||||
<if test="taskNumber != null">task_number,</if>
|
||||
<if test="startDate != null">start_date,</if>
|
||||
<if test="endDate != null">end_date,</if>
|
||||
<if test="powerData != null">power_data,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="siteId != null">site_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="strategyId != null">#{strategyId},</if>
|
||||
<if test="taskNumber != null">#{taskNumber},</if>
|
||||
<if test="startDate != null">#{startDate},</if>
|
||||
<if test="endDate != null">#{endDate},</if>
|
||||
<if test="powerData != null">#{powerData},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsStrategyCurve" parameterType="EmsStrategyCurve">
|
||||
update ems_strategy_curve
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="strategyId != null">strategy_id = #{strategyId},</if>
|
||||
<if test="taskNumber != null">task_number = #{taskNumber},</if>
|
||||
<if test="startDate != null">start_date = #{startDate},</if>
|
||||
<if test="endDate != null">end_date = #{endDate},</if>
|
||||
<if test="powerData != null">power_data = #{powerData},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsStrategyCurveById" parameterType="Long">
|
||||
delete from ems_strategy_curve where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsStrategyCurveByIds" parameterType="String">
|
||||
delete from ems_strategy_curve where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -91,7 +91,9 @@
|
||||
t.`status`,
|
||||
t.site_id as siteId,
|
||||
main.strategy_name as mainStrategyName,
|
||||
aux.strategy_name as auxStrategyName
|
||||
aux.strategy_name as auxStrategyName,
|
||||
main.id as mainStrategyId,
|
||||
aux.id as auxStrategyId
|
||||
from ems_strategy_running t
|
||||
LEFT JOIN ems_strategy main on t.main_strategy_id = main.id
|
||||
LEFT JOIN ems_strategy aux on t.auxiliary_strategy_id = aux.id
|
||||
@ -108,6 +110,6 @@
|
||||
where site_id = #{siteId}
|
||||
and main_strategy_id = #{mainStrategyId}
|
||||
and auxiliary_strategy_id = #{auxiliaryStrategyId}
|
||||
and `status` != 4
|
||||
and `status` = 1
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,146 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xzzn.ems.mapper.EmsStrategyTempMapper">
|
||||
|
||||
<resultMap type="EmsStrategyTemp" id="EmsStrategyTempResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="strategyId" column="strategy_id" />
|
||||
<result property="templateName" column="template_name" />
|
||||
<result property="sdcLimit" column="sdc_limit" />
|
||||
<result property="sdcDown" column="sdc_down" />
|
||||
<result property="sdcUp" column="sdc_up" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="chargeDischargePower" column="charge_discharge_power" />
|
||||
<result property="chargeStatus" column="charge_status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="templateId" column="template_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsStrategyTempVo">
|
||||
select id, strategy_id, template_name, sdc_limit, sdc_down, sdc_up, start_time, end_time, charge_discharge_power, charge_status, create_by, create_time, update_by, update_time, remark, site_id, template_id from ems_strategy_temp
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsStrategyTempList" parameterType="EmsStrategyTemp" resultMap="EmsStrategyTempResult">
|
||||
<include refid="selectEmsStrategyTempVo"/>
|
||||
<where>
|
||||
<if test="strategyId != null "> and strategy_id = #{strategyId}</if>
|
||||
<if test="templateName != null and templateName != ''"> and template_name like concat('%', #{templateName}, '%')</if>
|
||||
<if test="sdcLimit != null "> and sdc_limit = #{sdcLimit}</if>
|
||||
<if test="sdcDown != null "> and sdc_down = #{sdcDown}</if>
|
||||
<if test="sdcUp != null "> and sdc_up = #{sdcUp}</if>
|
||||
<if test="startTime != null "> and start_time = #{startTime}</if>
|
||||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
<if test="chargeDischargePower != null "> and charge_discharge_power = #{chargeDischargePower}</if>
|
||||
<if test="chargeStatus != null and chargeStatus != ''"> and charge_status = #{chargeStatus}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="templateId != null and templateId != ''"> and template_id = #{templateId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsStrategyTempById" parameterType="Long" resultMap="EmsStrategyTempResult">
|
||||
<include refid="selectEmsStrategyTempVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsStrategyTemp" parameterType="EmsStrategyTemp" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ems_strategy_temp
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="strategyId != null">strategy_id,</if>
|
||||
<if test="templateName != null">template_name,</if>
|
||||
<if test="sdcLimit != null">sdc_limit,</if>
|
||||
<if test="sdcDown != null">sdc_down,</if>
|
||||
<if test="sdcUp != null">sdc_up,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="chargeDischargePower != null">charge_discharge_power,</if>
|
||||
<if test="chargeStatus != null">charge_status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="templateId != null">template_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="strategyId != null">#{strategyId},</if>
|
||||
<if test="templateName != null">#{templateName},</if>
|
||||
<if test="sdcLimit != null">#{sdcLimit},</if>
|
||||
<if test="sdcDown != null">#{sdcDown},</if>
|
||||
<if test="sdcUp != null">#{sdcUp},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="chargeDischargePower != null">#{chargeDischargePower},</if>
|
||||
<if test="chargeStatus != null">#{chargeStatus},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
<if test="templateId != null">#{templateId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsStrategyTemp" parameterType="EmsStrategyTemp">
|
||||
update ems_strategy_temp
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="strategyId != null">strategy_id = #{strategyId},</if>
|
||||
<if test="templateName != null">template_name = #{templateName},</if>
|
||||
<if test="sdcLimit != null">sdc_limit = #{sdcLimit},</if>
|
||||
<if test="sdcDown != null">sdc_down = #{sdcDown},</if>
|
||||
<if test="sdcUp != null">sdc_up = #{sdcUp},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="chargeDischargePower != null">charge_discharge_power = #{chargeDischargePower},</if>
|
||||
<if test="chargeStatus != null">charge_status = #{chargeStatus},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="templateId != null">template_id = #{templateId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsStrategyTempById" parameterType="Long">
|
||||
delete from ems_strategy_temp where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsStrategyTempByIds" parameterType="String">
|
||||
delete from ems_strategy_temp where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getTempNameList" resultType="Map">
|
||||
select DISTINCT template_id as templateId,template_name as templateName
|
||||
from ems_strategy_temp
|
||||
where site_id = #{siteId}
|
||||
and strategy_id = #{strategyId}
|
||||
</select>
|
||||
|
||||
<select id="getStrategyTempByTempId" parameterType="String" resultType="int">
|
||||
select count(1) from ems_strategy_temp where template_id = #{templateId}
|
||||
</select>
|
||||
|
||||
<select id="selectStrategyTempByTempId" parameterType="String" resultMap="EmsStrategyTempResult">
|
||||
<include refid="selectEmsStrategyTempVo"/>
|
||||
where template_id = #{templateId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteTempByTempId" parameterType="String">
|
||||
delete from ems_strategy_temp where template_id = #{templateId}
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xzzn.ems.mapper.EmsStrategyTimeConfigMapper">
|
||||
|
||||
<resultMap type="EmsStrategyTimeConfig" id="EmsStrategyTimeConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="strategyId" column="strategy_id" />
|
||||
<result property="month" column="month" />
|
||||
<result property="chargeDischargeMode" column="charge_discharge_mode" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="templateId" column="template_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsStrategyTimeConfigVo">
|
||||
select id, strategy_id, month, charge_discharge_mode, create_by, create_time, update_by, update_time, remark, site_id, template_id from ems_strategy_time_config
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsStrategyTimeConfigList" parameterType="EmsStrategyTimeConfig" resultMap="EmsStrategyTimeConfigResult">
|
||||
<include refid="selectEmsStrategyTimeConfigVo"/>
|
||||
<where>
|
||||
<if test="strategyId != null "> and strategy_id = #{strategyId}</if>
|
||||
<if test="month != null "> and month = #{month}</if>
|
||||
<if test="chargeDischargeMode != null and chargeDischargeMode != ''"> and charge_discharge_mode = #{chargeDischargeMode}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="templateId != null and templateId != ''"> and template_id = #{templateId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsStrategyTimeConfigById" parameterType="Long" resultMap="EmsStrategyTimeConfigResult">
|
||||
<include refid="selectEmsStrategyTimeConfigVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsStrategyTimeConfig" parameterType="EmsStrategyTimeConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ems_strategy_time_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="strategyId != null">strategy_id,</if>
|
||||
<if test="month != null">month,</if>
|
||||
<if test="chargeDischargeMode != null">charge_discharge_mode,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="templateId != null">template_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="strategyId != null">#{strategyId},</if>
|
||||
<if test="month != null">#{month},</if>
|
||||
<if test="chargeDischargeMode != null">#{chargeDischargeMode},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
<if test="templateId != null">#{templateId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsStrategyTimeConfig" parameterType="EmsStrategyTimeConfig">
|
||||
update ems_strategy_time_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="strategyId != null">strategy_id = #{strategyId},</if>
|
||||
<if test="month != null">month = #{month},</if>
|
||||
<if test="chargeDischargeMode != null">charge_discharge_mode = #{chargeDischargeMode},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="templateId != null">template_id = #{templateId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsStrategyTimeConfigById" parameterType="Long">
|
||||
delete from ems_strategy_time_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsStrategyTimeConfigByIds" parameterType="String">
|
||||
delete from ems_strategy_time_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getStrategyTimeList" parameterType="EmsStrategyTimeConfig" resultType="com.xzzn.ems.domain.vo.StrategyTimeConfigVo">
|
||||
select distinct t.id,
|
||||
t.month,
|
||||
t.charge_discharge_mode as chargeDischargeMode,
|
||||
t.template_id as templateId,
|
||||
temp.template_name as templateName
|
||||
from ems_strategy_time_config t
|
||||
LEFT JOIN ems_strategy_temp temp on t.template_id = temp.template_id
|
||||
where t.site_id = #{siteId}
|
||||
and t.strategy_id = #{strategyId}
|
||||
order by month
|
||||
</select>
|
||||
|
||||
<update id="cleanTemplateId" parameterType="String">
|
||||
update ems_strategy_time_config set template_id = '' where template_id = #{templateId}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -114,4 +114,19 @@
|
||||
<update id="dropEmsTicketById" parameterType="String">
|
||||
update ems_ticket set isDelete = 0 where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getAllTicketList" resultType="com.xzzn.ems.domain.vo.TicketListVo">
|
||||
SELECT t.ticket_no as ticketNo,
|
||||
t.title as title,
|
||||
t.content as content,
|
||||
t.`status` as status,
|
||||
s.user_name as userName,
|
||||
s1.user_name as workName,
|
||||
t.create_time as createTime,
|
||||
t.id
|
||||
FROM ems_ticket t
|
||||
LEFT JOIN sys_user s on t.user_id = s.user_id
|
||||
LEFT JOIN sys_user s1 on t.work_user_id = s1.user_id
|
||||
where isDelete = 1
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user