明树Git Lab

Commit 752999d5 authored by zengfanpei's avatar zengfanpei

update

parent 804b2e0c
......@@ -69,6 +69,7 @@ async function importExcel(req, res, next) {
let obj = {
creator: req.user._id,
time: values[1],
time2: new Date(values[1]),
agrProName: values[2],
empDetails: values[3],
peopleNum: Number(values[4]) || null,
......@@ -80,7 +81,7 @@ async function importExcel(req, res, next) {
}
}
if(arr.length) {
// await DB.AgrInputEmploy.insertMany(arr);
await DB.AgrInputEmploy.insertMany(arr);
}
res.sendData(arr);
} catch (error) {
......
......@@ -95,6 +95,7 @@ async function getDevice(req, res, next) {
async function crateDevice(req, res, next) {
try {
let body = req.body;
console.log(req.body)
let ret = await DB.Device.create(body);
res.sendData(ret);
} catch (error) {
......
......@@ -15,7 +15,7 @@ const deviceSchema = new Schema({
name: {
type: String,
required: true,
set: setNameToDevice,
// set: setNameToDevice,
comment: "设备名称"
},
deviceNumber: {
......@@ -132,10 +132,11 @@ const deviceSchema = new Schema({
});
function setNameToDevice(v) {
deviceModule.setNameToDevice(this._update.deviceNumber, v);
return v;
}
// function setNameToDevice(v) {
// deviceModule.setNameToDevice(this.deviceNumber || this._update.deviceNumber, v);
// console.log(v, "----------------------")
// return v;
// }
const Device = mongoose.model('collectDevice', deviceSchema, 'collectDevice');
module.exports = Device;
\ No newline at end of file
......@@ -48,9 +48,7 @@ async function getDeviceOnlineMap () {
}
async function setNameToDevice(deviceNumber, deviceName) {
if(!deviceNumber || !deviceName) {
return;
}
console.log(deviceName, deviceNumber, "=============")
const url = sysConfig.device.upDeviceInfo;
const secretKey = sysConfig.device.secretKey;
const result = await httpRequest({
......
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