Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
c6a2ef2c43
@ -32,7 +32,8 @@ public interface SysEquipmentMapper extends BaseMapperPlus<SysEquipment, SysEqui
|
||||
// 获取设备的动作信息
|
||||
List<BaseImptabmappingVo> getEquipmentServiceInfo(Long equipmentId);
|
||||
|
||||
|
||||
int queryEquipmentByCode(@Param("code")String code);
|
||||
|
||||
SysEquipmentVo queryEquipmentInfoByCode(@Param("code")String code);
|
||||
|
||||
}
|
||||
|
@ -83,9 +83,12 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
|
||||
SysEquipment sysEquipment = new SysEquipment();
|
||||
BeanCopyUtils.copy(sysEquipmentDto, sysEquipment);
|
||||
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
|
||||
SysEquipmentVo oldSysEquipment = sysEquipmentMapper.queryEquipmentInfoByCode(sysEquipmentDto.getCode());
|
||||
// 判断设备编码是否存在
|
||||
if (sysEquipmentMapper.queryEquipmentByCode(sysEquipment.getCode()) > 0) {
|
||||
throw new RuntimeException("设备编码已存在");
|
||||
if (!oldSysEquipment.getId().equals(sysEquipmentDto.getId())) {
|
||||
throw new RuntimeException("设备编码已存在");
|
||||
}
|
||||
}
|
||||
sysEquipment.setUpdatedTime(new Date());
|
||||
sysEquipment.setUpdatedBy(sysUserVo.getAccount());
|
||||
|
@ -137,4 +137,8 @@
|
||||
select count(1) from sys_equipment where code = #{code}
|
||||
</select>
|
||||
|
||||
<select id="queryEquipmentInfoByCode" resultMap="SysEquipmentMap">
|
||||
select * from sys_equipment where code = #{code}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -203,7 +203,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="editDeviceData.objectType == '风电场' ? '装机容量:' : '额定容量:'">
|
||||
<el-form-item :label="editDeviceData.objectType == '风电场' ? '装机容量(MW):' : '额定容量(MW):'">
|
||||
<el-input-number
|
||||
style="width: 200px"
|
||||
:controls="false"
|
||||
@ -374,7 +374,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="editAddDeviceData.objectType == '风电场' ? '装机容量:' : '额定容量:'">
|
||||
<el-form-item :label="editAddDeviceData.objectType == '风电场' ? '装机容量(MW):' : '额定容量(MW):'">
|
||||
<el-input-number
|
||||
style="width: 200px"
|
||||
:controls="false"
|
||||
|
Loading…
Reference in New Issue
Block a user