Commit 49b7fefa authored by hc_gogogo's avatar hc_gogogo

修改田间档案管理搜索接口bug

parent fd789e5b
......@@ -141,6 +141,15 @@ static async querySourceById(id: number): Promise<any> {
static async importSource(data: any): Promise<any> {
console.log("data", data);
console.log("data.length:" + data.length);
for (let i = 1; i < data.length; i++) {
const date = moment(data[i][5], "YYYY-MM-DD");
let errDate : string = data[i][5]? moment(date).utcOffset(8).format("YYYY-MM-DD"):null;
if(errDate === "Invalid date"){
next(new ErrorResponse("存在错误日期,请检查", 400));
}
}
let a: number = 0;
for (let i = 1; i < data.length; i++) {
console.log("length:" + data[i].length);
......
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