Commit 2f189e9f authored by ZWT's avatar ZWT

feat(能源管理系统): 系统开发

1.开发基础信息配置-市电峰谷配置模块删除功能,完成接口冒烟测试并生成接口文档;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent fa9e503f
......@@ -130,15 +130,33 @@ public class BasePriceStrategyService {
@XApiPost
@XText("删除市电峰谷策略")
public XServiceResult deleteBasePriceStrategy(XContext context, DeleteBasePriceStrategyInput input) {
// PpsUserSession session = context.getSession(PpsUserSession.class);
PpsUserSession session = new PpsUserSession();
session.setId("123");
session.setUserName("ceshi");
String strategyId = input.getId();
//todo: 检查是否被其它功能引用
return XTransactionHelper.begin(context, () -> {
BasePriceStrategyMapper mapper = context.getBean(BasePriceStrategyMapper.class);
QueryWrapper<BasePriceStrategyEnt> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(BasePriceStrategyEnt::getId, input.getId());
queryWrapper.lambda().eq(BasePriceStrategyEnt::getId, strategyId);
BasePriceStrategyEnt entity = mapper.selectOne(queryWrapper);
if (entity == null) {
return XServiceResult.error(context, XError.NotFound);
}
//删除月数据
BasePriceStrategyMonthMapper monthMapper = context.getBean(BasePriceStrategyMonthMapper.class);
monthMapper.delete(new QueryWrapper<BasePriceStrategyMonthEnt>()
.lambda()
.eq(BasePriceStrategyMonthEnt::getStrategyId, strategyId));
//删除明细数据
BasePriceStrategyDetailMapper detailMapper = context.getBean(BasePriceStrategyDetailMapper.class);
detailMapper.delete(new QueryWrapper<BasePriceStrategyDetailEnt>()
.lambda()
.eq(BasePriceStrategyDetailEnt::getStrategyId, strategyId));
mapper.deleteById(entity);
return XServiceResult.OK;
});
}
@XApiAnonymous
......
package pps.core.base.service.data.base_price_strategy;
import lombok.Data;
import xstartup.annotation.XText;
import java.util.Date;
import java.math.BigDecimal;
import java.util.Date;
/**
* 删除市电峰谷配置入参
*
* @author ZWT
* @date 2023/08/25
*/
@Data
public class DeleteBasePriceStrategyInput {
@XText("ID")
private String id;
......@@ -43,109 +53,4 @@ public class DeleteBasePriceStrategyInput {
@XText("固定电价")
private BigDecimal fixedElectricityPrice;
public String getId() {
return this.id;
}
public void setId(String value) {
this.id = value;
}
public Integer getIsDeleted() {
return this.isDeleted;
}
public void setIsDeleted(Integer value) {
this.isDeleted = value;
}
public String getCreateById() {
return this.createById;
}
public void setCreateById(String value) {
this.createById = value;
}
public String getCreateByName() {
return this.createByName;
}
public void setCreateByName(String value) {
this.createByName = value;
}
public Date getCreateTime() {
return this.createTime;
}
public void setCreateTime(Date value) {
this.createTime = value;
}
public String getModifyById() {
return this.modifyById;
}
public void setModifyById(String value) {
this.modifyById = value;
}
public String getModifyByName() {
return this.modifyByName;
}
public void setModifyByName(String value) {
this.modifyByName = value;
}
public Date getModifyTime() {
return this.modifyTime;
}
public void setModifyTime(Date value) {
this.modifyTime = value;
}
public String getPolicyName() {
return this.policyName;
}
public void setPolicyName(String value) {
this.policyName = value;
}
public String getAreaCode() {
return this.areaCode;
}
public void setAreaCode(String value) {
this.areaCode = value;
}
public Integer getStrategyYear() {
return this.strategyYear;
}
public void setStrategyYear(Integer value) {
this.strategyYear = value;
}
public Integer getIsFixedPrice() {
return this.isFixedPrice;
}
public void setIsFixedPrice(Integer value) {
this.isFixedPrice = value;
}
public BigDecimal getFixedElectricityPrice() {
return this.fixedElectricityPrice;
}
public void setFixedElectricityPrice(BigDecimal value) {
this.fixedElectricityPrice = value;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment