Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
da5f0ad83e
@ -19,7 +19,7 @@ public interface SysIotModelMapper extends BaseMapper<SysIotModel> {
|
||||
|
||||
List<SysIotModelServiceExcel> queryServiceByModelId(Long id);
|
||||
|
||||
Long queryIotModelIdByName(String code);
|
||||
Long queryIotModelIdByCode(String code);
|
||||
|
||||
List<SysIotModelVo> getSysIotModelByType(Integer objectType);
|
||||
|
||||
|
@ -2,12 +2,14 @@ package com.das.modules.equipment.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.das.common.config.SessionUtil;
|
||||
import com.das.common.constant.EquipmentTypeIds;
|
||||
import com.das.common.exceptions.ServiceException;
|
||||
import com.das.common.utils.BeanCopyUtils;
|
||||
import com.das.common.utils.PageDataInfo;
|
||||
@ -41,6 +43,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.rmi.ServerException;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@ -249,10 +252,19 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
|
||||
List<SysEquipment> delSysEquipmentList = new ArrayList<>();
|
||||
// 遍历
|
||||
for (List<Object> row : list) {
|
||||
if (ObjectUtil.isAllNotEmpty(row.get(4),row.get(1),row.get(5))){
|
||||
throw new ServerException("请检查必填参数:"+row);
|
||||
}
|
||||
if (!Integer.valueOf(row.get(1).toString()).equals(EquipmentTypeIds.EQUIPMENT_TYPE_STATION_WTG) && !Integer.valueOf(row.get(1).toString()).equals(EquipmentTypeIds.EQUIPMENT_TYPE_WIND_FARM)){
|
||||
throw new ServerException("设备类型编码错误"+ row.get(1));
|
||||
}
|
||||
SysEquipment field = new SysEquipment();
|
||||
// 根据编码获取物模型id
|
||||
if (StringUtils.hasText(row.get(2).toString())) {
|
||||
Long iotModelId = sysIotModelMapper.queryIotModelIdByName(row.get(3).toString());
|
||||
Long iotModelId = sysIotModelMapper.queryIotModelIdByCode(row.get(2).toString());
|
||||
if (iotModelId == null){
|
||||
throw new ServerException("物模型编码错误,错误编码:"+ row.get(2).toString());
|
||||
}
|
||||
field.setIotModelId(iotModelId);
|
||||
}
|
||||
if (StringUtils.hasText(row.get(13).toString())) {
|
||||
@ -263,9 +275,9 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
|
||||
field.setObjectType(Integer.valueOf(row.get(1).toString()));
|
||||
field.setCode(row.get(4).toString());
|
||||
field.setName(row.get(5).toString());
|
||||
field.setMadeinFactory(row.get(6).toString());
|
||||
field.setModel(row.get(7).toString());
|
||||
field.setLocation(row.get(8).toString());
|
||||
field.setMadeinFactory(ObjectUtil.isEmpty(row.get(6)) ? null : row.get(6).toString());
|
||||
field.setModel(ObjectUtil.isEmpty(row.get(7)) ? null : row.get(7).toString());
|
||||
field.setLocation(ObjectUtil.isEmpty(row.get(8)) ? null : row.get(8).toString());
|
||||
if (StringUtils.hasText(row.get(9).toString())) {
|
||||
field.setLongitude(Double.valueOf(row.get(9).toString()));
|
||||
}
|
||||
@ -276,9 +288,9 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
|
||||
if (StringUtils.hasText(row.get(11).toString())) {
|
||||
field.setInstallDate(sf.parse(row.get(11).toString()));
|
||||
}
|
||||
field.setRemarks(row.get(12).toString());
|
||||
field.setBelongLine(row.get(17).toString());
|
||||
field.setStandard(Integer.valueOf(row.get(18).toString()));
|
||||
field.setRemarks(ObjectUtil.isEmpty(row.get(12)) ? null : row.get(12).toString());
|
||||
field.setBelongLine(ObjectUtil.isEmpty(row.get(17)) ? null : row.get(17).toString());
|
||||
field.setStandard(ObjectUtil.isEmpty(row.get(18)) ? null : Integer.valueOf(row.get(18).toString()));
|
||||
if (StringUtils.hasText(row.get(19).toString())) {
|
||||
field.setNominalCapacity(Double.valueOf(row.get(19).toString()));
|
||||
}
|
||||
|
@ -45,7 +45,7 @@
|
||||
where sims.iot_model_id = #{id} order by sims.porder asc
|
||||
</select>
|
||||
|
||||
<select id="queryIotModelIdByName" resultType="java.lang.Long">
|
||||
<select id="queryIotModelIdByCode" resultType="java.lang.Long">
|
||||
select id from sys_iot_model where iot_model_code = #{code}
|
||||
</select>
|
||||
|
||||
|
@ -422,10 +422,6 @@ const createScroll = () => {
|
||||
if (scrollRef.value.clientWidth + scrollRef.value.scrollLeft == scrollRef.value.scrollWidth) {
|
||||
scrollRef.value.scrollLeft = 0
|
||||
}
|
||||
//scrollRef.value.scrollTop += 1
|
||||
/* if (scrollRef.value.clientHeight + scrollRef.value.scrollTop == scrollRef.value.scrollHeight) {
|
||||
scrollRef.value.scrollTop = 0
|
||||
}*/
|
||||
}, 30);
|
||||
}
|
||||
|
||||
@ -520,7 +516,7 @@ $labelHeight: 30px;
|
||||
}
|
||||
.content-number {
|
||||
color: #333333;
|
||||
font-size: 28px;
|
||||
font-size: 24px;
|
||||
}
|
||||
.homelabel {
|
||||
font-family: PingFangSC-Semibold;
|
||||
|
@ -118,15 +118,26 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生产厂家:">
|
||||
<el-input disabled v-model="editDeviceData.madeinFactory" placeholder="请选择规格型号" clearable />
|
||||
<el-input
|
||||
:disabled="hasShowSelect"
|
||||
v-model="editDeviceData.madeinFactory"
|
||||
:placeholder="hasShowSelect ? '请选择规格型号' : '请输入生产厂家'"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="规格型号:">
|
||||
<!-- <el-input v-model="editDeviceData.model" style="width: 200px" placeholder="请输入规格型号" clearable /> -->
|
||||
<el-select v-model="editDeviceData.model" placeholder="请选择规格型号" style="width: 200px" @change="selectEditModel">
|
||||
<el-select
|
||||
v-if="hasShowSelect"
|
||||
v-model="editDeviceData.model"
|
||||
placeholder="请选择规格型号"
|
||||
style="width: 200px"
|
||||
@change="selectEditModel"
|
||||
>
|
||||
<el-option v-for="item in modelList" :key="item.model" :value="item.model"></el-option>
|
||||
</el-select>
|
||||
<el-input v-else v-model="editDeviceData.model" style="width: 200px" placeholder="请输入规格型号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -287,14 +298,26 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生产厂家:">
|
||||
<el-input disabled v-model="editAddDeviceData.madeinFactory" placeholder="请选择规格型号" clearable />
|
||||
<el-input
|
||||
:disabled="hasShowSelect"
|
||||
v-model="editAddDeviceData.madeinFactory"
|
||||
:placeholder="hasShowSelect ? '请选择规格型号' : '请输入生产厂家'"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="规格型号:">
|
||||
<el-select v-model="editAddDeviceData.model" placeholder="请选择规格型号" style="width: 200px" @change="selectAddModel">
|
||||
<el-select
|
||||
v-if="hasShowSelect"
|
||||
v-model="editAddDeviceData.model"
|
||||
placeholder="请选择规格型号"
|
||||
style="width: 200px"
|
||||
@change="selectAddModel"
|
||||
>
|
||||
<el-option v-for="item in modelList" :key="item.model" :value="item.model"></el-option>
|
||||
</el-select>
|
||||
<el-input v-else v-model="editAddDeviceData.model" placeholder="请输入规格型号" style="width: 200px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -471,7 +494,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, nextTick, watch } from 'vue'
|
||||
import { ref, reactive, computed, onMounted, nextTick, watch } from 'vue'
|
||||
import { Search, CirclePlusFilled, Upload, Download } from '@element-plus/icons-vue'
|
||||
import {
|
||||
equipTree,
|
||||
@ -734,12 +757,15 @@ const editDeviceData = reactive({
|
||||
nominalCapacity: null,
|
||||
})
|
||||
|
||||
const hasShowSelect = computed(() => {
|
||||
return queryParameter.value.equipmentTypeId === 10002
|
||||
})
|
||||
const modelList = ref<{ model: string; madeinFactory: string }[]>([])
|
||||
|
||||
const getModelList = () => {
|
||||
theoreticalpowerCurveList().then((res) => {
|
||||
if (res.rows) {
|
||||
console.log(res);
|
||||
console.log(res)
|
||||
|
||||
modelList.value = (res.rows as any[]).map((item: any) => {
|
||||
return {
|
||||
|
@ -323,8 +323,6 @@ const pageSetting = reactive({
|
||||
const changePageSetting = () => {}
|
||||
|
||||
const getListForAirBlower = () => {
|
||||
console.log(activeName.value)
|
||||
|
||||
const data = {
|
||||
deviceCode: curTreeData.value.code,
|
||||
startTime: dayjs(searchData.date[0]).format('YYYY-MM'),
|
||||
|
Loading…
Reference in New Issue
Block a user