|
@ -2,7 +2,7 @@ |
|
|
const { QueryTypes } = require('sequelize'); |
|
|
const { QueryTypes } = require('sequelize'); |
|
|
const moment = require('moment'); |
|
|
const moment = require('moment'); |
|
|
|
|
|
|
|
|
async function reportList(ctx) { |
|
|
async function reportList (ctx) { |
|
|
try { |
|
|
try { |
|
|
const models = ctx.fs.dc.models; |
|
|
const models = ctx.fs.dc.models; |
|
|
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType, handleState = '', performerId = '', codeRoad } = ctx.query |
|
|
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType, handleState = '', performerId = '', codeRoad } = ctx.query |
|
@ -114,7 +114,7 @@ async function reportList(ctx) { |
|
|
} |
|
|
} |
|
|
) AS NR |
|
|
) AS NR |
|
|
left join "user" on "user".id = NR.user_id |
|
|
left join "user" on "user".id = NR.user_id |
|
|
WHERE NEWINDEX = 1; |
|
|
WHERE NEWINDEX = 1 order by id desc; |
|
|
` |
|
|
` |
|
|
reportRes = await sequelize.query(sqlStr, { type: QueryTypes.SELECT }); |
|
|
reportRes = await sequelize.query(sqlStr, { type: QueryTypes.SELECT }); |
|
|
if (reportType == 'road') { |
|
|
if (reportType == 'road') { |
|
@ -146,7 +146,7 @@ async function reportList(ctx) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function reportPosition(ctx) { |
|
|
async function reportPosition (ctx) { |
|
|
try { |
|
|
try { |
|
|
const models = ctx.fs.dc.models; |
|
|
const models = ctx.fs.dc.models; |
|
|
const { startTime, endTime, userId, reportType } = ctx.query |
|
|
const { startTime, endTime, userId, reportType } = ctx.query |
|
@ -196,7 +196,7 @@ async function reportPosition(ctx) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function reportDetail(ctx) { |
|
|
async function reportDetail (ctx) { |
|
|
try { |
|
|
try { |
|
|
const models = ctx.fs.dc.models; |
|
|
const models = ctx.fs.dc.models; |
|
|
const { reportId } = ctx.params |
|
|
const { reportId } = ctx.params |
|
@ -218,7 +218,7 @@ async function reportDetail(ctx) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function reportHandle(ctx) { |
|
|
async function reportHandle (ctx) { |
|
|
try { |
|
|
try { |
|
|
const { models } = ctx.fs.dc; |
|
|
const { models } = ctx.fs.dc; |
|
|
|
|
|
|
|
@ -248,7 +248,7 @@ async function reportHandle(ctx) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function createReport(ctx) { |
|
|
async function createReport (ctx) { |
|
|
try { |
|
|
try { |
|
|
const { userId } = ctx.fs.api |
|
|
const { userId } = ctx.fs.api |
|
|
const models = ctx.fs.dc.models; |
|
|
const models = ctx.fs.dc.models; |
|
@ -270,7 +270,7 @@ async function createReport(ctx) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function deleteReport(ctx) { |
|
|
async function deleteReport (ctx) { |
|
|
try { |
|
|
try { |
|
|
const models = ctx.fs.dc.models; |
|
|
const models = ctx.fs.dc.models; |
|
|
const { reportId } = ctx.params; |
|
|
const { reportId } = ctx.params; |
|
@ -293,7 +293,7 @@ async function deleteReport(ctx) { |
|
|
|
|
|
|
|
|
// TODO 小程序填写道路名称的时候的道路筛选 是一起都返回 还是不断传关键字搜索返回
|
|
|
// TODO 小程序填写道路名称的时候的道路筛选 是一起都返回 还是不断传关键字搜索返回
|
|
|
|
|
|
|
|
|
async function spotPrepare(ctx) { |
|
|
async function spotPrepare (ctx) { |
|
|
try { |
|
|
try { |
|
|
const { models } = ctx.fs.dc; |
|
|
const { models } = ctx.fs.dc; |
|
|
const sequelize = ctx.fs.dc.orm; |
|
|
const sequelize = ctx.fs.dc.orm; |
|
@ -365,7 +365,7 @@ async function spotPrepare(ctx) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function spotCheck(ctx) { |
|
|
async function spotCheck (ctx) { |
|
|
const transaction = await ctx.fs.dc.orm.transaction(); |
|
|
const transaction = await ctx.fs.dc.orm.transaction(); |
|
|
try { |
|
|
try { |
|
|
const { models } = ctx.fs.dc; |
|
|
const { models } = ctx.fs.dc; |
|
@ -442,7 +442,7 @@ async function spotCheck(ctx) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
async function spotCheckDetail(ctx) { |
|
|
async function spotCheckDetail (ctx) { |
|
|
const { models } = ctx.fs.dc |
|
|
const { models } = ctx.fs.dc |
|
|
console.log('txc1', ctx.query) |
|
|
console.log('txc1', ctx.query) |
|
|
const { startTime, endTime } = ctx.query |
|
|
const { startTime, endTime } = ctx.query |
|
|