@ -22,6 +22,8 @@ const energyMetricService = require('./services/ems/energyMetricService');
const shiftTeamService = require ( './services/ems/shiftTeamService' ) ;
const electricityPriceService = require ( './services/ems/electricityPriceService' ) ;
const electricityBillService = require ( './services/ems/electricityBillService' ) ;
const measuringDeviceService = require ( './services/ems/measuringDeviceService' ) ;
const measurementControlPointService = require ( './services/ems/measurementControlPointService' ) ;
const floorInfoService = require ( './services/floorInfoService' ) ;
const { authenticate } = require ( './middleware/auth' ) ;
const { parseRequestBody } = require ( './cryptoBody' ) ;
@ -936,6 +938,36 @@ app.put('/ems/energyMetric', authenticate, parseRequestBody, routeOk(async (req)
// 接口: DELETE /ems/energyMetric/:ids; 入参: path(ids, 逗号分隔);出参: R.ok(null)。
app . delete ( '/ems/energyMetric/:ids' , authenticate , routeOk ( async ( req ) => { await energyMetricService . remove ( req . params . ids ) ; return null ; } ) ) ;
// 接口: GET /ems/measuringDevice/list; 入参: query(pageNum,pageSize,deviceName,deviceCode,deviceId,deviceType,installPosition);出参: TableDataInfo(计量器具台账)。
app . get ( '/ems/measuringDevice/list' , authenticate , routeRaw ( ( req ) => measuringDeviceService . list ( req . query ) ) ) ;
// 接口: GET /ems/measuringDevice/:id; 入参: path(id);出参: R.ok(计量器具详情)。
app . get ( '/ems/measuringDevice/:id' , authenticate , routeOk ( ( req ) => measuringDeviceService . get ( req . params . id ) ) ) ;
// 接口: POST /ems/measuringDevice; 入参: body(设备id、名称、编号、安装位置、设备类型、计量参数、原始单位、标准单位、倍率等);出参: R.ok({ id })。
app . post ( '/ems/measuringDevice' , authenticate , parseRequestBody , routeOk ( async ( req ) => ( { id : await measuringDeviceService . add ( req . body ) } ) ) ) ;
// 接口: PUT /ems/measuringDevice; 入参: body(id 必填及计量器具字段);出参: R.ok(null)。
app . put ( '/ems/measuringDevice' , authenticate , parseRequestBody , routeOk ( async ( req ) => { await measuringDeviceService . update ( req . body ) ; return null ; } ) ) ;
// 接口: DELETE /ems/measuringDevice/:ids; 入参: path(ids, 逗号分隔);出参: R.ok(null)。
app . delete ( '/ems/measuringDevice/:ids' , authenticate , routeOk ( async ( req ) => { await measuringDeviceService . remove ( req . params . ids ) ; return null ; } ) ) ;
// 接口: GET /ems/measurementControlPoint/list; 入参: query(pageNum,pageSize,pointCode,pointName,measuringDeviceId,parameterName);出参: TableDataInfo(测控点信息)。
app . get ( '/ems/measurementControlPoint/list' , authenticate , routeRaw ( ( req ) => measurementControlPointService . list ( req . query ) ) ) ;
// 接口: GET /ems/measurementControlPoint/:id; 入参: path(id);出参: R.ok(测控点详情)。
app . get ( '/ems/measurementControlPoint/:id' , authenticate , routeOk ( ( req ) => measurementControlPointService . get ( req . params . id ) ) ) ;
// 接口: POST /ems/measurementControlPoint; 入参: body(pointCode,pointName,measuringDeviceId,parameterName,standardUnit,conversionFactor,originalUnit,collectionCycle,dataType,registerAddress,status);出参: R.ok({ id })。
app . post ( '/ems/measurementControlPoint' , authenticate , parseRequestBody , routeOk ( async ( req ) => ( { id : await measurementControlPointService . add ( req . body ) } ) ) ) ;
// 接口: PUT /ems/measurementControlPoint; 入参: body(id 必填及测控点字段);出参: R.ok(null)。
app . put ( '/ems/measurementControlPoint' , authenticate , parseRequestBody , routeOk ( async ( req ) => { await measurementControlPointService . update ( req . body ) ; return null ; } ) ) ;
// 接口: DELETE /ems/measurementControlPoint/:ids; 入参: path(ids, 逗号分隔);出参: R.ok(null)。
app . delete ( '/ems/measurementControlPoint/:ids' , authenticate , routeOk ( async ( req ) => { await measurementControlPointService . remove ( req . params . ids ) ; return null ; } ) ) ;
// 接口: GET /ems/shiftTeam/list; 入参: query(pageNum,pageSize,name);出参: TableDataInfo(班组信息)。
app . get ( '/ems/shiftTeam/list' , authenticate , routeRaw ( ( req ) => shiftTeamService . list ( req . query ) ) ) ;