Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #3392

Merged
merged 2 commits into from
Jan 21, 2025
Merged

Dev #3392

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.laokou.iot.productModel.convertor;

import org.laokou.iot.productModel.gatewayimpl.database.dataobject.ProductModelDO;
import org.laokou.iot.productModel.dto.clientobject.ProductModelCO;
import org.laokou.iot.productModel.model.ProductModelE;

/**
Expand All @@ -42,18 +41,4 @@ public static ProductModelDO toDataObject(ProductModelE productModelE, boolean i
return productModelDO;
}

public static ProductModelCO toClientObject(ProductModelDO productModelDO) {
ProductModelCO productModelCO = new ProductModelCO();
productModelCO.setProductId(productModelDO.getProductId());
productModelCO.setModelId(productModelDO.getModelId());
return productModelCO;
}

public static ProductModelE toEntity(ProductModelCO productModelCO) {
ProductModelE productModelE = new ProductModelE();
productModelE.setProductId(productModelCO.getProductId());
productModelE.setModelId(productModelCO.getModelId());
return productModelE;
}

}
22 changes: 7 additions & 15 deletions ui/src/pages/Sys/Log/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {exportV3, pageV3} from "@/services/admin/loginLog";
import {Button} from "antd";
import {ExportOutlined} from "@ant-design/icons";
import {trim} from "@/utils/format";
import {Excel, ExportToExcel} from "@/utils/export";
import {ExportToExcel} from "@/utils/export";
import moment from "moment";
import {useRef} from "react";
import {getLoginStatus, getLoginType, LOGIN_STATUS, LOGIN_TYPE} from "@/services/constant";
Expand All @@ -31,12 +31,6 @@ export default () => {
let param: any

const getPageQuery = (params: any) => {
let startTime = params?.startDate;
let endTime = params?.endDate;
if (startTime && endTime) {
startTime += ' 00:00:00'
endTime += ' 23:59:59'
}
param = {
pageSize: params?.pageSize,
pageNum: params?.current,
Expand All @@ -50,37 +44,35 @@ export default () => {
type: params?.type,
errorMessage: trim(params?.errorMessage),
params: {
startTime: startTime,
endTime: endTime
startTime: params?.startDate ? `${params.startDate} 00:00:00` : undefined,
endTime: params?.endDate ? `${params.endDate} 23:59:59` : undefined
}
};
return param;
}

const exportToExcel = async () => {
let _param: Excel
const _list: TableColumns[] = [];
// 格式化数据
list.forEach(item => {
item.status = getLoginStatus(item.status as '0').text
item.type = getLoginType(item.type as '0')?.text
_list.push(item)
})
_param = {
ExportToExcel({
sheetData: _list,
sheetFilter: ["username", "ip", "address", "browser", "os", "status", "errorMessage", "type", "createTime"],
sheetHeader: ["用户名", "IP地址", "归属地", "浏览器", "操作系统", "登录状态", "错误信息", "登录类型", "登录时间"],
fileName: "登录日志" + "_" + moment(new Date()).format('YYYYMMDDHHmmss'),
sheetName: "登录日志"
}
ExportToExcel(_param)
})
}

const exportAllToExcel = async () => {
exportV3(param)
}

const list_ = async (params: any) => {
const _list = async (params: any) => {
list = []
return pageV3(getPageQuery(params)).then(res => {
res?.data?.records?.forEach((item: TableColumns) => {
Expand Down Expand Up @@ -185,7 +177,7 @@ export default () => {
columns={columns}
request={(params) => {
// 表单搜索项会从 params 传入,传递给后端接口。
return list_(params)
return _list(params)
}}
rowKey="id"
pagination={{
Expand Down
18 changes: 5 additions & 13 deletions ui/src/pages/Sys/Log/notice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {exportV3, pageV3, getByIdV3} from "@/services/admin/noticeLog";
import {Button} from "antd";
import {ExportOutlined} from "@ant-design/icons";
import {trim} from "@/utils/format";
import {Excel, ExportToExcel} from "@/utils/export";
import {ExportToExcel} from "@/utils/export";
import moment from "moment";
import {useRef, useState} from "react";
import {getStatus, STATUS} from "@/services/constant";
Expand Down Expand Up @@ -36,12 +36,6 @@ export default () => {
let param: any

const getPageQuery = (params: any) => {
let startTime = params?.startDate;
let endTime = params?.endDate;
if (startTime && endTime) {
startTime += ' 00:00:00'
endTime += ' 23:59:59'
}
param = {
pageSize: params?.pageSize,
pageNum: params?.current,
Expand All @@ -51,29 +45,27 @@ export default () => {
status: params?.status,
errorMessage: trim(params?.errorMessage),
params: {
startTime: startTime,
endTime: endTime
startTime: params?.startDate ? `${params.startDate} 00:00:00` : undefined,
endTime: params?.endDate ? `${params.endDate} 23:59:59` : undefined
}
};
return param;
}

const exportToExcel = async () => {
let _param: Excel
const _list: TableColumns[] = [];
// 格式化数据
list.forEach(item => {
item.status = getStatus(item.status as '0')?.text
_list.push(item)
})
_param = {
ExportToExcel({
sheetData: _list,
sheetFilter: ["code", "name", "status", "param", "errorMessage", "createTime"],
sheetHeader: ["标识", "名称", "状态", "参数", "错误信息", "创建时间"],
fileName: "通知日志" + "_" + moment(new Date()).format('YYYYMMDDHHmmss'),
sheetName: "通知日志"
}
ExportToExcel(_param)
})
}

const exportAllToExcel = async () => {
Expand Down
Loading