Commit 390a38c1 authored by ZWT's avatar ZWT

feat(能源管理系统): 间开制度管理

1.开发间开制度管理-基础间开配置模块新增功能,完成接口冒烟测试并生成接口文档;
2.排查无法获取mapper对象导致空指针异常问题,space模块添加mapper配置类;
3.开发间开制度管理-基础间开配置模块修改功能,完成接口冒烟测试并生成接口文档;
4.开发间开制度管理-基础间开配置模块逻辑删除功能,完成接口冒烟测试并生成接口文档;
5.开发间开制度管理-基础间开配置模块详情功能,完成接口冒烟测试并生成接口文档;
6.开发基础信息管理-输电线路Cloud模块通过ID查询线路基本信息功能;
7.开发间开制度管理-基础间开配置模块分页列表功能,完成接口冒烟测试并生成接口文档;
8.开发基础信息管理-输电线路Cloud模块通过线路ID结婚查询线路名称集合基本信息功能;
9.开发间开制度管理-基础间开配置模块设为基础制度功能,完成接口冒烟测试并生成接口文档;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent cbc09c1f
......@@ -9,14 +9,14 @@ package pps.core.common.constant;
public class BusinessConstant {
/**
* 正常
*
*/
public static final Integer NORMAL = 1;
public static final Integer NO = 1;
/**
* 删除
*
*/
public static final Integer DELETE = 0;
public static final Integer YES = 0;
/*------------------------------字典------------------------------*/
......
......@@ -157,7 +157,7 @@ public class SpaceInstitutionDetailService {
SpaceInstitutionDurationMapper durationMapper = context.getBean(SpaceInstitutionDurationMapper.class);
durationMapper.update(null, new LambdaUpdateWrapper<SpaceInstitutionDurationEnt>()
.eq(SpaceInstitutionDurationEnt::getInstitutionId, institutionId)
.set(BaseModel::getIsDeleted, BusinessConstant.DELETE)
.set(BaseModel::getIsDeleted, BusinessConstant.YES)
.set(SpaceInstitutionDurationEnt::getModifyById, session.getId())
.set(SpaceInstitutionDurationEnt::getModifyByName, session.getUserName())
.set(SpaceInstitutionDurationEnt::getModifyTime, new Date())
......@@ -165,14 +165,14 @@ public class SpaceInstitutionDetailService {
SpaceInstitutionWellheadMapper wellheadMapper = context.getBean(SpaceInstitutionWellheadMapper.class);
wellheadMapper.update(null, new LambdaUpdateWrapper<SpaceInstitutionWellheadEnt>()
.eq(SpaceInstitutionWellheadEnt::getInstitutionId, institutionId)
.set(BaseModel::getIsDeleted, BusinessConstant.DELETE)
.set(BaseModel::getIsDeleted, BusinessConstant.YES)
.set(SpaceInstitutionWellheadEnt::getModifyById, session.getId())
.set(SpaceInstitutionWellheadEnt::getModifyByName, session.getUserName())
.set(SpaceInstitutionWellheadEnt::getModifyTime, new Date())
);
mapper.update(null, new LambdaUpdateWrapper<SpaceInstitutionDetailEnt>()
.eq(BaseModel::getId, institutionId)
.set(BaseModel::getIsDeleted, BusinessConstant.DELETE)
.set(BaseModel::getIsDeleted, BusinessConstant.YES)
.set(SpaceInstitutionDetailEnt::getModifyById, session.getId())
.set(SpaceInstitutionDetailEnt::getModifyByName, session.getUserName())
.set(SpaceInstitutionDetailEnt::getModifyTime, new Date())
......@@ -258,7 +258,7 @@ public class SpaceInstitutionDetailService {
SpaceInstitutionDetailMapper mapper = context.getBean(SpaceInstitutionDetailMapper.class);
PageHelper.startPage(input.getPage(), input.getLimit());
List<SpaceInstitutionDetailEnt> detailEntList = mapper.selectList(new LambdaQueryWrapper<SpaceInstitutionDetailEnt>()
.eq(BaseModel::getIsDeleted, BusinessConstant.NORMAL)
.eq(BaseModel::getIsDeleted, BusinessConstant.NO)
.eq(SpaceInstitutionDetailEnt::getOuId, input.getOuId())
.eq(StringUtils.isNotBlank(lineId), SpaceInstitutionDetailEnt::getLineId, lineId)
.like(StringUtils.isNotBlank(institutionName), SpaceInstitutionDetailEnt::getInstitutionName, institutionName)
......@@ -283,6 +283,49 @@ public class SpaceInstitutionDetailService {
return XPageResult.success(outputs, input, pageInfo.getTotal());
}
/**
* 基础间开配置--设为基础制度
*
* @param context 上下文
* @param input 输入
* @return {@link XServiceResult}
*/
@XApiAnonymous
@XApiPost
@XText("基础间开配置--设为基础制度")
public XServiceResult updateBasicInstitution(XContext context, UpdateSpaceInstitutionDetailInput input) {
String ouId = input.getOuId();
String lineId = input.getLineId();
if (StringUtils.isAnyBlank(ouId, lineId)) {
return XServiceResult.error(992, "缺少必填项");
}
String institutionId = input.getId();
return XTransactionHelper.begin(context, () -> {
SpaceInstitutionDetailMapper mapper = context.getBean(SpaceInstitutionDetailMapper.class);
SpaceInstitutionDetailEnt entity = this.getInstitutionDetail(mapper, institutionId);
if (Objects.isNull(entity)) {
return XServiceResult.error(context, XError.NotFound);
}
Integer isCurrentBasic = entity.getIsCurrentBasic();
if (isCurrentBasic.equals(BusinessConstant.YES)) {
return XServiceResult.error(992, "请勿重复设定");
}
//关闭当前基础制度
mapper.update(null, new LambdaUpdateWrapper<SpaceInstitutionDetailEnt>()
.eq(SpaceInstitutionDetailEnt::getOuId, ouId)
.eq(SpaceInstitutionDetailEnt::getLineId, lineId)
.eq(SpaceInstitutionDetailEnt::getIsCurrentBasic, BusinessConstant.YES)
.set(SpaceInstitutionDetailEnt::getIsCurrentBasic, BusinessConstant.NO)
);
//设定当前制度为基础制度
mapper.update(null, new LambdaUpdateWrapper<SpaceInstitutionDetailEnt>()
.eq(BaseModel::getId, institutionId)
.set(SpaceInstitutionDetailEnt::getIsCurrentBasic, BusinessConstant.YES)
);
return XServiceResult.OK;
});
}
/*-----------------------------------private-----------------------------------*/
/**
......
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