Compare commits
211 Commits
master
...
release_0.
Author | SHA1 | Date |
---|---|---|
巴林闲侠 | f729866d7d | 2 years ago |
巴林闲侠 | ba5437ade4 | 2 years ago |
dengyinhuan | f90c8e5392 | 2 years ago |
巴林闲侠 | 70afe5d247 | 2 years ago |
巴林闲侠 | 69fee194bb | 2 years ago |
巴林闲侠 | 90477c1f1a | 2 years ago |
巴林闲侠 | 0850f0a98d | 2 years ago |
巴林闲侠 | 018fb2d9e3 | 2 years ago |
巴林闲侠 | 3c82af3e2f | 2 years ago |
巴林闲侠 | 4d77935026 | 2 years ago |
dengyinhuan | e999050c8c | 2 years ago |
dengyinhuan | 264cd7e5db | 2 years ago |
dengyinhuan | 5ac83b0d0a | 2 years ago |
dengyinhuan | c0449de927 | 2 years ago |
巴林闲侠 | 001cb7a1e1 | 2 years ago |
巴林闲侠 | 4ae2855083 | 2 years ago |
dengyinhuan | 7618549e83 | 2 years ago |
dengyinhuan | fd5ef2748c | 2 years ago |
dengyinhuan | 91ad17e31e | 2 years ago |
巴林闲侠 | f37f48f04b | 2 years ago |
巴林闲侠 | 904152a32e | 2 years ago |
liujiangyong | 59c0a30bba | 2 years ago |
xingyongchun | 02851689ec | 2 years ago |
xingyongchun | 23bbec827e | 2 years ago |
xingyongchun | 70033810a3 | 2 years ago |
巴林闲侠 | bb27f44219 | 2 years ago |
巴林闲侠 | 6a85786b54 | 2 years ago |
巴林闲侠 | a1005d2373 | 2 years ago |
巴林闲侠 | c26790b3b9 | 2 years ago |
巴林闲侠 | 75cb284cd3 | 2 years ago |
巴林闲侠 | 6b3c6afa1a | 2 years ago |
巴林闲侠 | 18ea603b30 | 2 years ago |
巴林闲侠 | 1fae6bf6ce | 2 years ago |
巴林闲侠 | 60fb682510 | 2 years ago |
巴林闲侠 | 179a0ca7e6 | 2 years ago |
巴林闲侠 | d449d67423 | 2 years ago |
巴林闲侠 | 649b011f22 | 2 years ago |
巴林闲侠 | a53fa70a6d | 2 years ago |
dengyinhuan | d8bf8ab801 | 2 years ago |
dengyinhuan | 1551718468 | 2 years ago |
巴林闲侠 | 20ab98f31d | 2 years ago |
巴林闲侠 | 1190a615cb | 2 years ago |
‘lijianhao’ | e3eb74d73c | 2 years ago |
wanyiwei | ad37fad373 | 2 years ago |
巴林闲侠 | 51fe54c72f | 2 years ago |
巴林闲侠 | 77b4ade296 | 2 years ago |
巴林闲侠 | 42e87e1b95 | 2 years ago |
‘lijianhao’ | 6d693dd12d | 2 years ago |
wanyiwei | 364e67f32b | 2 years ago |
wanyiwei | 700edca359 | 2 years ago |
‘lijianhao’ | 3188d2dd39 | 2 years ago |
dengyinhuan | afd4ee8a4f | 2 years ago |
wanyiwei | 11e4540997 | 2 years ago |
‘lijianhao’ | c3768a25b9 | 2 years ago |
‘lijianhao’ | 451fa80126 | 2 years ago |
dengyinhuan | a9b245052b | 2 years ago |
dengyinhuan | 2630bab231 | 2 years ago |
liujiangyong | def4e9985c | 2 years ago |
‘lijianhao’ | 1a291b0800 | 2 years ago |
dengyinhuan | c46cbe892e | 2 years ago |
dengyinhuan | 2dbb091e37 | 2 years ago |
dengyinhuan | 5e478ea587 | 2 years ago |
‘lijianhao’ | 100edfa85f | 2 years ago |
‘lijianhao’ | 9851ae4cd8 | 2 years ago |
巴林闲侠 | 85ab237dfb | 2 years ago |
巴林闲侠 | 6e90c13e2e | 2 years ago |
巴林闲侠 | e879a4cadf | 2 years ago |
‘lijianhao’ | 5cffe7c57f | 2 years ago |
巴林闲侠 | 4de26fc797 | 2 years ago |
巴林闲侠 | 4a1ae17597 | 2 years ago |
巴林闲侠 | da0f515841 | 2 years ago |
dengyinhuan | 057380bd61 | 2 years ago |
dengyinhuan | 7c38745c2d | 2 years ago |
wangyue | e7a01d52f7 | 2 years ago |
wangyue | c7e7cd4c98 | 2 years ago |
巴林闲侠 | 73e9698216 | 2 years ago |
dengyinhuan | 76a0b8d55b | 2 years ago |
巴林闲侠 | 89b758d497 | 2 years ago |
巴林闲侠 | d2ebfcfeca | 2 years ago |
dengyinhuan | 075b1e6849 | 2 years ago |
dengyinhuan | e0f91077a5 | 2 years ago |
liujiangyong | 2ed26ba452 | 2 years ago |
liujiangyong | 14083c32ec | 2 years ago |
wanyiwei | bbd7080ba3 | 2 years ago |
wanyiwei | ce1b8102d0 | 2 years ago |
‘lijianhao’ | b1e5447b6d | 2 years ago |
wanyiwei | 946ff7a620 | 2 years ago |
liujiangyong | 0d0d1e3095 | 2 years ago |
wanyiwei | d64cbccd15 | 2 years ago |
wanyiwei | df698a5e17 | 2 years ago |
liujiangyong | cebfb09b6c | 2 years ago |
dengyinhuan | 5b623fd52f | 2 years ago |
‘lijianhao’ | db9cf77c0e | 2 years ago |
巴林闲侠 | e76786587f | 2 years ago |
巴林闲侠 | 34906462b0 | 2 years ago |
LUCAS | ae42a7fa65 | 2 years ago |
dengyinhuan | 6f15fb0fc9 | 2 years ago |
LUCAS | dc9d216c36 | 2 years ago |
‘lijianhao’ | b124c2b2c1 | 2 years ago |
dengyinhuan | 5e726d932c | 2 years ago |
dengyinhuan | 1389350d3d | 2 years ago |
dengyinhuan | 0639073eac | 2 years ago |
巴林闲侠 | 8633d60810 | 2 years ago |
巴林闲侠 | 85b96adc6c | 2 years ago |
巴林闲侠 | 7f975b2f78 | 2 years ago |
巴林闲侠 | 3d3bee962f | 2 years ago |
liujiangyong | 8164437d5f | 2 years ago |
liujiangyong | 4134c92daf | 2 years ago |
dengyinhuan | 3a2d616526 | 2 years ago |
wangyue | fc3f2a929f | 2 years ago |
wangyue | f166aa2919 | 2 years ago |
‘lijianhao’ | 65cf2722ee | 2 years ago |
dengyinhuan | c6530c051c | 2 years ago |
dengyinhuan | 812dd001e9 | 2 years ago |
liujiangyong | fcea9240bb | 2 years ago |
xingyongchun | b636525ff0 | 2 years ago |
巴林闲侠 | 67efe14df2 | 2 years ago |
巴林闲侠 | 648e74178a | 2 years ago |
wanyiwei | 0bf01f4913 | 2 years ago |
dengyinhuan | d35c171831 | 2 years ago |
‘lijianhao’ | 06c5b51278 | 2 years ago |
巴林闲侠 | 311ec1143d | 2 years ago |
巴林闲侠 | dbc9dd6c75 | 2 years ago |
dengyinhuan | a1fdbb4fc1 | 2 years ago |
dengyinhuan | 6a4bc00527 | 2 years ago |
‘lijianhao’ | 6bbffa1134 | 2 years ago |
dengyinhuan | 64baffaaf3 | 2 years ago |
dengyinhuan | 846c768d3b | 2 years ago |
dengyinhuan | 1cc0523ca4 | 2 years ago |
wanyiwei | 0203bb8270 | 2 years ago |
dengyinhuan | a09777a83c | 2 years ago |
dengyinhuan | a148aa486b | 2 years ago |
‘lijianhao’ | d8bdf18989 | 2 years ago |
巴林闲侠 | b538c96b01 | 2 years ago |
巴林闲侠 | 778d0a2a1c | 2 years ago |
‘lijianhao’ | 5311604bd4 | 2 years ago |
dengyinhuan | 73e9cc21f3 | 2 years ago |
dengyinhuan | 41d9b2dd5e | 2 years ago |
巴林闲侠 | ffb1e5ddb9 | 2 years ago |
巴林闲侠 | 0f023177f7 | 2 years ago |
‘lijianhao’ | d7b6926a80 | 2 years ago |
巴林闲侠 | 778a84086c | 2 years ago |
巴林闲侠 | cba621fd9e | 2 years ago |
‘lijianhao’ | 98b09376d1 | 2 years ago |
巴林闲侠 | 7e6105a9dc | 2 years ago |
巴林闲侠 | fd2faa9401 | 2 years ago |
wanyiwei | 9c1d0acbff | 2 years ago |
wanyiwei | 0642533e97 | 2 years ago |
巴林闲侠 | 853a9272cd | 2 years ago |
巴林闲侠 | 1c677c5529 | 2 years ago |
liujiangyong | ddc30afca6 | 2 years ago |
dengyinhuan | 38d1f13b65 | 2 years ago |
dengyinhuan | 55aac653c7 | 2 years ago |
dengyinhuan | c913b97f05 | 2 years ago |
dengyinhuan | 237247375a | 2 years ago |
dengyinhuan | edea4c103b | 2 years ago |
巴林闲侠 | fe837dbf2c | 2 years ago |
巴林闲侠 | b219b25af4 | 2 years ago |
dengyinhuan | 8a7dcaa866 | 2 years ago |
dengyinhuan | 308ece7306 | 2 years ago |
dengyinhuan | 2a630e54ed | 2 years ago |
dengyinhuan | c080f5026f | 2 years ago |
xingyongchun | ba5e7ee72c | 2 years ago |
dengyinhuan | 7c61a4bc6d | 2 years ago |
dengyinhuan | f7289aaf0c | 2 years ago |
巴林闲侠 | 6babf2ffd8 | 2 years ago |
巴林闲侠 | 575c6f0ce6 | 2 years ago |
‘lijianhao’ | 272132bc43 | 2 years ago |
巴林闲侠 | 3dafc5de6a | 2 years ago |
xingyongchun | e992725320 | 2 years ago |
xingyongchun | 4f400d288a | 2 years ago |
xingyongchun | de61402e69 | 2 years ago |
巴林闲侠 | 0136103753 | 2 years ago |
巴林闲侠 | 3f55d3cd8a | 2 years ago |
巴林闲侠 | 9fdac56907 | 2 years ago |
巴林闲侠 | dad36736a7 | 2 years ago |
巴林闲侠 | 76057da15f | 2 years ago |
wangyue | e6030bcfa4 | 2 years ago |
wangyue | b299cd97c3 | 2 years ago |
wangyue | 69e7f3b613 | 2 years ago |
dengyinhuan | 509843c4dc | 2 years ago |
xingyongchun | a7e98af03a | 2 years ago |
dengyinhuan | 512b6c7d89 | 2 years ago |
wangyue | a74afb8f1d | 2 years ago |
wangyue | 68c13e99e7 | 2 years ago |
wangyue | dacf49b409 | 2 years ago |
xingyongchun | 59b24824de | 2 years ago |
巴林闲侠 | 96f29018fb | 2 years ago |
巴林闲侠 | f9e3c5b980 | 2 years ago |
巴林闲侠 | 2cef06a15c | 2 years ago |
wangyue | 1190cc0d21 | 2 years ago |
wangyue | 0c57a22797 | 2 years ago |
“liujiangyong” | 7ab11bd50c | 2 years ago |
“liujiangyong” | 787cfe34d8 | 2 years ago |
xingyongchun | 93e4203260 | 2 years ago |
wangyue | 8ab4f5f2e5 | 2 years ago |
wangyue | 50714cbf29 | 2 years ago |
xingyongchun | aa25bb3062 | 2 years ago |
xingyongchun | 092f1a8e0d | 2 years ago |
dengyinhuan | 88fb527346 | 2 years ago |
wangyue | 34413ac0b9 | 2 years ago |
wangyue | eee5aedfc5 | 2 years ago |
巴林闲侠 | c64a6bff75 | 2 years ago |
巴林闲侠 | 73b9260457 | 2 years ago |
巴林闲侠 | 430cff484e | 2 years ago |
巴林闲侠 | 9a0536d920 | 2 years ago |
巴林闲侠 | 53b580750e | 2 years ago |
巴林闲侠 | 6f4dcd76d0 | 2 years ago |
kong.bin | 599145cdff | 2 years ago |
kong.bin | 3c1c06ece2 | 2 years ago |
巴林闲侠 | c8e53475cf | 2 years ago |
@ -0,0 +1,144 @@ |
|||
# ---> Go |
|||
# Binaries for programs and plugins |
|||
*.exe |
|||
*.exe~ |
|||
*.dll |
|||
*.so |
|||
*.dylib |
|||
|
|||
# Test binary, built with `go test -c` |
|||
*.test |
|||
|
|||
# Output of the go coverage tool, specifically when used with LiteIDE |
|||
*.out |
|||
|
|||
# Dependency directories (remove the comment below to include it) |
|||
# vendor/ |
|||
|
|||
# ---> Node |
|||
# Logs |
|||
logs |
|||
*.log |
|||
npm-debug.log* |
|||
yarn-debug.log* |
|||
yarn-error.log* |
|||
lerna-debug.log* |
|||
.pnpm-debug.log* |
|||
|
|||
# Diagnostic reports (https://nodejs.org/api/report.html) |
|||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json |
|||
|
|||
# Runtime data |
|||
pids |
|||
*.pid |
|||
*.seed |
|||
*.pid.lock |
|||
|
|||
# Directory for instrumented libs generated by jscoverage/JSCover |
|||
lib-cov |
|||
|
|||
# Coverage directory used by tools like istanbul |
|||
coverage |
|||
*.lcov |
|||
|
|||
# nyc test coverage |
|||
.nyc_output |
|||
|
|||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) |
|||
.grunt |
|||
|
|||
# Bower dependency directory (https://bower.io/) |
|||
bower_components |
|||
|
|||
# node-waf configuration |
|||
.lock-wscript |
|||
|
|||
# Compiled binary addons (https://nodejs.org/api/addons.html) |
|||
build/Release |
|||
|
|||
# Dependency directories |
|||
node_modules |
|||
jspm_packages/ |
|||
|
|||
# Snowpack dependency directory (https://snowpack.dev/) |
|||
web_modules/ |
|||
|
|||
# TypeScript cache |
|||
*.tsbuildinfo |
|||
|
|||
# Optional npm cache directory |
|||
.npm |
|||
|
|||
# Optional eslint cache |
|||
.eslintcache |
|||
|
|||
# Microbundle cache |
|||
.rpt2_cache/ |
|||
.rts2_cache_cjs/ |
|||
.rts2_cache_es/ |
|||
.rts2_cache_umd/ |
|||
|
|||
# Optional REPL history |
|||
.node_repl_history |
|||
|
|||
# Output of 'npm pack' |
|||
*.tgz |
|||
|
|||
# Yarn Integrity file |
|||
.yarn-integrity |
|||
|
|||
# dotenv environment variables file |
|||
.env |
|||
.env.test |
|||
.env.production |
|||
|
|||
# parcel-bundler cache (https://parceljs.org/) |
|||
.cache |
|||
.parcel-cache |
|||
|
|||
# Next.js build output |
|||
.next |
|||
out |
|||
|
|||
# Nuxt.js build / generate output |
|||
.nuxt |
|||
dist |
|||
|
|||
# Gatsby files |
|||
.cache/ |
|||
# Comment in the public line in if your project uses Gatsby and not Next.js |
|||
# https://nextjs.org/blog/next-9-1#public-directory-support |
|||
# public |
|||
|
|||
# vuepress build output |
|||
.vuepress/dist |
|||
|
|||
# Serverless directories |
|||
.serverless/ |
|||
|
|||
# FuseBox cache |
|||
.fusebox/ |
|||
|
|||
# DynamoDB Local files |
|||
.dynamodb/ |
|||
|
|||
# TernJS port file |
|||
.tern-port |
|||
|
|||
# Stores VSCode versions used for testing VSCode extensions |
|||
.vscode-test |
|||
|
|||
# yarn v2 |
|||
.yarn/cache |
|||
.yarn/unplugged |
|||
.yarn/build-state.yml |
|||
.yarn/install-state.gz |
|||
.pnp.* |
|||
|
|||
*yarn.lock |
|||
*package-lock.json |
|||
*log/ |
|||
*downloadFiles/ |
|||
web/client/assets/color.less |
|||
package-lock.json |
|||
development.text |
@ -1,71 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
/** |
|||
* 提交审批、驳回修改 |
|||
* body { |
|||
* action:1驳回修改 2审批通过 |
|||
* userRegionType:提交用户所属区域级别:3乡镇级,2区县级 |
|||
* userId:提交用户id |
|||
* rejectReasons:驳回意见 |
|||
* correctiveAction:采取措施。区县复核时提交内容 |
|||
* punishment:实施处罚,强制措施情况。区县复核时提交内容 |
|||
* } |
|||
*/ |
|||
const moment = require('moment'); |
|||
async function submitApproval (ctx) { |
|||
try { |
|||
const data = ctx.request.body; |
|||
const models = ctx.fs.dc.models; |
|||
let oldData = await models.UserPlaceSecurityRecord.findOne({ where: { id: data.id } }) |
|||
if (oldData == null) { |
|||
ctx.status = 400; |
|||
ctx.body = { name: `message`, message: `该条填报数据不存在` }; |
|||
} else { |
|||
if ((data.action == 1 || data.action == 2) && (data.userRegionType == 3 || data.userRegionType == 2)) { |
|||
let dataSave = {} |
|||
if (data.action == 1) {//驳回
|
|||
dataSave = { |
|||
rejectManId: data.userId, |
|||
rejectReasons: data.rejectReasons, |
|||
type: false,//是否重新发起true默认false可以重新发起
|
|||
rejectTime: moment() |
|||
} |
|||
if (data.userRegionType == 2) {//区县复核,14、15项可修改
|
|||
dataSave.correctiveAction = data.correctiveAction; |
|||
dataSave.punishment = data.punishment; |
|||
} |
|||
} else {//通过
|
|||
if (data.userRegionType == 3) { |
|||
dataSave = { |
|||
audit1ManId: data.userId, |
|||
audit1ManIdTime: moment().format() |
|||
} |
|||
} else { |
|||
dataSave = {//区县复核,14、15项可修改
|
|||
correctiveAction: data.correctiveAction, |
|||
punishment: data.punishment, |
|||
audit2ManId: data.userId, |
|||
audit2ManIdTime: moment().format() |
|||
} |
|||
} |
|||
} |
|||
await models.UserPlaceSecurityRecord.update(dataSave, { where: { id: data.id } }); |
|||
ctx.status = 200; |
|||
ctx.body = { name: `message`, message: `提交成功` }; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { name: `message`, message: `提交数据有误` }; |
|||
} |
|||
} |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": { name: `message`, message: `提交审批、驳回修改数据失败` } |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
submitApproval |
|||
}; |
@ -1,116 +0,0 @@ |
|||
|
|||
function deepCompare(x, y) { |
|||
var i, l, leftChain, rightChain; |
|||
|
|||
function compare2Objects(x, y) { |
|||
var p; |
|||
|
|||
// remember that NaN === NaN returns false
|
|||
// and isNaN(undefined) returns true
|
|||
if (isNaN(x) && isNaN(y) && typeof x === 'number' && typeof y === 'number') { |
|||
return true; |
|||
} |
|||
|
|||
// Compare primitives and functions.
|
|||
// Check if both arguments link to the same object.
|
|||
// Especially useful on the step where we compare prototypes
|
|||
if (x === y) { |
|||
return true; |
|||
} |
|||
|
|||
// Works in case when functions are created in constructor.
|
|||
// Comparing dates is a common scenario. Another built-ins?
|
|||
// We can even handle functions passed across iframes
|
|||
if ((typeof x === 'function' && typeof y === 'function') || |
|||
(x instanceof Date && y instanceof Date) || |
|||
(x instanceof RegExp && y instanceof RegExp) || |
|||
(x instanceof String && y instanceof String) || |
|||
(x instanceof Number && y instanceof Number)) { |
|||
return x.toString() === y.toString(); |
|||
} |
|||
|
|||
// At last checking prototypes as good as we can
|
|||
if (!(x instanceof Object && y instanceof Object)) { |
|||
return false; |
|||
} |
|||
|
|||
if (x.isPrototypeOf(y) || y.isPrototypeOf(x)) { |
|||
return false; |
|||
} |
|||
|
|||
if (x.constructor !== y.constructor) { |
|||
return false; |
|||
} |
|||
|
|||
if (x.prototype !== y.prototype) { |
|||
return false; |
|||
} |
|||
|
|||
// Check for infinitive linking loops
|
|||
if (leftChain.indexOf(x) > -1 || rightChain.indexOf(y) > -1) { |
|||
return false; |
|||
} |
|||
|
|||
// Quick checking of one object being a subset of another.
|
|||
// todo: cache the structure of arguments[0] for performance
|
|||
for (p in y) { |
|||
if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) { |
|||
return false; |
|||
} else if (typeof y[p] !== typeof x[p]) { |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
for (p in x) { |
|||
if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) { |
|||
return false; |
|||
} else if (typeof y[p] !== typeof x[p]) { |
|||
return false; |
|||
} |
|||
|
|||
switch (typeof (x[p])) { |
|||
case 'object': |
|||
case 'function': |
|||
|
|||
leftChain.push(x); |
|||
rightChain.push(y); |
|||
|
|||
if (!compare2Objects(x[p], y[p])) { |
|||
return false; |
|||
} |
|||
|
|||
leftChain.pop(); |
|||
rightChain.pop(); |
|||
break; |
|||
|
|||
default: |
|||
if (x[p] !== y[p]) { |
|||
return false; |
|||
} |
|||
break; |
|||
} |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
|
|||
if (arguments.length < 1) { |
|||
return true; //Die silently? Don't know how to handle such case, please help...
|
|||
// throw "Need two or more arguments to compare";
|
|||
} |
|||
|
|||
for (i = 1, l = arguments.length; i < l; i++) { |
|||
|
|||
leftChain = []; //Todo: this can be cached
|
|||
rightChain = []; |
|||
|
|||
if (!compare2Objects(arguments[0], arguments[i])) { |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
module.exports = { |
|||
deepCompare |
|||
} |
@ -1,63 +0,0 @@ |
|||
//获取固化数据接口
|
|||
async function getDataDictionary(ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { model } = ctx.params; |
|||
const { where, attributes, order } = ctx.query; |
|||
let findObj = {}; |
|||
if (where) { |
|||
let whereJson = JSON.parse(where); |
|||
findObj.where = whereJson; |
|||
} |
|||
if (order) { |
|||
findObj.order = [JSON.parse(order)]; |
|||
} |
|||
if (attributes) { |
|||
attributes = attributes.split(','); |
|||
} |
|||
let rslt = await models[model].findAll(findObj); |
|||
ctx.status = 200; |
|||
ctx.body = rslt; |
|||
} catch (error) { |
|||
console.log(error) |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取数据字典失败" |
|||
} |
|||
} |
|||
} |
|||
//基础修改接口
|
|||
async function putDataDictionary(ctx) { |
|||
const transaction = await ctx.fs.dc.orm.transaction(); |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
let errMsg = "修改失败"; |
|||
|
|||
const { model } = ctx.params; |
|||
const { where, dataToSave } = ctx.request.body; |
|||
|
|||
const oldData = await models[model].findOne({ where: where }); |
|||
if (oldData) { |
|||
await models[model].update(dataToSave, { where: where, transaction }); |
|||
} else { |
|||
errMsg = "未找到需要修改的数据"; |
|||
ctx.throw(400) |
|||
} |
|||
ctx.status = 204; |
|||
await transaction.commit(); |
|||
} catch (error) { |
|||
await transaction.rollback(); |
|||
console.log(error) |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": errMsg |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
getDataDictionary, |
|||
putDataDictionary |
|||
}; |
@ -0,0 +1,71 @@ |
|||
'use strict'; |
|||
|
|||
async function bridgeGet (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
|
|||
const roadRes = await models.Bridge.findAll({ |
|||
order: [['id', 'DESC']] |
|||
}) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = roadRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function bridgeEdit (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body; |
|||
|
|||
if (!data.bridgeId) { |
|||
await models.Bridge.create(data) |
|||
} else { |
|||
await models.Bridge.update( |
|||
data, { |
|||
where: { |
|||
id: data.bridgeId |
|||
} |
|||
}) |
|||
} |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function bridgeDel (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { bridgeId } = ctx.params; |
|||
|
|||
await models.Bridge.destroy({ |
|||
where: { |
|||
id: bridgeId |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
bridgeGet, bridgeEdit, bridgeDel, |
|||
}; |
@ -0,0 +1,155 @@ |
|||
'use strict'; |
|||
|
|||
async function lineGet (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { fleet } = ctx.query; |
|||
const findOption = { |
|||
order: [['id', 'DESC']], |
|||
where: { |
|||
|
|||
}, |
|||
} |
|||
if (fleet) { |
|||
findOption.where.fleet = { $like: `%${fleet}%` } |
|||
} |
|||
|
|||
const roadRes = await models.BusLine.findAll(findOption) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = roadRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function lineEdit (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body; |
|||
|
|||
if (!data.lineId) { |
|||
await models.BusLine.create(data) |
|||
} else { |
|||
await models.BusLine.update( |
|||
data, { |
|||
where: { |
|||
id: data.lineId |
|||
} |
|||
}) |
|||
} |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function lineDel (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { lineId } = ctx.params; |
|||
|
|||
await models.BusLine.destroy({ |
|||
where: { |
|||
id: lineId |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
async function carGet (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { fleet } = ctx.query; |
|||
const findOption = { |
|||
order: [['id', 'DESC']], |
|||
where: { |
|||
|
|||
}, |
|||
} |
|||
if (fleet) { |
|||
findOption.where.fleet = { $like: `%${fleet}%` } |
|||
} |
|||
|
|||
const roadRes = await models.BusCar.findAll(findOption) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = roadRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function carEdit (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body; |
|||
|
|||
if (!data.carId) { |
|||
await models.BusCar.create(data) |
|||
} else { |
|||
await models.BusCar.update( |
|||
data, { |
|||
where: { |
|||
id: data.carId |
|||
} |
|||
}) |
|||
} |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function carDel (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { carId } = ctx.params; |
|||
|
|||
await models.BusCar.destroy({ |
|||
where: { |
|||
id: carId |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
lineGet, lineEdit, lineDel, |
|||
carGet, carEdit, carDel, |
|||
}; |
@ -0,0 +1,109 @@ |
|||
'use strict'; |
|||
|
|||
async function overspeedGet (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { limit, page, nameOfInspectionPoint, licensePlate, numberOfAxles, overrunRateUpper, overrunRateFloor, testTime } = ctx.query |
|||
|
|||
let findOption = { |
|||
where: { |
|||
|
|||
}, |
|||
order: [['id', 'DESC']] |
|||
} |
|||
if (limit) { |
|||
findOption.limit = limit |
|||
} |
|||
if (page && limit) { |
|||
findOption.offset = page * limit |
|||
} |
|||
if (nameOfInspectionPoint) { |
|||
findOption.where.nameOfInspectionPoint = { |
|||
'$like': `%${nameOfInspectionPoint}%` |
|||
} |
|||
} |
|||
if (licensePlate) { |
|||
findOption.where.licensePlate = { |
|||
'$like': `%${licensePlate}%` |
|||
} |
|||
} |
|||
if (numberOfAxles) { |
|||
findOption.where.numberOfAxles = numberOfAxles |
|||
} |
|||
if (overrunRateUpper) { |
|||
findOption.where.overrunRate = { |
|||
$lte: overrunRateUpper |
|||
} |
|||
} |
|||
if (overrunRateFloor) { |
|||
findOption.where.overrunRate = { |
|||
$gte: overrunRateFloor |
|||
} |
|||
} |
|||
if (testTime) { |
|||
findOption.where.testTime = testTime |
|||
} |
|||
const overspeedRes = await models.Overspeed.findAll(findOption) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = overspeedRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function overspeedEdit (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body; |
|||
|
|||
if (!data.overspeedId) { |
|||
await models.Overspeed.create(data) |
|||
} else { |
|||
await models.Overspeed.update( |
|||
data, |
|||
{ |
|||
where: { |
|||
id: data.overspeedId |
|||
} |
|||
}) |
|||
} |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function overspeedDel (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { overspeedId } = ctx.params; |
|||
|
|||
await models.Overspeed.destroy({ |
|||
where: { |
|||
id: overspeedId |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
overspeedGet, overspeedEdit, overspeedDel, |
|||
}; |
@ -0,0 +1,75 @@ |
|||
'use strict'; |
|||
|
|||
async function projectGet (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { type } = ctx.query; |
|||
|
|||
const projectRes = await models.Project.findAll({ |
|||
where: { |
|||
type |
|||
}, |
|||
order: [['id', 'DESC']] |
|||
}) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = projectRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function projectEdit (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body; |
|||
|
|||
if (!data.projectId) { |
|||
await models.Project.create(data) |
|||
} else { |
|||
await models.Project.update( |
|||
data, { |
|||
where: { |
|||
id: data.projectId |
|||
} |
|||
}) |
|||
} |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function projectDel (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { projectId } = ctx.params; |
|||
|
|||
await models.Project.destroy({ |
|||
where: { |
|||
id: projectId |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
projectGet, projectEdit, projectDel, |
|||
}; |
@ -0,0 +1,77 @@ |
|||
'use strict'; |
|||
|
|||
async function publicityGet (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { enable } = ctx.query; |
|||
let findOption = { |
|||
where: {}, |
|||
order: [['id', 'DESC']] |
|||
} |
|||
if (enable) { |
|||
findOption.where.enable = true |
|||
} |
|||
|
|||
const roadRes = await models.Publicity.findAll(findOption) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = roadRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function publicityEdit (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body; |
|||
|
|||
if (!data.publicityId) { |
|||
await models.Publicity.create(data) |
|||
} else { |
|||
await models.Publicity.update( |
|||
data, { |
|||
where: { |
|||
id: data.publicityId |
|||
} |
|||
}) |
|||
} |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function publicityDel (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { publicityId } = ctx.params; |
|||
|
|||
await models.Publicity.destroy({ |
|||
where: { |
|||
id: publicityId |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
publicityGet, publicityEdit, publicityDel, |
|||
}; |
@ -0,0 +1,175 @@ |
|||
'use strict'; |
|||
const roadKeyMap = require('./road.json') |
|||
|
|||
async function importIn (ctx) { |
|||
// 数据导入
|
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { level, } = ctx.query; |
|||
const data = ctx.request.body; |
|||
|
|||
const roadRes = await models.Road.findAll({ |
|||
where: { |
|||
level |
|||
} |
|||
}) |
|||
let preCreateArr = [] |
|||
for (let d of data) { |
|||
if (roadRes.some(r => r.routeCode + r.sectionNo == d['路线代码'] + d['路段序号'])) { |
|||
//repeat
|
|||
} else { |
|||
// await models.Road.create(d);
|
|||
} |
|||
} |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function get (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { level, road, sectionStart, sectionEnd } = ctx.query; |
|||
|
|||
let findOption = { |
|||
where: {}, |
|||
order: [['id', 'DESC']] |
|||
} |
|||
|
|||
if (level) { |
|||
findOption.where.level = level |
|||
} |
|||
if (road || sectionStart || sectionEnd) { |
|||
findOption.where['$or'] = {} |
|||
if (road) { |
|||
findOption.where['$or'].push = { |
|||
routeName: { $like: `%${road}%` } |
|||
} |
|||
} |
|||
if (sectionStart) { |
|||
findOption.where['$or']. |
|||
startingPlaceName = { $like: `%${sectionStart}%` } |
|||
|
|||
} |
|||
if (sectionEnd) { |
|||
findOption.where['$or']. |
|||
stopPlaceName = { $like: `%${sectionEnd}%` } |
|||
|
|||
} |
|||
} |
|||
|
|||
const roadRes = await models.Road.findAll(findOption) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = roadRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function getRoadSection (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { level, road, sectionStart, sectionEnd } = ctx.query; |
|||
let findOption = { |
|||
where: {}, |
|||
order: [['id', 'DESC']], |
|||
attributes: ['id', 'routeName', 'startingPlaceName', 'stopPlaceName'] |
|||
} |
|||
|
|||
if (level) { |
|||
findOption.where.level = level |
|||
} |
|||
if (road || sectionStart || sectionEnd) { |
|||
findOption.where['$or'] = {} |
|||
if (road) { |
|||
findOption.where['$or'].push = { |
|||
routeName: { $like: `%${road}%` } |
|||
} |
|||
} |
|||
if (sectionStart) { |
|||
findOption.where['$or']. |
|||
startingPlaceName = { $like: `%${sectionStart}%` } |
|||
|
|||
} |
|||
if (sectionEnd) { |
|||
findOption.where['$or']. |
|||
stopPlaceName = { $like: `%${sectionEnd}%` } |
|||
} |
|||
} |
|||
|
|||
const roadRes = await models.Road.findAll(findOption) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = roadRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function edit (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body; |
|||
|
|||
if (!data.roadId) { |
|||
await models.Road.create(data) |
|||
} else { |
|||
await models.Road.update( |
|||
data, { |
|||
where: { |
|||
id: data.roadId |
|||
} |
|||
}) |
|||
} |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function del (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { roadId } = ctx.params; |
|||
|
|||
await models.Road.destroy({ |
|||
where: { |
|||
id: roadId |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
importIn, |
|||
getRoadSection, |
|||
get, edit, del, |
|||
}; |
@ -0,0 +1,50 @@ |
|||
{ |
|||
"路线名称": "routeName", |
|||
"路线代码": "routeCode", |
|||
"路段序号": "sectionNo", |
|||
"乡镇编码": "townshipCode", |
|||
"起点地名": "startingPlaceName", |
|||
"起点桩号": "startStation", |
|||
"起点分界点类别": "categoryOfStartingPointAndDividingPoint", |
|||
"止点地名": "stopPlaceName", |
|||
"止点分界点类别": "categoryOfDeadCenterAndDividingPoint", |
|||
"止点桩号": "stopStation", |
|||
"路段类型": "sectionType", |
|||
"路段性质": "natureOfRoadSection", |
|||
"建成时间": "completionTime", |
|||
"GBM及文明样板路": "gBMAndCivilizedModelRoad", |
|||
"地貌": "landforms", |
|||
"收费性质": "natureOfCharges", |
|||
"涵洞数量": "numberOfCulverts", |
|||
"技术等级": "technicalLevel", |
|||
"路面类型": "pavementType", |
|||
"路面宽度": "pavementWidth", |
|||
"路基宽度": "subgradeWidth", |
|||
"车道特征": "laneCharacteristics", |
|||
"是否晴雨通车": "whetherItIsOpenToTrafficInSunnyOrRainyDays", |
|||
"设计时速": "designSpeedPerHour", |
|||
"是否城管路段": "urbanManagementSectionOrNot", |
|||
"管养单位": "managementAndMaintenanceUnit", |
|||
"路政管理单位": "roadAdministrationUnit", |
|||
"列养情况": "alimentation", |
|||
"列养资金来源": "sourceOfListedMaintenanceFunds", |
|||
"养护时间": "curingTime", |
|||
"可绿化里程": "greeningMileage", |
|||
"已绿化里程": "greeningMileaged", |
|||
"重复道路路段类型": "typeOfRepeatedRoadSection", |
|||
"重复路段序号": "serialNumberOfRepeatedSection", |
|||
"重复路段路线编码": "repeatedSectionRouteCode", |
|||
"填报单位": "reportingUnit", |
|||
"变更原因": "reasonForChange", |
|||
"变更时间": "changeTime", |
|||
"是否按干线公路管理接养": "whetherMaintenanceManagedHighway", |
|||
"备注": "remarks", |
|||
"上年路线编码": "routeCodeOfLastYear", |
|||
"上年路线名称": "routeNameOfLastYear", |
|||
"上年起点桩号": "startingStationOfLastYear", |
|||
"上年止点桩号": "lastYearsEndingPointStakeNumber", |
|||
"图形里程": "graphicMileage", |
|||
"桩号里程": "chainageMileage", |
|||
"所在区县": "districtcounty", |
|||
"所在地市": "locationCity" |
|||
} |
@ -0,0 +1,210 @@ |
|||
'use strict'; |
|||
|
|||
async function get (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { type } = ctx.request.body; |
|||
|
|||
const vehicleRes = await models.Statistic.findAll({ |
|||
where: { |
|||
type |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = vehicleRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function edit (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { id, name, count, type } = ctx.request.body; |
|||
|
|||
if (!id) { |
|||
await models.Statistic.create({ |
|||
name, count, type: type |
|||
}) |
|||
} else { |
|||
await models.Statistic.update({ |
|||
name, count, type: type |
|||
}, { |
|||
where: { |
|||
id: id |
|||
} |
|||
}) |
|||
} |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function del (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { id } = ctx.params; |
|||
|
|||
await models.Statistic.destroy({ |
|||
where: { |
|||
id: id |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function specificGet (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { type } = ctx.query; |
|||
|
|||
const vehicleRes = await models.MunicipalVehicle.findAll({ |
|||
where: { |
|||
type |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = vehicleRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function specificEdit (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body; |
|||
|
|||
if (!data.vehicleId) { |
|||
const vehicleRes = await models.Vehicle.create(data) |
|||
} else { |
|||
const vehicleRes = await models.Vehicle.update(data, { |
|||
where: { |
|||
id: data.vehicleId |
|||
} |
|||
}) |
|||
} |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function specificDel (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { vehicleId } = ctx.params; |
|||
|
|||
const vehicleRes = await models.Vehicle.destroy({ |
|||
where: { |
|||
id: vehicleId |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function businessGet (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
|
|||
const businessRes = await models.MunicipalBusiness.findAll() |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = businessRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function businessEdit (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body; |
|||
|
|||
if (!data.businessId) { |
|||
await models.MunicipalBusiness.create(data) |
|||
} else { |
|||
await models.MunicipalBusiness.update(data, { |
|||
where: { |
|||
id: data.businessId |
|||
} |
|||
}) |
|||
} |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function businessDel (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { businessId } = ctx.params; |
|||
|
|||
await models.Vehicle.MunicipalBusiness({ |
|||
where: { |
|||
id: businessId |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
get, edit, del, |
|||
specificGet, specificEdit, specificDel, |
|||
businessGet, businessEdit, businessDel |
|||
}; |
@ -1,25 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
//获取南昌市下所有区县
|
|||
async function getCountiesList(ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
let rslt = await models.Department.findAll({ |
|||
where: { type: 2 }, |
|||
order: [['id', 'asc']], |
|||
}); |
|||
ctx.status = 200; |
|||
ctx.body = rslt; |
|||
} catch (error) { |
|||
console.log(error) |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取南昌市下所有区县失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
getCountiesList, |
|||
}; |
@ -1,87 +0,0 @@ |
|||
async function getResource(ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
|
|||
const res = await models.Resource.findAll({ |
|||
where: { parentResource: null }, |
|||
include: [{ |
|||
model: models.Resource, |
|||
}] |
|||
}) |
|||
|
|||
ctx.body = res; |
|||
ctx.status = 200; |
|||
|
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "查询所有权限数据失败" |
|||
} |
|||
} |
|||
} |
|||
async function getUserResource(ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { userId } = ctx.query; |
|||
|
|||
const res = await models.UserResource.findAll({ |
|||
where: { userId: userId }, |
|||
include: [{ |
|||
model: models.Resource, |
|||
}] |
|||
}) |
|||
|
|||
ctx.body = res; |
|||
ctx.status = 200; |
|||
|
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "查询用户权限数据失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function updateUserRes(ctx, next) { |
|||
const transaction = await ctx.fs.dc.orm.transaction(); |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { userId, resCode } = ctx.request.body; |
|||
|
|||
const res = await models.UserResource.findAll({ |
|||
attributes: ["resourceId"], |
|||
raw: true, |
|||
where: { userId: userId } |
|||
}) |
|||
|
|||
const addRes = resCode.filter(r => !res.some(rr => rr.resourceId == r)).map(r => { return { userId: userId, resourceId: r } }); |
|||
const delRes = res.filter(r => !resCode.includes(r.resourceId)).map(r => r.resourceId); |
|||
addRes.length && await models.UserResource.bulkCreate(addRes, { transaction: transaction }); |
|||
delRes.length && await models.UserResource.destroy({ |
|||
where: { |
|||
resourceId: { $in: delRes }, |
|||
userId: userId |
|||
}, |
|||
transaction: transaction |
|||
}) |
|||
|
|||
ctx.status = 204; |
|||
await transaction.commit(); |
|||
|
|||
} catch (error) { |
|||
await transaction.rollback(); |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "更新用户权限数据失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
getResource, |
|||
getUserResource, |
|||
updateUserRes |
|||
}; |
@ -0,0 +1,167 @@ |
|||
'use strict'; |
|||
|
|||
async function getdep (ctx) { |
|||
try { |
|||
const { fs: { api: { userInfo } } } = ctx |
|||
const models = ctx.fs.dc.models; |
|||
|
|||
let depLevel0 = await models.Department.findAll({ |
|||
order: [['id', 'asc']], |
|||
where: { |
|||
// id: userInfo.departmentId
|
|||
dependence: null, |
|||
delete: false |
|||
}, |
|||
}) |
|||
|
|||
let depRslt = [] |
|||
const getDep = async (d) => { |
|||
let subordinate = [] |
|||
let depRes = await models.Department.findAll({ |
|||
order: [['id', 'asc']], |
|||
where: { |
|||
dependence: d.id, |
|||
delete: false |
|||
}, |
|||
}) |
|||
if (depRes.length) |
|||
for (let d of depRes) { |
|||
let dep = d.dataValues |
|||
dep.subordinate = await getDep(d.dataValues) |
|||
subordinate.push(dep) |
|||
} |
|||
return subordinate |
|||
} |
|||
for (let d of depLevel0) { |
|||
let dep0 = d.dataValues |
|||
dep0.subordinate = await getDep(d.dataValues) |
|||
depRslt.push(dep0) |
|||
} |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = depRslt |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = {} |
|||
} |
|||
} |
|||
|
|||
async function editDep (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { depId, name, dependence } = ctx.request.body; |
|||
if (dependence) { |
|||
let dep = await models.Department.findOne({ |
|||
where: { |
|||
id: dependence, |
|||
delete: false |
|||
}, |
|||
}) |
|||
if (!dep) { |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "上级部门不存在" |
|||
} |
|||
return |
|||
} |
|||
} |
|||
if (depId) { |
|||
await models.Department.update({ |
|||
name: name, |
|||
dependence: dependence || null, |
|||
}, { |
|||
where: { |
|||
id: depId |
|||
} |
|||
}) |
|||
} else { |
|||
await models.Department.create({ |
|||
name: name, |
|||
delete: false, |
|||
dependence: dependence || null, |
|||
}) |
|||
} |
|||
ctx.status = 204; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = {} |
|||
} |
|||
} |
|||
|
|||
async function delDep (ctx) { |
|||
const transaction = await ctx.fs.dc.orm.transaction(); |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { depId } = ctx.params; |
|||
|
|||
let depIds = [] |
|||
let depLevel0 = await models.Department.findAll({ |
|||
where: { |
|||
id: depId |
|||
}, |
|||
}) |
|||
|
|||
const getDep = async (d) => { |
|||
let depRes = await models.Department.findAll({ |
|||
where: { |
|||
dependence: d.id, |
|||
delete: false |
|||
}, |
|||
}) |
|||
if (depRes.length) |
|||
for (let d of depRes) { |
|||
depIds.push(d.dataValues.id) |
|||
await getDep(d.dataValues) |
|||
} |
|||
} |
|||
for (let d of depLevel0) { |
|||
depIds.push(d.id) |
|||
getDep(d.dataValues) |
|||
} |
|||
|
|||
const undeleteUserCount = await models.User.count({ |
|||
where: { |
|||
departmentId: { |
|||
$in: depIds |
|||
}, |
|||
delete: false |
|||
} |
|||
}) |
|||
if (undeleteUserCount) { |
|||
throw '该部门下有用户,不能删除' |
|||
} |
|||
|
|||
await models.Department.update({ |
|||
delete: true, |
|||
}, { |
|||
where: { |
|||
id: { $in: depIds }, |
|||
}, |
|||
transaction |
|||
}) |
|||
await models.User.update({ |
|||
delete: true, |
|||
}, { |
|||
where: { |
|||
departmentId: { $in: depIds }, |
|||
}, |
|||
transaction |
|||
}) |
|||
|
|||
await transaction.commit(); |
|||
ctx.status = 204; |
|||
} catch (error) { |
|||
await transaction.rollback(); |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
getdep, editDep, delDep, |
|||
}; |
@ -0,0 +1,202 @@ |
|||
'use strict'; |
|||
|
|||
const moment = require("moment"); |
|||
|
|||
const areaCode = { |
|||
"360121100000": "莲塘镇", |
|||
"360121101000": "向塘镇", |
|||
"360121102000": "三江镇", |
|||
"360121103000": "塘南镇", |
|||
"360121104000": "幽兰镇", |
|||
"360121105000": "蒋巷镇", |
|||
"360121106000": "武阳镇", |
|||
"360121107000": "冈上镇", |
|||
"360121108000": "广福镇", |
|||
"360121191000": "昌东镇", |
|||
"360121192000": "麻丘镇", |
|||
"360121200000": "泾口乡", |
|||
"360121201000": "南新乡", |
|||
"360121202000": "塔城乡", |
|||
"360121203000": "黄马乡", |
|||
"360121204000": "富山乡", |
|||
"360121205000": "东新乡", |
|||
"360121206000": "八一乡", |
|||
"360121403000": "小蓝经济开发区", |
|||
"360121471000": "银三角管理委员会", |
|||
"360121501000": "五星垦殖场", |
|||
"360121572000": "良种繁殖场", |
|||
} |
|||
|
|||
async function roadState (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { userId } = ctx.fs.api; |
|||
|
|||
const roadRes = await models.Road.findAll({}) |
|||
const projectRoadRes = await models.Project.findAll({ |
|||
type: 'road', |
|||
}) |
|||
|
|||
const bridgeCount = await models.Bridge.count({}) |
|||
|
|||
let constructionYear = [] |
|||
for (let i = 0; constructionYear.length < 4; i++) { |
|||
constructionYear.push(moment().subtract(i, 'year').format('YYYY')) |
|||
} |
|||
constructionYear.reverse() |
|||
|
|||
const roadState = { |
|||
// 在建数量
|
|||
buildingRoad: 0, |
|||
// 已建数量
|
|||
buildedRoad: 0, |
|||
// 桥梁数量
|
|||
bridgeCount: bridgeCount, |
|||
// 涵洞数量
|
|||
culvertCount: 0, |
|||
// 施工统计
|
|||
construction: constructionYear.map(year => { |
|||
return { |
|||
year, |
|||
count: 0, |
|||
} |
|||
}), |
|||
// 乡镇统计
|
|||
townRoad: { |
|||
|
|||
}, |
|||
// 类型统计
|
|||
roadType: { |
|||
'县': 0, |
|||
'乡': 0, |
|||
'村': 0, |
|||
}, |
|||
// 在建项目统计
|
|||
townProject: { |
|||
|
|||
}, |
|||
// 等级统计
|
|||
roadLevel: { |
|||
|
|||
}, |
|||
// 养护周期
|
|||
curingPeriod: { |
|||
frequent: 0, |
|||
season: 0, |
|||
}, |
|||
// 绿化里程
|
|||
greenMileage: { |
|||
'县': { |
|||
canBeGreen: 0, |
|||
isGreen: 0, |
|||
}, |
|||
'乡': { |
|||
canBeGreen: 0, |
|||
isGreen: 0, |
|||
}, |
|||
'村': { |
|||
canBeGreen: 0, |
|||
isGreen: 0, |
|||
}, |
|||
} |
|||
} |
|||
|
|||
let roadCode = new Set() |
|||
|
|||
for (let r of roadRes) { |
|||
roadCode.add(r.routeCode) |
|||
|
|||
roadState.culvertCount += Number(r.numberOfCulverts) || 0; |
|||
|
|||
// 建成年份
|
|||
let buildYear = r.completionTime ? moment(r.completionTime).format('YYYY') : null |
|||
// 改建年份
|
|||
let rebuildYear = r.reconstructionTime ? moment(r.reconstructionTime).format('YYYY') : null |
|||
let corBuildConstruction = roadState.construction.find(item => item.year === buildYear) |
|||
if (corBuildConstruction) { |
|||
corBuildConstruction.count += Number(r.chainageMileage) || 0 |
|||
} |
|||
let corReBuildConstruction = roadState.construction.find(item => item.year === rebuildYear) |
|||
if (corReBuildConstruction) { |
|||
corReBuildConstruction.count += Number(r.chainageMileage) || 0 |
|||
} |
|||
|
|||
let townName = areaCode[r.townshipCode] || '其他' |
|||
if (roadState.townRoad[townName]) { |
|||
roadState.townRoad[townName].roadCode.add(r.routeCode) |
|||
roadState.townRoad[townName].mileage += Number(r.chainageMileage) || 0 |
|||
} else { |
|||
roadState.townRoad[townName] = { |
|||
roadCode: new Set([r.routeCode]), |
|||
mileage: Number(r.chainageMileage) || 0, |
|||
} |
|||
} |
|||
|
|||
roadState.roadType[r.level] = (roadState.roadType[r.level] || 0) + (Number(r.chainageMileage) || 0) |
|||
|
|||
if (roadState.roadLevel[r.technicalLevel]) { |
|||
roadState.roadLevel[r.technicalLevel] += 1 |
|||
} else { |
|||
roadState.roadLevel[r.technicalLevel] = 1 |
|||
} |
|||
|
|||
if (r.curingTime) { |
|||
if (r.curingTime.indexOf('经常') > -1) { |
|||
roadState.curingPeriod.frequent += 1 |
|||
} else if (r.curingTime.indexOf('季节') > -1) { |
|||
roadState.curingPeriod.season += 1 |
|||
} |
|||
} |
|||
|
|||
if (r.level && roadState.greenMileage[r.level]) { |
|||
roadState.greenMileage[r.level].canBeGreen += (Number(r.greeningMileage) || 0) |
|||
roadState.greenMileage[r.level].isGreen += (Number(r.greeningMileaged) || 0) |
|||
} |
|||
} |
|||
|
|||
let corBuildConstruction2022 = roadState.construction.find(item => item.year == 2022) |
|||
|
|||
for (let p of projectRoadRes) { |
|||
if (p.type == 'road') { |
|||
|
|||
if (corBuildConstruction2022) { |
|||
corBuildConstruction2022.count += Number(p.projectMileage) || 0 |
|||
} |
|||
|
|||
if (p.done) { |
|||
roadState.buildedRoad += 1 |
|||
} else { |
|||
roadState.buildingRoad += 1 |
|||
} |
|||
} |
|||
|
|||
if (p.buildUnit) { |
|||
let townName = p.buildUnit.replace('人民政府', '').replace('南昌县', '').replace('管委会', '') |
|||
if (roadState.townProject[townName]) { |
|||
roadState.townProject[townName] += 1 |
|||
} else { |
|||
roadState.townProject[townName] = 1 |
|||
} |
|||
} |
|||
} |
|||
|
|||
roadState.buildedRoad += roadCode.size |
|||
for (let t of Object.keys(roadState.townRoad)) { |
|||
roadState.townRoad[t].roadCount = roadState.townRoad[t].roadCode.size |
|||
delete roadState.townRoad[t].roadCode |
|||
} |
|||
|
|||
ctx.status = 200 |
|||
ctx.body = roadState |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
roadState, |
|||
}; |
@ -0,0 +1,50 @@ |
|||
'use strict'; |
|||
|
|||
async function statistic (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { userId } = ctx.fs.api; |
|||
const { projectType } = ctx.query; |
|||
|
|||
let findOption = { |
|||
where: { |
|||
reportType: 'conserve', |
|||
}, |
|||
attributes: ['id', 'road', 'time', 'projectType', 'projectType'], |
|||
include: [{ |
|||
model: models.User, |
|||
attributes: ['name'] |
|||
}], |
|||
} |
|||
|
|||
if (projectType) { |
|||
findOption.where.projectType = projectType; |
|||
} |
|||
|
|||
const reportRes = await await models.Report.findAll(findOption) |
|||
const reportCount = await models.Report.count({ |
|||
attributes: ['projectType'], |
|||
group: ['projectType'], |
|||
where: { |
|||
reportType: 'conserve', |
|||
}, |
|||
}) |
|||
|
|||
ctx.status = 200 |
|||
ctx.body = { |
|||
processed: reportRes.length, |
|||
reportCount: reportCount, |
|||
reportList: reportRes, |
|||
} |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
statistic, |
|||
}; |
@ -0,0 +1,2 @@ |
|||
'use strict'; |
|||
|
@ -0,0 +1,76 @@ |
|||
'use strict'; |
|||
|
|||
async function overSpeedList (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { userId } = ctx.fs.api; |
|||
const { limit } = ctx.query; |
|||
|
|||
const overSpeedRes = await models.Overspeed.findAll({ |
|||
attributes: ['id', 'licensePlate', 'overrunRate', 'deductPoints', 'fine', 'processingTime'], |
|||
order: [['testTime', 'DESC']], |
|||
limit: limit || 120, |
|||
}) |
|||
|
|||
const overSpeedProcessedCount = await models.Overspeed.count({ |
|||
where: { |
|||
processingTime: { $ne: null } |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 200 |
|||
ctx.body = { |
|||
processed: overSpeedProcessedCount, |
|||
overSpeedList: overSpeedRes, |
|||
} |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function overSpeedProcessed (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { userId } = ctx.fs.api; |
|||
|
|||
const overSpeedCountRes = await models.Overspeed.count({ |
|||
attributes: ['nameOfInspectionPoint'], |
|||
group: ['nameOfInspectionPoint'], |
|||
}) |
|||
const overSpeedCountProcessedRes = await models.Overspeed.count({ |
|||
attributes: ['nameOfInspectionPoint'], |
|||
where: { processingTime: { $ne: null } }, |
|||
group: ['nameOfInspectionPoint'], |
|||
}) |
|||
|
|||
let data = [] |
|||
for (let c of overSpeedCountRes) { |
|||
const corProcessed = overSpeedCountProcessedRes.find(d => d.nameOfInspectionPoint == c.nameOfInspectionPoint) |
|||
if (corProcessed) { |
|||
data.push({ |
|||
name: c.nameOfInspectionPoint, |
|||
processed: corProcessed.count, |
|||
total: c.count, |
|||
}) |
|||
} |
|||
} |
|||
|
|||
ctx.status = 200 |
|||
ctx.body = data |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
overSpeedList, |
|||
overSpeedProcessed |
|||
}; |
@ -0,0 +1,102 @@ |
|||
'use strict'; |
|||
|
|||
async function busCarLevelList (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { userId } = ctx.fs.api; |
|||
|
|||
let data = [] |
|||
const busCarRes = await models.BusCar.findAll({ |
|||
attributes: ['id', 'company', 'fleet', 'vehicleLicensePlateNumber'], |
|||
}) |
|||
for (let c of busCarRes) { |
|||
const { company, fleet } = c |
|||
const corCompany = data.find(d => d.name === company) |
|||
if (!corCompany) { |
|||
data.push({ |
|||
name: company, |
|||
child: [{ |
|||
name: fleet, |
|||
child: [{ ...c.dataValues }] |
|||
}] |
|||
}) |
|||
} else { |
|||
const corFleet = corCompany.child.find(d => d.name === fleet) |
|||
if (!corFleet) { |
|||
corCompany.child.push({ |
|||
name: fleet, |
|||
child: [{ ...c.dataValues }] |
|||
}) |
|||
} else { |
|||
corFleet.child.push({ ...c.dataValues }) |
|||
} |
|||
} |
|||
} |
|||
|
|||
ctx.status = 200 |
|||
ctx.body = data |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function vehicleStatistic (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { userId } = ctx.fs.api; |
|||
|
|||
const taxiBusiness = await models.MunicipalBusiness.findAll({ |
|||
where: { |
|||
type: '出租车' |
|||
}, |
|||
attributes: ['id', 'nameOfBusinessOwner'] |
|||
}) |
|||
const hazardousGoodsBusiness = await models.MunicipalBusiness.findAll({ |
|||
where: { |
|||
type: '危货' |
|||
}, |
|||
attributes: ['id', 'nameOfBusinessOwner'] |
|||
}) |
|||
const passengerTransport = await models.Statistic.findOne({ |
|||
where: { |
|||
type: 'vehicle' |
|||
} |
|||
}) |
|||
|
|||
const vehicleState = { |
|||
passengerTransport: passengerTransport ? passengerTransport.count : 0, |
|||
taxi: await models.MunicipalVehicle.count({ |
|||
where: { |
|||
type: '出租车' |
|||
}, |
|||
}), |
|||
hazardousGoods: await models.MunicipalVehicle.count({ |
|||
where: { |
|||
type: '危货' |
|||
} |
|||
}), |
|||
bus: await models.BusCar.count(), |
|||
taxiBusiness: taxiBusiness, |
|||
hazardousGoodsBusiness: hazardousGoodsBusiness, |
|||
} |
|||
|
|||
ctx.status = 200 |
|||
ctx.body = vehicleState |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
module.exports = { |
|||
busCarLevelList, |
|||
vehicleStatistic, |
|||
}; |
@ -1,612 +0,0 @@ |
|||
'use strict'; |
|||
const moment = require('moment'); |
|||
|
|||
/** |
|||
* 提交填报信息/保存填报草稿 |
|||
* @requires.body { |
|||
* isDraft-是否草稿 |
|||
* userId-用户id,填报人 |
|||
* placeName-场所id |
|||
* placeType-场所性质 |
|||
* regionId-所属县/区 |
|||
* address-场所地址 |
|||
* placeOwner-场所负责人 |
|||
* phone-负责人手机号 |
|||
* dimension-面积 |
|||
* floors-多少层 |
|||
* numberOfPeople-常住人数 |
|||
* location-经纬度 |
|||
* isEnable-是否为合用场所 |
|||
* localtionDescribe-经纬度定位描述 |
|||
* hiddenDangerItem12-12项隐患信息,格式:[{ |
|||
* itemIndex-隐患项序号, |
|||
* value-是否存在隐患, |
|||
* description-隐患具体信息描述, |
|||
* photos-隐患图片(多张图片以 , 隔开)" |
|||
* }], |
|||
* description-存在具体问题描述 |
|||
* correctiveAction-采取整改措施 |
|||
* punishment-实施处罚,强制措施情况 |
|||
* } ctx |
|||
*/ |
|||
async function addPlaceSecurityRecord (ctx, next) { |
|||
const transaction = await ctx.fs.dc.orm.transaction(); |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const body = ctx.request.body; |
|||
let ifRightRegion = true; |
|||
if (body.regionId) { |
|||
//判断填报信息所属乡镇/区县是否存在
|
|||
let region = await models.Department.findOne({ where: { id: body.regionId } }); |
|||
if (!region) { |
|||
ifRightRegion = false; |
|||
} |
|||
} |
|||
if (ifRightRegion) { |
|||
let placeId = null; |
|||
if (body.placeName) { |
|||
//判断“场所名称”是否存在,不存在则“新建场所”
|
|||
let place = await models.Places.findOne({ where: { name: body.placeName, userId: ctx.fs.api.userId } }); |
|||
if (place) { |
|||
placeId = place.id |
|||
} else { |
|||
const newPlace = await models.Places.create({ |
|||
name: body.placeName, |
|||
userId: ctx.fs.api.userId |
|||
}, { transaction: transaction }); |
|||
placeId = newPlace.id; |
|||
} |
|||
} |
|||
//创建填报信息/填报草稿
|
|||
const userPlaceSecurityRecord = await models.UserPlaceSecurityRecord.create({ |
|||
isDraft: body.isDraft,//是否草稿
|
|||
userId: ctx.fs.api.userId,//用户id,填报人
|
|||
time: moment(),//录入时间
|
|||
placeId: placeId,//场所id
|
|||
placeType: body.placeType,//场所性质
|
|||
regionId: body.regionId,//所属县/区
|
|||
address: body.address,//场所地址
|
|||
placeOwner: body.placeOwner,//场所负责人
|
|||
phone: body.phone,//负责人手机号
|
|||
dimension: body.dimension,//面积
|
|||
floors: body.floors,//多少层
|
|||
numberOfPeople: body.numberOfPeople,//常住人数
|
|||
location: body.location,//经纬度
|
|||
isEnable: body.isEnable,//是否为合用场所
|
|||
localtionDescribe: body.localtionDescribe,//经纬度定位描述
|
|||
hiddenDangerItem12: body.hiddenDangerItem12,//12项隐患信息
|
|||
description: body.description,//存在具体问题描述
|
|||
correctiveAction: body.correctiveAction,//采取措施
|
|||
type: true,//是否重新发起true默认false可以重新发起
|
|||
punishment: body.punishment,//实施处罚,强制措施情况
|
|||
departmentId: body.departmentId |
|||
}, { transaction: transaction }); |
|||
ctx.body = { |
|||
id: userPlaceSecurityRecord.id, |
|||
"message": "新增填报信息成功" |
|||
}; |
|||
ctx.status = 200; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "所选地址不存在!" |
|||
} |
|||
} |
|||
await transaction.commit(); |
|||
} catch (error) { |
|||
await transaction.rollback(); |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "新增填报信息失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 编辑填报信息 |
|||
* @param {id-填报信息ID} ctx |
|||
* @requires.body { |
|||
* isDraft-是否草稿 |
|||
* userId-用户id,填报人 |
|||
* placeName-场所id |
|||
* placeType-场所性质 |
|||
* regionId-所属县/区 |
|||
* address-场所地址 |
|||
* placeOwner-场所负责人 |
|||
* phone-负责人手机号 |
|||
* dimension-面积 |
|||
* floors-多少层 |
|||
* numberOfPeople-常住人数 |
|||
* location-经纬度 |
|||
* isEnable-是否为合用场所 |
|||
* localtionDescribe-经纬度定位描述 |
|||
* hiddenDangerItem12-12项隐患信息,格式:[{ |
|||
* itemIndex-隐患项序号, |
|||
* value-是否存在隐患, |
|||
* description-隐患具体信息描述, |
|||
* photos-隐患图片(多张图片以 , 隔开)" |
|||
* }], |
|||
* description-存在具体问题描述 |
|||
* correctiveAction-采取整改措施 |
|||
* punishment-实施处罚,强制措施情况 |
|||
* } ctx |
|||
*/ |
|||
async function editPlaceSecurityRecord (ctx, next) { |
|||
const transaction = await ctx.fs.dc.orm.transaction(); |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { id } = ctx.params; |
|||
//判断该填报信息是否存在
|
|||
let userPlaceSecurityRecord = await models.UserPlaceSecurityRecord.findOne({ where: { id: id } }); |
|||
if (userPlaceSecurityRecord) { |
|||
const body = ctx.request.body; |
|||
let ifRightRegion = true; |
|||
if (body.regionId) { |
|||
//判断填报信息所属乡镇/区县是否存在
|
|||
let region = await models.Department.findOne({ where: { id: body.regionId } }); |
|||
if (!region) { |
|||
ifRightRegion = false; |
|||
} |
|||
} |
|||
if (ifRightRegion) { |
|||
let placeId = null; |
|||
if (body.placeName) { |
|||
//判断“场所名称”是否存在,不存在则“新建场所”
|
|||
let place = await models.Places.findOne({ where: { name: body.placeName, userId: ctx.fs.api.userId } }); |
|||
if (place) { |
|||
placeId = place.id |
|||
} else { |
|||
const newPlace = await models.Places.create({ |
|||
name: body.placeName, |
|||
userId: ctx.fs.api.userId |
|||
}, { transaction: transaction }); |
|||
placeId = newPlace.id; |
|||
} |
|||
} |
|||
//修改填报信息
|
|||
await models.UserPlaceSecurityRecord.update({ |
|||
isDraft: body.isDraft,//是否草稿
|
|||
userId: ctx.fs.api.userId,//用户id,填报人
|
|||
time: moment(),//录入时间
|
|||
placeId: placeId,//场所id
|
|||
placeType: body.placeType,//场所性质
|
|||
regionId: body.regionId,//所属县/区
|
|||
address: body.address,//场所地址
|
|||
placeOwner: body.placeOwner,//场所负责人
|
|||
phone: body.phone,//负责人手机号
|
|||
dimension: body.dimension,//面积
|
|||
floors: body.floors,//多少层
|
|||
numberOfPeople: body.numberOfPeople,//常住人数
|
|||
location: body.location,//经纬度
|
|||
isEnable: body.isEnable,//是否为合用场所
|
|||
localtionDescribe: body.localtionDescribe,//经纬度定位描述
|
|||
hiddenDangerItem12: body.hiddenDangerItem12,//12项隐患信息
|
|||
description: body.description,//存在具体问题描述
|
|||
correctiveAction: body.correctiveAction,//采取措施
|
|||
punishment: body.punishment,//实施处罚,强制措施情况
|
|||
departmentId: body.departmentId |
|||
}, { where: { id: id, }, transaction: transaction }); |
|||
ctx.body = { "message": "修改填报信息成功" }; |
|||
ctx.status = 200; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "所选地址不存在!" } |
|||
} |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "该填报信息不存在!" } |
|||
} |
|||
await transaction.commit(); |
|||
} catch (error) { |
|||
await transaction.rollback(); |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "修改填报信息失败" } |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 修改type字段 |
|||
* @param {*} ctx |
|||
* @param {*} next |
|||
*/ |
|||
async function updateType (ctx, next) { |
|||
const models = ctx.fs.dc.models; |
|||
const { id } = ctx.params; |
|||
try { |
|||
await models.UserPlaceSecurityRecord.update({ |
|||
type: true,//是否重新发起true默认false可以重新发起
|
|||
}, { where: { id: id, } }) |
|||
ctx.body = { "message": "修改信息成功" }; |
|||
ctx.status = 200; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "修改信息失败" } |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 删除填报信息 |
|||
* @param {id-填报信息ID} ctx |
|||
*/ |
|||
async function deletePlaceSecurityRecord (ctx, next) { |
|||
const transaction = await ctx.fs.dc.orm.transaction(); |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { id } = ctx.params; |
|||
//判断该填报信息是否存在
|
|||
let userPlaceSecurityRecord = await models.UserPlaceSecurityRecord.findOne({ where: { id: id } }); |
|||
if (userPlaceSecurityRecord) { |
|||
await models.UserPlaceSecurityRecord.destroy({ where: { id: id }, transaction: transaction }); |
|||
ctx.body = { "message": "删除填报信息成功" }; |
|||
ctx.status = 200; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "该填报信息不存在!" } |
|||
} |
|||
await transaction.commit(); |
|||
} catch (error) { |
|||
await transaction.rollback(); |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "删除填报信息失败" } |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 根据填报信息ID查询填报信息 |
|||
* @param {id-填报信息ID} ctx |
|||
*/ |
|||
async function getPlaceSecurityRecordById (ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { id } = ctx.params; |
|||
//判断该填报信息是否存在
|
|||
let userPlaceSecurityRecord = await models.UserPlaceSecurityRecord.findOne({ where: { id: id } }); |
|||
if (userPlaceSecurityRecord) { |
|||
let userPlaceSecurityRecord = await models.UserPlaceSecurityRecord.findOne({ |
|||
where: { id: id }, |
|||
include: [{ |
|||
model: models.Places, |
|||
}, { |
|||
model: models.User, |
|||
as: 'user', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}, { |
|||
model: models.User, |
|||
as: 'audit1ManUser', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}, { |
|||
model: models.User, |
|||
as: 'audit2ManUser', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}, { |
|||
model: models.User, |
|||
as: 'rejectManUser', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}] |
|||
}); |
|||
ctx.body = userPlaceSecurityRecord; |
|||
ctx.status = 200; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "该填报信息不存在!" } |
|||
} |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "查询填报信息失败" } |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 根据场所ID获取该场所最近用户填报信息 |
|||
* @param {placeId-场所信息ID} ctx |
|||
*/ |
|||
async function getRecentlyPlaceSecurityRecordByPlaceId (ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { placeId } = ctx.params; |
|||
//判断该场所信息是否存在
|
|||
let place = await models.Places.findOne({ where: { id: placeId } }); |
|||
if (place) { |
|||
let userPlaceSecurityRecord = await models.UserPlaceSecurityRecord.findAll({ |
|||
where: { placeId: placeId, userId: place.userId }, |
|||
include: [{ |
|||
model: models.Places, |
|||
}], |
|||
limit: 1, |
|||
order: [["id", "desc"]], |
|||
}); |
|||
ctx.status = 200; |
|||
ctx.body = userPlaceSecurityRecord.length ? userPlaceSecurityRecord[0] : null; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "该场所不存在!" } |
|||
} |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "获取场所最近用户填报信息失败" } |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 根据筛选条件获取用户填报信息 |
|||
* @query { |
|||
* isDraft-是否草稿 |
|||
* userId-用户ID |
|||
* timeRange-录入时间范围 |
|||
* regionId-区域ID |
|||
* placeId-场所ID |
|||
* state-审批状态 |
|||
* pageIndex-页码 |
|||
* pageSize-页宽 |
|||
* } ctx |
|||
*/ |
|||
async function getPlaceSecurityRecords (ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { isDraft, userId, timeRange, regionId, placeId, state, pageIndex, pageSize } = ctx.query; |
|||
let whereCondition = {}; |
|||
if (userId) { |
|||
let user = await models.User.findOne({ where: { id: userId } }); |
|||
if (user) { |
|||
whereCondition.userId = userId; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "用户不存在!" } |
|||
return; |
|||
} |
|||
} |
|||
if (regionId) { |
|||
let region = await models.Department.findOne({ where: { id: regionId } }); |
|||
if (region) { |
|||
whereCondition.regionId = regionId; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "区域不存在!" } |
|||
return; |
|||
} |
|||
} |
|||
if (placeId) { |
|||
let place = await models.Places.findOne({ where: { id: placeId } }); |
|||
if (place) { |
|||
whereCondition.placeId = placeId; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "场所不存在!" }; |
|||
return; |
|||
} |
|||
} |
|||
if (isDraft) { whereCondition.isDraft = isDraft; } |
|||
let times = timeRange; |
|||
if (timeRange && timeRange.indexOf(',')) { times = timeRange.split(',') } |
|||
if (times && times.length > 0) { |
|||
const len = times.length; |
|||
whereCondition.time = { |
|||
$between: [ |
|||
moment(times[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|||
moment(times[len - 1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|||
] |
|||
}; |
|||
} |
|||
switch (Number(state)) { |
|||
case 1: //待审批:未审核 或者 已审核+未复核
|
|||
whereCondition.$or = [ |
|||
{ '$audit1ManId$': null }, |
|||
{ '$audit2ManId$': null } |
|||
]; |
|||
whereCondition.rejectManId = null; |
|||
break; |
|||
case 2://已审批:已审批+已复核
|
|||
whereCondition.audit1ManId = { $not: null }; |
|||
whereCondition.audit2ManId = { $not: null }; |
|||
break; |
|||
case 3: //驳回
|
|||
whereCondition.rejectManId = { $not: null }; |
|||
break; |
|||
default: break; |
|||
} |
|||
let findObj = { |
|||
where: whereCondition, |
|||
order: [["id", "desc"]], |
|||
include: [{ |
|||
model: models.Places, |
|||
}, { |
|||
model: models.User, |
|||
as: 'user', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}, { |
|||
model: models.User, |
|||
as: 'audit1ManUser', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}, { |
|||
model: models.User, |
|||
as: 'audit2ManUser', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}, { |
|||
model: models.User, |
|||
as: 'rejectManUser', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}] |
|||
}; |
|||
if (Number(pageSize) > 0 && Number(pageIndex) >= 0) { |
|||
findObj.limit = Number(pageSize); |
|||
findObj.offset = Number(pageIndex) * Number(pageSize); |
|||
} |
|||
let userPlaceSecurityRecords = await models.UserPlaceSecurityRecord.findAndCountAll(findObj); |
|||
ctx.status = 200; |
|||
ctx.body = userPlaceSecurityRecords; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "获取用户填报信息失败" } |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 根据筛选条件获取用户审批填报信息 |
|||
* @query { |
|||
* approveUserId-审批人ID |
|||
* timeRange-录入时间范围 |
|||
* regionId-区域ID |
|||
* placeId-场所ID |
|||
* state-审批状态 |
|||
* pageIndex-页码 |
|||
* pageSize-页宽 |
|||
* } ctx |
|||
*/ |
|||
async function getApprovePlaceSecurityRecords (ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { approveUserId, timeRange, regionId, placeId, state, pageIndex, pageSize } = ctx.query; |
|||
let whereCondition = { isDraft: false }; |
|||
if (approveUserId) { |
|||
let approveUser = await models.User.findOne({ where: { id: approveUserId } }); |
|||
if (approveUser) { |
|||
//获取审批人管辖区域内所有用户ID(注:市级人员查看所有用户数据)
|
|||
const departmentRes = await models.Department.findOne({ where: { id: approveUser.departmentId } }); |
|||
if (departmentRes.dependence) { |
|||
let attentionRegionIds = [departmentRes.id]; |
|||
let regionType = departmentRes.type; |
|||
while (attentionRegionIds.length && regionType && regionType < 4) { |
|||
const departmentChilds = await models.Department.findAll({ where: { dependence: { $in: attentionRegionIds } } }); |
|||
regionType = departmentChilds.length ? departmentChilds[0].type : null; |
|||
attentionRegionIds = departmentChilds.map(d => d.id); |
|||
} |
|||
let users = await models.User.findAll({ where: { departmentId: { $in: attentionRegionIds } }, attributes: ['id'] }); |
|||
if (users.length) { |
|||
let userIds = users.map(u => u.id); |
|||
whereCondition.userId = { $in: userIds }; |
|||
} else { |
|||
ctx.status = 200; |
|||
ctx.body = { |
|||
"count": 0, |
|||
"rows": [] |
|||
} |
|||
return; |
|||
} |
|||
} |
|||
if (regionId) { |
|||
let region = await models.Department.findOne({ where: { id: regionId } }); |
|||
if (region) { |
|||
whereCondition.regionId = regionId; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "区域不存在!" } |
|||
return; |
|||
} |
|||
} |
|||
if (placeId) { |
|||
let place = await models.Places.findOne({ where: { id: placeId } }); |
|||
if (place) { |
|||
whereCondition.placeId = placeId; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "场所不存在!" }; |
|||
return; |
|||
} |
|||
} |
|||
let times = timeRange; |
|||
if (timeRange && timeRange.indexOf(',')) { times = timeRange.split(',') } |
|||
if (times && times.length > 0) { |
|||
const len = times.length; |
|||
whereCondition.time = { |
|||
$between: [ |
|||
moment(times[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|||
moment(times[len - 1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|||
] |
|||
}; |
|||
} |
|||
switch (Number(state)) { |
|||
case 1: //待审批
|
|||
if (departmentRes.type == 2) { |
|||
//区县待审:已审核+未复核
|
|||
whereCondition.audit1ManId = { $not: null }; |
|||
whereCondition.audit2ManId = null; |
|||
} else { |
|||
//乡镇待审:未审核+未复核
|
|||
whereCondition.audit1ManId = null; |
|||
whereCondition.audit2ManId = null; |
|||
} |
|||
whereCondition.rejectManId = null; |
|||
break; |
|||
case 2://已审批:
|
|||
if (departmentRes.type == 3) { |
|||
//乡镇已审:已审核
|
|||
whereCondition.audit1ManId = { $not: null }; |
|||
} else { |
|||
//区域已审:已审批+已复核
|
|||
whereCondition.audit1ManId = { $not: null }; |
|||
whereCondition.audit2ManId = { $not: null }; |
|||
} |
|||
whereCondition.rejectManId = null; |
|||
break; |
|||
case 3: //驳回
|
|||
whereCondition.rejectManId = { $not: null }; |
|||
break; |
|||
default: |
|||
if (departmentRes.type == 2) { |
|||
//区县查看数据:去除未审核
|
|||
whereCondition.audit1ManId = { $not: null }; |
|||
} |
|||
break; |
|||
} |
|||
let findObj = { |
|||
where: whereCondition, |
|||
include: [{ |
|||
model: models.Places, |
|||
}, { |
|||
model: models.User, |
|||
as: 'user', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}, { |
|||
model: models.User, |
|||
as: 'audit1ManUser', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}, { |
|||
model: models.User, |
|||
as: 'audit2ManUser', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}, { |
|||
model: models.User, |
|||
as: 'rejectManUser', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}], |
|||
order: [["id", "desc"]] |
|||
}; |
|||
if (Number(pageSize) > 0 && Number(pageIndex) >= 0) { |
|||
findObj.limit = Number(pageSize); |
|||
findObj.offset = Number(pageIndex) * Number(pageSize); |
|||
} |
|||
let userPlaceSecurityRecords = await models.UserPlaceSecurityRecord.findAndCountAll(findObj); |
|||
ctx.status = 200; |
|||
ctx.body = userPlaceSecurityRecords; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "用户不存在!" } |
|||
} |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "请传用户参数!" } |
|||
} |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "获取用户填报信息失败" } |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
addPlaceSecurityRecord, |
|||
editPlaceSecurityRecord, |
|||
deletePlaceSecurityRecord, |
|||
getPlaceSecurityRecordById, |
|||
getRecentlyPlaceSecurityRecordByPlaceId, |
|||
getPlaceSecurityRecords, |
|||
getApprovePlaceSecurityRecords, |
|||
updateType |
|||
}; |
@ -1,91 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
/** |
|||
* 根据用户ID获取该用户创建的所有场所信息 |
|||
* @param {userId-用户ID} ctx |
|||
*/ |
|||
async function getPlacesByUserId(ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { userId } = ctx.params; |
|||
let places = await models.Places.findAll({ where: { userId: userId }, attributes: ['id', 'name'] }); |
|||
ctx.status = 200; |
|||
ctx.body = places; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "查询用户场所信息失败" } |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 根据审批用户ID获取该审批用户范围内填报人创建的场所信息 |
|||
* @param {approveUserId-审批用户ID} ctx |
|||
*/ |
|||
async function getPlacesByApproveUserId(ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { approveUserId } = ctx.params; |
|||
let approveUser = await models.User.findOne({ where: { id: approveUserId } }); |
|||
if (approveUser) { |
|||
let whereCondition = {}; |
|||
//获取审批人管辖区域内所有用户ID
|
|||
const departmentRes = await models.Department.findOne({ where: { id: approveUser.departmentId } }); |
|||
if (departmentRes.dependence) { |
|||
let regionType = departmentRes.type; |
|||
if (regionType == 4) { |
|||
whereCondition.userId = approveUserId; |
|||
} else { |
|||
let attentionRegionIds = [departmentRes.id]; |
|||
while (attentionRegionIds.length && regionType && regionType < 4) { |
|||
const departmentChilds = await models.Department.findAll({ where: { dependence: { $in: attentionRegionIds } } }); |
|||
regionType = departmentChilds.length ? departmentChilds[0].type : null; |
|||
attentionRegionIds = departmentChilds.map(d => d.id); |
|||
} |
|||
let users = await models.User.findAll({ where: { departmentId: { $in: attentionRegionIds } }, attributes: ['id'] }); |
|||
if (users.length) { |
|||
let userIds = users.map(u => u.id); |
|||
whereCondition.userId = { $in: userIds }; |
|||
} else { |
|||
ctx.status = 200; |
|||
ctx.body = []; |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
let places = await models.Places.findAll({ where: whereCondition, attributes: ['id', 'name'] }); |
|||
ctx.status = 200; |
|||
ctx.body = places; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "用户不存在!" } |
|||
} |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "查询用户区域内场所信息失败" } |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 获取所有场所信息 |
|||
*/ |
|||
async function getAllPlaces(ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
let places = await models.Places.findAll(); |
|||
ctx.status = 200; |
|||
ctx.body = places; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "获取场所信息失败" } |
|||
} |
|||
} |
|||
|
|||
|
|||
module.exports = { |
|||
getPlacesByUserId, |
|||
getPlacesByApproveUserId, |
|||
getAllPlaces |
|||
}; |
@ -1,140 +0,0 @@ |
|||
const moment = require('moment') |
|||
|
|||
async function getReportRectify(ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { fs: { api: { userInfo } } } = ctx |
|||
const { startTime, endTime } = ctx.query |
|||
// 查找自己所属的区县数据 type == 2
|
|||
|
|||
let userDepRes = await models.Department.findOne({ |
|||
order: [['id', 'asc']], |
|||
where: { |
|||
id: userInfo.departmentId |
|||
}, |
|||
}) |
|||
let depRes = [] |
|||
if (userDepRes.dataValues.type == 1) { |
|||
depRes = await models.Department.findAll({ |
|||
where: { |
|||
type: 2, |
|||
} |
|||
}) |
|||
} else if (userDepRes.dataValues.type == 2) { |
|||
depRes = [userDepRes] |
|||
} |
|||
|
|||
let rectifyReportList = [] |
|||
|
|||
let calDay = moment(startTime).startOf('day') |
|||
let endDay = moment(endTime).endOf('day') |
|||
let today = moment().endOf('day') |
|||
while (calDay.isBefore(endDay) && calDay.isBefore(today)) { |
|||
let curDay_ = calDay.clone(); |
|||
for (let d of depRes) { |
|||
let reportCount = await models.ReportRectify.count({ |
|||
where: { |
|||
regionId: d.dataValues.id, |
|||
userId:{$not:null}, |
|||
dateTime: { |
|||
$between: [ |
|||
curDay_.startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|||
curDay_.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|||
] |
|||
} |
|||
} |
|||
}) |
|||
let detailCount = await models.ReportRectify.count({ |
|||
where: { |
|||
regionId: d.dataValues.id, |
|||
dateTime: { |
|||
$between: [ |
|||
curDay_.startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|||
curDay_.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|||
] |
|||
} |
|||
} |
|||
}) |
|||
if (detailCount > 0) |
|||
rectifyReportList.push({ |
|||
day: calDay.format('YYYY-MM-DD'), |
|||
region: d.dataValues.name, |
|||
name: d.dataValues.name + '合用场所安全隐患排查整治汇总表', |
|||
reportBool: reportCount > 0, |
|||
depId: d.id, |
|||
}) |
|||
} |
|||
|
|||
calDay.add(1, 'day') |
|||
} |
|||
|
|||
ctx.body = rectifyReportList; |
|||
ctx.status = 200; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取合用场所安全隐患排查整治汇总表列表失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function getReportRectifyDetail(ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { day, depId } = ctx.query |
|||
|
|||
let searchDay = moment(day) |
|||
let reportRes = await models.ReportRectify.findAll({ |
|||
where: { |
|||
regionId: depId, |
|||
dateTime: { |
|||
$between: [ |
|||
searchDay.startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|||
searchDay.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|||
] |
|||
} |
|||
} |
|||
}) |
|||
|
|||
ctx.body = reportRes; |
|||
ctx.status = 200; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取合用场所安全隐患排查整治汇总表详情失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function compileReportRectifyDetail(ctx, next) { |
|||
const t = await ctx.fs.dc.orm.transaction(); |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body |
|||
for (let d of data) { |
|||
await models.ReportRectify.update(d, { |
|||
transaction: t, |
|||
where: { |
|||
id: d.id |
|||
} |
|||
}) |
|||
} |
|||
await t.commit(); |
|||
ctx.status = 204; |
|||
} catch (error) { |
|||
await t.rollback(); |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "保存合用场所安全隐患排查整治汇总表详情失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
getReportRectify, |
|||
getReportRectifyDetail, |
|||
compileReportRectifyDetail, |
|||
}; |
@ -1,173 +0,0 @@ |
|||
async function getAreas (ctx, next) { |
|||
try { |
|||
const { fs: { api: { userInfo } } } = ctx |
|||
const models = ctx.fs.dc.models; |
|||
|
|||
let userDepRes = await models.Department.findOne({ |
|||
order: [['id', 'asc']], |
|||
where: { |
|||
id: userInfo.departmentId |
|||
}, |
|||
}) |
|||
|
|||
let rslt = [] |
|||
if (userDepRes) { |
|||
if (userDepRes.dataValues.type == 1) { |
|||
rslt = await models.Department.findAll({ |
|||
order: [['id', 'asc']], |
|||
where: { |
|||
type: 2 |
|||
} |
|||
}) |
|||
} else if (userDepRes.dataValues.type == 2) { |
|||
rslt = [userDepRes.dataValues] |
|||
} |
|||
} |
|||
|
|||
ctx.body = rslt; |
|||
ctx.status = 200; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "查询区域数据失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function addReportConfig (ctx) { |
|||
let errMsg = "添加报表配置失败" |
|||
try { |
|||
const data = ctx.request.body |
|||
const models = ctx.fs.dc.models; |
|||
|
|||
const repeatRes = await models.ReportConfigition.find({ |
|||
where: { |
|||
regionId: data.regionId, |
|||
reportTypeId: data.reportTypeId, |
|||
excuteTime: data.excuteTime, |
|||
} |
|||
}) |
|||
|
|||
if (repeatRes) { |
|||
errMsg = '已有相同配置信息'; |
|||
throw errMsg |
|||
} |
|||
|
|||
const res = await models.ReportConfigition.create(data) |
|||
|
|||
ctx.body = res; |
|||
ctx.status = 200; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": errMsg |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function getReportConfig (ctx) { |
|||
try { |
|||
const { fs: { api: { userInfo } } } = ctx |
|||
const models = ctx.fs.dc.models; |
|||
|
|||
// 查找自己所属的区县数据 type == 2
|
|||
|
|||
let userDepRes = await models.Department.findOne({ |
|||
order: [['id', 'asc']], |
|||
where: { |
|||
id: userInfo.departmentId |
|||
}, |
|||
}) |
|||
let depRes = [] |
|||
if (userDepRes.dataValues.type == 1) { |
|||
depRes = await models.Department.findAll({ |
|||
where: { |
|||
type: 2, |
|||
} |
|||
}) |
|||
} else if (userDepRes.dataValues.type == 2) { |
|||
depRes = [userDepRes] |
|||
} |
|||
|
|||
const res = await models.ReportConfigition.findAll({ |
|||
where: { |
|||
regionId: { $in: depRes.map(d => d.dataValues.id) } |
|||
} |
|||
}) |
|||
|
|||
ctx.body = res; |
|||
ctx.status = 200; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取报表配置失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function editReportConfig (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body |
|||
const { reportId } = ctx.params |
|||
|
|||
const repeatRes = await models.ReportConfigition.find({ |
|||
where: { |
|||
id: { $ne: parseInt(reportId) }, |
|||
regionId: data.regionId, |
|||
reportTypeId: data.reportTypeId, |
|||
excuteTime: data.excuteTime, |
|||
} |
|||
}) |
|||
|
|||
if (repeatRes) { |
|||
errMsg = '已有相同配置信息'; |
|||
throw errMsg |
|||
} |
|||
|
|||
await models.ReportConfigition.update(data, { |
|||
where: { |
|||
id: parseInt(reportId) |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "编辑报表配置失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function delReportConfig (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { reportId } = ctx.params |
|||
await models.ReportConfigition.destroy({ |
|||
where: { |
|||
id: parseInt(reportId) |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "删除报表配置失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
getAreas, |
|||
addReportConfig, |
|||
getReportConfig, |
|||
editReportConfig, |
|||
delReportConfig, |
|||
}; |
@ -1,87 +1,176 @@ |
|||
const moment = require('moment'); |
|||
async function getReportList (ctx, next) { |
|||
'use strict'; |
|||
const { QueryTypes } = require('sequelize'); |
|||
|
|||
async function reportList (ctx) { |
|||
try { |
|||
const { fs: { api: { userInfo } } } = ctx |
|||
const models = ctx.fs.dc.models; |
|||
const { creatTime, reportName, regionName, limit, offset } = ctx.query; |
|||
const { limit, page, startTime, endTime, keyword, userId, reportType } = ctx.query |
|||
let findOption = { |
|||
where: { |
|||
|
|||
let where = { |
|||
$and: { |
|||
reportName: { $notLike: '%填报信息导出%' } |
|||
}, |
|||
attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'roadSectionEnd'], |
|||
include: [{ |
|||
model: models.User, |
|||
attributes: ['name'] |
|||
}], |
|||
} |
|||
if (limit) { |
|||
findOption.limit = limit |
|||
} |
|||
if (page && limit) { |
|||
findOption.offset = page * limit |
|||
} |
|||
if (startTime && endTime) { |
|||
findOption.where = { |
|||
time: { |
|||
'$between': [startTime, endTime] |
|||
} |
|||
}; |
|||
if (creatTime) { |
|||
where.creatTime = { |
|||
$gte: moment(creatTime[0]).format('YYYY-MM-DD HH:mm:ss'), |
|||
$lte: moment(creatTime[1]).format('YYYY-MM-DD HH:mm:ss') |
|||
} |
|||
} |
|||
if (keyword) { |
|||
findOption.where.road = { |
|||
'$like': `%${keyword}%` |
|||
} |
|||
} |
|||
if (userId) { |
|||
findOption.where.userId = userId |
|||
} |
|||
if (reportType) { |
|||
findOption.where.reportType = reportType |
|||
} |
|||
const reportRes = await models.Report.findAll(findOption) |
|||
|
|||
if (reportName) { |
|||
where.reportName = { |
|||
$iLike: `%${reportName}%` |
|||
ctx.status = 200; |
|||
ctx.body = reportRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (regionName && regionName != -1) { |
|||
where.regionId = regionName |
|||
} else { |
|||
let userDepRes = await models.Department.findOne({ |
|||
order: [['id', 'asc']], |
|||
async function reportPosition (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { startTime, endTime, userId, reportType } = ctx.query |
|||
const sequelize = ctx.fs.dc.ORM; |
|||
|
|||
let findMxTimeOption = { |
|||
attributes: [ |
|||
'userId', |
|||
[sequelize.fn('MAX', sequelize.col('time')), 'maxTime'], |
|||
], |
|||
where: { |
|||
id: userInfo.departmentId |
|||
|
|||
}, |
|||
}) |
|||
group: ['report.user_id'], |
|||
} |
|||
|
|||
if (startTime && endTime) { |
|||
findMxTimeOption.where = { |
|||
time: { |
|||
'$between': [startTime, endTime] |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (userId) { |
|||
findMxTimeOption.where.userId = userId |
|||
} |
|||
if (reportType) { |
|||
findMxTimeOption.where.reportType = reportType |
|||
} |
|||
|
|||
let userDep = [] |
|||
if (userDepRes) { |
|||
if (userDepRes.dataValues.type == 1) { |
|||
userDep = await models.Department.findAll({ |
|||
order: [['id', 'asc']], |
|||
const reportMaxTimeRes = await models.Report.findAll(findMxTimeOption) |
|||
const timeArr = reportMaxTimeRes.map(item => item.dataValues.maxTime) |
|||
const reportRes = await models.Report.findAll({ |
|||
where: { |
|||
type: 2 |
|||
time: { '$in': timeArr } |
|||
} |
|||
}) |
|||
} else if (userDepRes.dataValues.type == 2) { |
|||
userDep = [userDepRes] |
|||
ctx.status = 200; |
|||
ctx.body = reportRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
where.regionId = { $in: userDep.map(u => u.dataValues.id) } |
|||
} |
|||
|
|||
let findObj = { |
|||
include: [{ |
|||
model: models.ReportType, |
|||
attributes: ['name'] |
|||
}, { |
|||
model: models.Department, |
|||
attributes: ['name'] |
|||
}], |
|||
where: where, |
|||
order: [['creatTime', 'desc']], |
|||
}; |
|||
async function reportDetail (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { reportId } = ctx.params |
|||
|
|||
if (Number(limit) > 0 && Number(offset) >= 0) { |
|||
findObj.limit = Number(limit); |
|||
findObj.offset = Number(offset); |
|||
const reportRes = await models.Report.findOne({ |
|||
where: { |
|||
id: reportId |
|||
} |
|||
}) |
|||
|
|||
const res = await models.ReportDownManage.findAndCountAll(findObj) |
|||
|
|||
ctx.body = res; |
|||
ctx.status = 200; |
|||
ctx.body = reportRes |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function createReport (ctx) { |
|||
try { |
|||
const { userId } = ctx.fs.api |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body; |
|||
|
|||
await models.Report.create({ |
|||
...data, |
|||
userId, |
|||
time: new Date(), |
|||
}) |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "查询报表数据失败" |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function deleteReport (ctx) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { reportId } = ctx.params; |
|||
|
|||
await models.Report.destroy({ |
|||
where: { |
|||
id: reportId |
|||
} |
|||
}) |
|||
|
|||
ctx.status = 204 |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
message: typeof error == 'string' ? error : undefined |
|||
} |
|||
} |
|||
} |
|||
|
|||
// TODO 小程序填写道路名称的时候的道路筛选 是一起都返回 还是不断传关键字搜索返回
|
|||
|
|||
module.exports = { |
|||
getReportList, |
|||
reportList, |
|||
reportPosition, |
|||
reportDetail, createReport, deleteReport, |
|||
}; |
@ -1,342 +0,0 @@ |
|||
const moment = require('moment'); |
|||
const { QueryTypes } = require('sequelize'); |
|||
|
|||
async function reportDailyStatistic (ctx, next) { |
|||
const rslt = { |
|||
added: 0, //今日新增
|
|||
checked: 0, //今日已审填报
|
|||
unChecked: 0, //未审填报
|
|||
danger_place: 0, //隐患场所总数
|
|||
history: 0, //历史填报
|
|||
date: {} |
|||
}; |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const curDay_ = moment(); |
|||
const sequelize = ctx.fs.dc.orm; |
|||
|
|||
|
|||
rslt.added = await models.UserPlaceSecurityRecord.count({ |
|||
where: { |
|||
time: { |
|||
$between: [ |
|||
curDay_.startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|||
curDay_.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|||
] |
|||
} |
|||
} |
|||
}) |
|||
rslt.unChecked = await models.UserPlaceSecurityRecord.count({ |
|||
where: { |
|||
$or: [ |
|||
{ |
|||
audit2ManId: { $eq: null }, |
|||
rejectManId: { $eq: null }, |
|||
}, |
|||
// {
|
|||
// audit2ManId: { $ne: null },
|
|||
// rejectManId: { $eq: null },
|
|||
// },
|
|||
{ |
|||
audit1ManId: { $eq: null }, |
|||
rejectManId: { $eq: null }, |
|||
} |
|||
] |
|||
} |
|||
}); |
|||
|
|||
rslt.checked = await models.UserPlaceSecurityRecord.count({ |
|||
where: { |
|||
$or: [ |
|||
{ |
|||
audit2ManId: { $ne: null }, |
|||
audit2ManIdTime: { |
|||
$between: [ |
|||
curDay_.startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|||
curDay_.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
rejectManId: { $ne: null }, |
|||
rejectTime: { |
|||
$between: [ |
|||
curDay_.startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|||
curDay_.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|||
] |
|||
} |
|||
} |
|||
] |
|||
} |
|||
}); |
|||
|
|||
const list = await sequelize.query(`SELECT count(*) AS "count" FROM "user_placeSecurityRecord" AS "userPlaceSecurityRecord"
|
|||
WHERE ("userPlaceSecurityRecord"."correctiveAction" IS NOT NULL AND "userPlaceSecurityRecord"."punishment" IS NOT NULL) AND "audit2ManId" IS NOT NULL GROUP BY "placeId";`, { type: QueryTypes.SELECT })
|
|||
rslt.danger_place = list.length; |
|||
|
|||
rslt.history = await models.UserPlaceSecurityRecord.count(); |
|||
|
|||
// seven days data
|
|||
|
|||
const startDay = moment().startOf('day'); |
|||
for (let d = 1; d <= 7; d++) { |
|||
const START_DAY = moment(startDay).add(-d, 'day'); |
|||
const date = START_DAY.format('YYYY-MM-DD'); |
|||
const num = await models.UserPlaceSecurityRecord.count({ |
|||
where: { |
|||
time: { |
|||
$between: [ |
|||
START_DAY.startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|||
START_DAY.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|||
] |
|||
} |
|||
} |
|||
}) |
|||
|
|||
rslt.date[date] = num; |
|||
} |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = rslt; |
|||
|
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取数据中台数据失败" |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
async function reportAreaStatistic (ctx, next) { |
|||
let rslt = [], relationRegion = {}; |
|||
try { |
|||
const { startDate, endDate } = ctx.query; |
|||
const models = ctx.fs.dc.models; |
|||
const sequelize = ctx.fs.dc.orm; |
|||
|
|||
const list = await sequelize.query(`select "regionId", count("regionId") from "user_placeSecurityRecord" WHERE "time" BETWEEN '${moment(startDate).startOf('day').format('YYYY-MM-DD HH:mm:ss')}' AND '${moment(endDate).endOf('day').format('YYYY-MM-DD HH:mm:ss')}' AND "hiddenDangerItem12" IS NOT NULL GROUP BY "regionId" `, { type: QueryTypes.SELECT }) |
|||
// let regionIds = []
|
|||
// list.map(item => {
|
|||
// if (item.regionId && item.regionId != '') {
|
|||
// regionIds.push(item.regionId);
|
|||
// }
|
|||
// });
|
|||
|
|||
// const depts = await sequelize.query(`SELECT "id", "name", "type", "dependence" FROM "department" AS "department" WHERE "department"."id" IN (${regionIds.toString()});`, { type: QueryTypes.SELECT });
|
|||
const deptRelation = await sequelize.query(`SELECT "id", "name", "type", "dependence" FROM "department" AS "department";`, { type: QueryTypes.SELECT }); |
|||
const quArea = deptRelation.filter(f => f.type == 2); |
|||
quArea.map(item => { |
|||
relationRegion[item.id] = {}; |
|||
const xiang = deptRelation.filter(f => f.type == 3 && f.dependence == item.id).map(item => item.id); |
|||
|
|||
const cun = deptRelation.filter(f => f.type == 4 && xiang.some(ss => ss == f.dependence)).map(item => item.id); |
|||
relationRegion[item.id]['regionIds'] = [item.id, ...xiang, ...cun]; |
|||
relationRegion[item.id]['name'] = item.name; |
|||
}) |
|||
Object.keys(relationRegion).map(key => { |
|||
const { regionIds, name } = relationRegion[key]; |
|||
let data = list.filter(item => regionIds.some(id => id == item.regionId)) |
|||
let obj = {}; |
|||
obj['name'] = name; |
|||
obj['count'] = 0; |
|||
obj['regionId'] = key; |
|||
data.map(item => { |
|||
obj['count'] += Number(item.count) |
|||
}) |
|||
rslt.push(obj) |
|||
}) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = rslt; |
|||
|
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取数据中台数据失败" |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
async function dangerAreaQuery (ctx, next) { |
|||
const { userId } = ctx.fs.api |
|||
let rslt = { rows: [], count: 0, ids: [] }, relationRegion = {}; |
|||
try { |
|||
const { startDate, endDate, placeType, regionId, placeName, offset = 0, limit = 20 } = ctx.query; |
|||
const models = ctx.fs.dc.models; |
|||
const sequelize = ctx.fs.dc.orm; |
|||
|
|||
let options = { |
|||
audit2ManId: { $ne: null }, |
|||
}, places = [], dep4Ids = []; |
|||
if (startDate && endDate) { |
|||
options.time = { |
|||
$between: [ |
|||
moment(startDate).startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|||
moment(endDate).endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|||
] |
|||
} |
|||
} |
|||
if (placeName) { |
|||
places = await models.Places.findAll({ |
|||
where: { |
|||
name: { $like: `%${placeName}%` } |
|||
} |
|||
}) |
|||
options.placeId = { |
|||
$in: places.map(item => item.id) |
|||
} |
|||
} else { |
|||
places = await models.Places.findAll() |
|||
} |
|||
|
|||
if (regionId && regionId != -1) { |
|||
let idList = []; |
|||
const curDeptRelation = await sequelize.query(`SELECT "id", "name", "type", "dependence" FROM "department" WHERE "id" in (${regionId});`, { type: QueryTypes.SELECT }); |
|||
|
|||
const type = curDeptRelation[0].type |
|||
if (type != 1) { |
|||
const deptRelation = await sequelize.query(`SELECT "id", "name", "type", "dependence" FROM "department" AS "department";`, { type: QueryTypes.SELECT }); |
|||
const quArea = deptRelation.filter(f => f.type == 2); |
|||
quArea.map(item => { |
|||
relationRegion[item.id] = {}; |
|||
deptRelation.filter(f => f.type == 3 && f.dependence == item.id).map(x => { |
|||
relationRegion[item.id][x.id] = deptRelation.filter(f => f.type == 4 && x.id == f.dependence).map(cun => cun.id); |
|||
}); |
|||
}) |
|||
if (type == 2) { |
|||
const quList = [regionId]; |
|||
const xiangList = Object.keys(relationRegion[regionId]) |
|||
let cunList = xiangList.map(key => { |
|||
return relationRegion[regionId][key] |
|||
}) |
|||
idList = quList.concat(xiangList).concat(cunList.flat(Infinity)) |
|||
|
|||
options.regionId = { $in: idList }; |
|||
} |
|||
if (type == 3) { |
|||
Object.keys(relationRegion).map(quKey => { |
|||
Object.keys(relationRegion[quKey]).map(xiangKey => { |
|||
if (xiangKey == regionId) { |
|||
const xiangList = [xiangKey]; |
|||
const cunList = relationRegion[quKey][xiangKey] |
|||
idList = xiangList.concat(cunList); |
|||
} |
|||
}) |
|||
}) |
|||
dep4Ids = idList |
|||
} |
|||
if (type == 4) { |
|||
const curUser = await models.User.findOne({ where: { id: userId } }) |
|||
const corUserDepId = curUser.departmentId |
|||
const corUseUserDepRes = await models.Department.findOne({ where: { id: corUserDepId } }) |
|||
if(corUseUserDepRes.type < 4){ |
|||
dep4Ids = [regionId] |
|||
} else { |
|||
options.userId = userId |
|||
} |
|||
// idList = [regionId]
|
|||
// options.userId = userId
|
|||
} |
|||
// options.departmentId = { $in: idList };
|
|||
} |
|||
} |
|||
|
|||
if (placeType != null && placeType != -1) { |
|||
|
|||
if (placeType == 0) { |
|||
options = Object.assign({}, options, { |
|||
$or: [ |
|||
{ |
|||
correctiveAction: { $ne: null }, |
|||
}, |
|||
{ |
|||
punishment: { $ne: null }, |
|||
} |
|||
] |
|||
}) |
|||
} |
|||
|
|||
if (placeType == 1) |
|||
options = Object.assign({}, options, { |
|||
$or: [ |
|||
{ |
|||
correctiveAction: { $eq: null }, |
|||
}, |
|||
{ |
|||
punishment: { $eq: null }, |
|||
} |
|||
], |
|||
hiddenDangerItem12: { |
|||
$ne: null |
|||
} |
|||
}) |
|||
|
|||
if (placeType == 2) |
|||
options.hiddenDangerItem12 = { |
|||
$eq: null |
|||
} |
|||
} |
|||
|
|||
let findOption = { |
|||
where: options, |
|||
offset: offset, |
|||
limit: limit, |
|||
order: [['time', 'DESC']], |
|||
} |
|||
|
|||
if (dep4Ids.length) { |
|||
findOption.include = [{ |
|||
required: true, |
|||
model: models.User, |
|||
as: 'user', |
|||
where: { |
|||
departmentId: { $in: dep4Ids } |
|||
} |
|||
}] |
|||
} |
|||
|
|||
const list = await models.UserPlaceSecurityRecord.findAll(findOption) |
|||
|
|||
for (let item of list) { |
|||
const { name } = places.filter(p => p.id == item.placeId)[0] || {}; |
|||
const checkAreaName = await sequelize.query(`SELECT "dpt"."name" FROM "department" as "dpt" WHERE "dpt"."id" in (SELECT "department_id" FROM "user" WHERE "id" = ${item.userId} );`, { type: QueryTypes.SELECT }) |
|||
const checkUser = await sequelize.query(`SELECT "name", "phone" FROM "user" WHERE "id" = ${item.userId}`, { type: QueryTypes.SELECT }) |
|||
rslt.rows.push(Object.assign({}, item.dataValues, { placeName: name, checkAreaName: (checkAreaName[0] || {}).name || '', checkUserName: (checkUser[0] || {}).name || '', checkUserPhone: (checkUser[0] || {}).phone })) |
|||
} |
|||
|
|||
delete findOption.offset |
|||
delete findOption.limit |
|||
delete findOption.order |
|||
findOption.attributes = ['id'] |
|||
const dataAll = await models.UserPlaceSecurityRecord.findAll( |
|||
findOption |
|||
// {
|
|||
// attributes: ['id'],
|
|||
// where: options,
|
|||
// }
|
|||
); |
|||
rslt.count = dataAll.length; |
|||
rslt.ids = dataAll.map(item => item.dataValues.id); |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = rslt; |
|||
|
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取数据中台数据失败" |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
module.exports = { |
|||
reportDailyStatistic, |
|||
reportAreaStatistic, |
|||
dangerAreaQuery, |
|||
} |
@ -1,483 +0,0 @@ |
|||
'use strict'; |
|||
const moment = require('moment'); |
|||
//获取每日汇总
|
|||
async function getDayReport(ctx) { |
|||
try { |
|||
const { date, areaId } = ctx.query; |
|||
const models = ctx.fs.dc.models; |
|||
let range = [moment(date).startOf('day').format("YYYY-MM-DD HH:mm:ss"), moment(date).endOf('day').format("YYYY-MM-DD HH:mm:ss")] |
|||
let rslt = await models.ReportCollection.findAll({ |
|||
where: { |
|||
dateTime: { |
|||
$between: range |
|||
}, |
|||
regionId: areaId |
|||
}, |
|||
include: [{ |
|||
required: true, |
|||
model: models.User, |
|||
attributes: ['name', 'username', 'phone'] |
|||
}, { |
|||
required: false, |
|||
model: models.Department, |
|||
attributes: ['name'] |
|||
}] |
|||
}); |
|||
ctx.status = 200; |
|||
ctx.body = rslt; |
|||
} catch (error) { |
|||
console.log(error) |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取全市每日汇总表失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
//获取排查整治汇总表
|
|||
async function getGovern(ctx) { |
|||
try { |
|||
const { date, areaId } = ctx.query; |
|||
const models = ctx.fs.dc.models; |
|||
let range = [moment(date).startOf('day').format("YYYY-MM-DD HH:mm:ss"), moment(date).endOf('day').format("YYYY-MM-DD HH:mm:ss")] |
|||
let rslt = await models.ReportRectify.findAndCountAll({ |
|||
where: { |
|||
dateTime: { |
|||
$between: range |
|||
}, |
|||
regionId: areaId |
|||
}, |
|||
include: [{ |
|||
required: true, |
|||
model: models.User, |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}, { |
|||
required: false, |
|||
model: models.Department, |
|||
attributes: ['id', 'name'] |
|||
}], |
|||
limit: 1 |
|||
}); |
|||
ctx.status = 200; |
|||
let obj = { count: 0 } |
|||
if (rslt.count > 0) { |
|||
obj.area = rslt.rows[0].department; |
|||
obj.dateTime = rslt.rows[0].dateTime; |
|||
obj.count = rslt.count; |
|||
obj.user = rslt.rows[0].user; |
|||
obj.isAudit = rslt.rows[0].isAudit |
|||
} |
|||
ctx.body = obj; |
|||
} catch (error) { |
|||
console.log(error) |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取排查整治汇总表失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
//获取排查整治汇总详情
|
|||
async function getGovernDetail(ctx) { |
|||
try { |
|||
const { name, date, areaId, pageSize, pageIndex } = ctx.query; |
|||
const models = ctx.fs.dc.models; |
|||
let range = [moment(date).startOf('day').format("YYYY-MM-DD HH:mm:ss"), moment(date).endOf('day').format("YYYY-MM-DD HH:mm:ss")] |
|||
let whereObj = { |
|||
dateTime: { |
|||
$between: range |
|||
}, |
|||
regionId: areaId |
|||
}; |
|||
if (name) { |
|||
whereObj.name = { $like: `%${name}%` } |
|||
} |
|||
let findObj = { |
|||
where: whereObj, |
|||
include: [{ |
|||
required: true, |
|||
model: models.User, |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}, { |
|||
required: false, |
|||
model: models.Department, |
|||
attributes: ['id', 'name'] |
|||
}], |
|||
order: [['dateTime', 'desc']] |
|||
}; |
|||
if (Number(pageSize) > 0 && Number(pageIndex) >= 0) { |
|||
findObj.limit = Number(pageSize); |
|||
findObj.offset = Number(pageIndex) * Number(pageSize); |
|||
} |
|||
let rslt = await models.ReportRectify.findAndCountAll(findObj); |
|||
ctx.status = 200; |
|||
ctx.body = rslt; |
|||
} catch (error) { |
|||
console.log(error) |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取排查整治汇总详情失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 确认整治汇总场所数据 |
|||
* body { |
|||
* governDetailIds:'1,2' |
|||
* } |
|||
*/ |
|||
async function operateGovern(ctx, next) { |
|||
try { |
|||
const data = ctx.request.body; |
|||
const models = ctx.fs.dc.models; |
|||
if (data.governDetailIds && data.governDetailIds.length > 0) { |
|||
await models.ReportRectify.update({ |
|||
isAudit: true |
|||
}, { where: { id: { $in: data.governDetailIds.split(',') } } }); |
|||
|
|||
ctx.body = { "message": "确认整治汇总下场所数据成功" }; |
|||
ctx.status = 200; |
|||
} else { |
|||
ctx.body = { "message": "确认参数有误" }; |
|||
ctx.status = 400; |
|||
} |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "确认整治汇总下场所数据失败" } |
|||
} |
|||
} |
|||
|
|||
//获取安全隐患排查详细数据列表
|
|||
async function getSecurityRiskList(ctx) { |
|||
try { |
|||
const { name, date, areaId, pageSize, pageIndex } = ctx.query; |
|||
const models = ctx.fs.dc.models; |
|||
|
|||
let whereObj = {}; |
|||
let wheres = { |
|||
audit1ManId: { $not: null }, |
|||
audit2ManId: { $not: null } |
|||
} |
|||
if (areaId) { |
|||
wheres.regionId = areaId; |
|||
} |
|||
if (name) |
|||
whereObj = { name: { $like: `%${name}%` } } |
|||
let findObj = { |
|||
attributes: ['id', 'time', 'placeId', 'userId'], |
|||
where: |
|||
// time: {
|
|||
// $between: range
|
|||
// },
|
|||
// regionId: areaId,
|
|||
// audit1ManId: { $not: null },
|
|||
// audit2ManId: { $not: null }
|
|||
wheres |
|||
, |
|||
include: [{ |
|||
required: true, |
|||
model: models.Places, |
|||
attributes: ['id', 'name'], |
|||
where: whereObj |
|||
}, { |
|||
required: true, |
|||
model: models.User, |
|||
as: 'user', |
|||
attributes: ['id', 'name', 'username', 'phone'] |
|||
}], |
|||
order: [['time', 'desc']] |
|||
}; |
|||
if (date) { |
|||
let range = [moment(date).startOf('day').format("YYYY-MM-DD HH:mm:ss"), moment(date).endOf('day').format("YYYY-MM-DD HH:mm:ss")] |
|||
findObj.where.time = { |
|||
$between: range |
|||
} |
|||
} |
|||
if (areaId) { |
|||
findObj.where.regionId = areaId |
|||
} |
|||
|
|||
if (Number(pageSize) > 0 && Number(pageIndex) >= 0) { |
|||
findObj.limit = Number(pageSize); |
|||
findObj.offset = Number(pageIndex) * Number(pageSize); |
|||
} |
|||
let rslt = await models.UserPlaceSecurityRecord.findAndCountAll(findObj); |
|||
ctx.status = 200; |
|||
ctx.body = rslt; |
|||
} catch (error) { |
|||
console.log(error) |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取安全隐患排查详细数据列表失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
//获取待处理数量
|
|||
async function getHomeCount(ctx) { |
|||
try { |
|||
let { userId, departmentId, userRegionType } = ctx.params; |
|||
const models = ctx.fs.dc.models; |
|||
const departmentRes = await models.Department.findOne({ where: { id: departmentId } }); |
|||
if (userRegionType != 2 && userRegionType != 3 && !departmentRes) { |
|||
ctx.body = { "message": "请求参数有误" }; |
|||
ctx.status = 400; |
|||
} else { |
|||
//获取当前用户数据范围管辖区域内所有用户ID
|
|||
let attentionRegionIds = [departmentRes.id]; |
|||
let regionType = departmentRes.type; |
|||
while (attentionRegionIds.length && regionType && regionType < 4) { |
|||
const departmentChilds = await models.Department.findAll({ where: { dependence: { $in: attentionRegionIds } } }); |
|||
regionType = departmentChilds.length ? departmentChilds[0].type : null; |
|||
attentionRegionIds = departmentChilds.map(d => d.id); |
|||
} |
|||
let users = await models.User.findAll({ where: { departmentId: { $in: attentionRegionIds } }, attributes: ['id'] }); |
|||
let userIds = users.map(u => u.id); |
|||
|
|||
let rslt = { recordCount: 0, reportCount: null } |
|||
if (userIds.length) { |
|||
let whereObj = { |
|||
userId: { $in: userIds }, |
|||
rejectManId: null, |
|||
isDraft: false |
|||
} |
|||
if (userRegionType == 3) { |
|||
whereObj.audit1ManId = null; |
|||
} else { |
|||
whereObj.audit1ManId = { $not: null }; |
|||
whereObj.audit2ManId = null; |
|||
} |
|||
let recordCount = await models.UserPlaceSecurityRecord.count({ |
|||
where: whereObj |
|||
}); |
|||
rslt.recordCount = recordCount; |
|||
if (userRegionType == 2) { |
|||
let reportCount = await models.ReportCollection.count({ |
|||
where: { |
|||
userId: null, |
|||
regionId: departmentId |
|||
} |
|||
}); |
|||
let reportRectify = await models.ReportRectify.findAll({ |
|||
where: { |
|||
userId: null, |
|||
regionId: departmentId |
|||
} |
|||
}); |
|||
let dateArr = []; |
|||
reportRectify.map(r => { |
|||
let date = moment(r.dateTime).format("YYYY-MM-DD"); |
|||
if (!dateArr.includes(date)) { |
|||
dateArr.push(date) |
|||
} |
|||
}) |
|||
rslt.reportCount = reportCount + dateArr.length; |
|||
} |
|||
} |
|||
ctx.status = 200; |
|||
ctx.body = rslt; |
|||
} |
|||
} catch (error) { |
|||
console.log(error) |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取待处理数量失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
//每日汇总表上报
|
|||
async function operateReport(ctx, next) { |
|||
try { |
|||
let { id, userId } = ctx.params; |
|||
const models = ctx.fs.dc.models; |
|||
await models.ReportCollection.update({ |
|||
userId: userId |
|||
}, { where: { id: id } }); |
|||
|
|||
ctx.body = { "message": "每日汇总表上报成功" }; |
|||
ctx.status = 200; |
|||
|
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "每日汇总表上报失败" } |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 根据筛选条件获取用户审核报表信息 |
|||
* @query { |
|||
* approveUserId-审批人ID |
|||
* reportType-报表类型(1-整治汇总表,2-每日汇总表,null-整治汇总表+每日汇总表) |
|||
* timeRange-时间范围 |
|||
* regionId-区域ID |
|||
* state-审批状态 |
|||
* pageIndex-页码 |
|||
* pageSize-页宽 |
|||
* } ctx |
|||
*/ |
|||
async function getApproveReportCollections(ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { approveUserId, reportType, timeRange, regionId, state, pageIndex, pageSize } = ctx.query; |
|||
let whereCondition = {}; |
|||
if (approveUserId) { |
|||
let approveUser = await models.User.findOne({ where: { id: approveUserId } }); |
|||
if (approveUser) { |
|||
//市级用户可以看到所有报表数据
|
|||
const departmentRes = await models.Department.findOne({ where: { id: approveUser.departmentId } }); |
|||
if (departmentRes.dependence) { |
|||
if (departmentRes.type = 2) { |
|||
//区县人员只能看见自己区县下的报表信息
|
|||
whereCondition.regionId = departmentRes.id; |
|||
} else { |
|||
//其它层级无报表信息
|
|||
ctx.status = 200; |
|||
ctx.body = { |
|||
"count": 0, |
|||
"rows": [] |
|||
}; |
|||
return; |
|||
} |
|||
} |
|||
if (regionId) { |
|||
let region = await models.Department.findOne({ where: { id: regionId } }); |
|||
if (region) { |
|||
if (whereCondition.regionId && whereCondition.regionId != regionId) { |
|||
//区县人员只能看见自己区县下的报表信息
|
|||
ctx.status = 200; |
|||
ctx.body = { |
|||
"count": 0, |
|||
"rows": [] |
|||
}; |
|||
return; |
|||
} else { |
|||
whereCondition.regionId = regionId; |
|||
} |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "区域不存在!" } |
|||
return; |
|||
} |
|||
} |
|||
let times = timeRange; |
|||
if (timeRange && timeRange.indexOf(',')) { times = timeRange.split(',') } |
|||
if (times && times.length > 0) { |
|||
const len = times.length; |
|||
whereCondition.dateTime = { |
|||
$between: [ |
|||
moment(times[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
|||
moment(times[len - 1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|||
] |
|||
}; |
|||
} |
|||
switch (Number(state)) { |
|||
case 1: //待审批:无审核人员
|
|||
whereCondition.userId = null; |
|||
break; |
|||
case 2://已审批:有审核人员
|
|||
whereCondition.userId = { $not: null }; |
|||
break; |
|||
default: break; |
|||
} |
|||
let findObj = { |
|||
where: whereCondition, |
|||
order: [["id", "desc"]], |
|||
include: [{ |
|||
model: models.User, |
|||
attributes: ['name', 'username', 'phone'] |
|||
}, { |
|||
model: models.Department, |
|||
attributes: ['id', 'name'] |
|||
}] |
|||
}; |
|||
if (Number(pageSize) > 0 && Number(pageIndex) >= 0) { |
|||
findObj.limit = Number(pageSize); |
|||
findObj.offset = Number(pageIndex) * Number(pageSize); |
|||
} |
|||
switch (Number(reportType)) { |
|||
case 1: //整治汇总表
|
|||
ctx.body = await models.ReportRectify.findAndCountAll(findObj); |
|||
break; |
|||
case 2://每日汇总表
|
|||
ctx.body = await models.ReportCollection.findAndCountAll(findObj); |
|||
break; |
|||
default: //整治汇总表+每日汇总表
|
|||
const rectifies = await models.ReportRectify.findAndCountAll(findObj); |
|||
const collections = await models.ReportCollection.findAndCountAll(findObj); |
|||
ctx.body = { |
|||
"totalCount": rectifies.count + collections.count, |
|||
"totalRows": { |
|||
"rectify": rectifies, |
|||
"collection": collections |
|||
} |
|||
}; |
|||
break; |
|||
} |
|||
ctx.status = 200; |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "用户不存在!" } |
|||
} |
|||
} else { |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "请传用户参数!" } |
|||
} |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "获取审批报表信息失败" } |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 上报排查整治汇总表 |
|||
* query{ |
|||
* userId:1,//上报用户
|
|||
* } |
|||
* body { |
|||
* governDetailIds:'1,2' //排查整治汇总返回数据id字符串
|
|||
* } |
|||
*/ |
|||
async function operateGovernReport(ctx, next) { |
|||
try { |
|||
let { userId } = ctx.params; |
|||
const data = ctx.request.body; |
|||
const models = ctx.fs.dc.models; |
|||
if (data.governDetailIds && data.governDetailIds.length > 0) { |
|||
await models.ReportRectify.update({ |
|||
userId: userId |
|||
}, { where: { id: { $in: data.governDetailIds.split(',') } } }); |
|||
|
|||
ctx.body = { "message": "上报排查整治汇总表成功" }; |
|||
ctx.status = 200; |
|||
} else { |
|||
ctx.body = { "message": "上报排查整治汇总表参数有误" }; |
|||
ctx.status = 400; |
|||
} |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { "message": "上报排查整治汇总表失败" } |
|||
} |
|||
} |
|||
module.exports = { |
|||
getDayReport, |
|||
getGovern, |
|||
getGovernDetail, |
|||
operateGovern, |
|||
getSecurityRiskList, |
|||
getHomeCount, |
|||
operateReport, |
|||
getApproveReportCollections, |
|||
operateGovernReport |
|||
}; |
@ -0,0 +1,898 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Bridge = sequelize.define("bridge", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "bridge_id_uindex" |
|||
}, |
|||
bridgeCode: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桥梁代码", |
|||
primaryKey: false, |
|||
field: "bridge_code", |
|||
autoIncrement: false |
|||
}, |
|||
bridgeName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桥梁名称", |
|||
primaryKey: false, |
|||
field: "bridge_name", |
|||
autoIncrement: false |
|||
}, |
|||
centralStation: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "中心桩号", |
|||
primaryKey: false, |
|||
field: "central_station", |
|||
autoIncrement: false |
|||
}, |
|||
crossingFigureType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "跨越地物类型", |
|||
primaryKey: false, |
|||
field: "crossing_figure_type", |
|||
autoIncrement: false |
|||
}, |
|||
crossingFigureName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "跨越地物名称", |
|||
primaryKey: false, |
|||
field: "crossing_figure_name", |
|||
autoIncrement: false |
|||
}, |
|||
natureOfCharges: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "收费性质", |
|||
primaryKey: false, |
|||
field: "nature_of_charges", |
|||
autoIncrement: false |
|||
}, |
|||
rampCode: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "匝道编码", |
|||
primaryKey: false, |
|||
field: "ramp_code", |
|||
autoIncrement: false |
|||
}, |
|||
sectionType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "路段类型", |
|||
primaryKey: false, |
|||
field: "section_type", |
|||
autoIncrement: false |
|||
}, |
|||
crossingFigureType1: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "跨越地物类型1", |
|||
primaryKey: false, |
|||
field: "crossing_figure_type_1", |
|||
autoIncrement: false |
|||
}, |
|||
crossingFigureName1: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "跨越地物名称1", |
|||
primaryKey: false, |
|||
field: "crossing_figure_name_1", |
|||
autoIncrement: false |
|||
}, |
|||
originalBridgeCode: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "原桥梁代码", |
|||
primaryKey: false, |
|||
field: "original_bridge_code", |
|||
autoIncrement: false |
|||
}, |
|||
whetherWideRoadAndNarrowBridge: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否宽路窄桥", |
|||
primaryKey: false, |
|||
field: "whether_wide_road_and_narrow_bridge", |
|||
autoIncrement: false |
|||
}, |
|||
isItInTheDirectoryOfLongAndLongBridges: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否在长大桥梁目录中", |
|||
primaryKey: false, |
|||
field: "is_it_in_the_directory_of_long_and_long_bridges", |
|||
autoIncrement: false |
|||
}, |
|||
whetherItIsACrossProvincialBridge: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否跨省桥梁", |
|||
primaryKey: false, |
|||
field: "whether_it_is_a_cross_provincial_bridge", |
|||
autoIncrement: false |
|||
}, |
|||
interworkingType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "互通类型", |
|||
primaryKey: false, |
|||
field: "interworking_type", |
|||
autoIncrement: false |
|||
}, |
|||
interworkingForm: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "互通形式", |
|||
primaryKey: false, |
|||
field: "interworking_form", |
|||
autoIncrement: false |
|||
}, |
|||
interworkingAndCrossoverMode: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "互通交叉方式", |
|||
primaryKey: false, |
|||
field: "interworking_and_crossover_mode", |
|||
autoIncrement: false |
|||
}, |
|||
bridgeClassification: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桥梁分类", |
|||
primaryKey: false, |
|||
field: "bridge_classification", |
|||
autoIncrement: false |
|||
}, |
|||
totalLengthOfBridge: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桥梁全长", |
|||
primaryKey: false, |
|||
field: "total_length_of_bridge", |
|||
autoIncrement: false |
|||
}, |
|||
totalSpanLength: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "跨径总长", |
|||
primaryKey: false, |
|||
field: "total_span_length", |
|||
autoIncrement: false |
|||
}, |
|||
mainSpanOfMainBridge: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "主桥主跨", |
|||
primaryKey: false, |
|||
field: "main_span_of_main_bridge", |
|||
autoIncrement: false |
|||
}, |
|||
numberOfMainBridgeHoles: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "主桥孔数", |
|||
primaryKey: false, |
|||
field: "number_of_main_bridge_holes", |
|||
autoIncrement: false |
|||
}, |
|||
spanCombination: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "跨径组合", |
|||
primaryKey: false, |
|||
field: "span_combination", |
|||
autoIncrement: false |
|||
}, |
|||
bridgeProperties: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桥梁性质", |
|||
primaryKey: false, |
|||
field: "bridge_properties", |
|||
autoIncrement: false |
|||
}, |
|||
designLoadClass: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "设计荷载等级", |
|||
primaryKey: false, |
|||
field: "design_load_class", |
|||
autoIncrement: false |
|||
}, |
|||
superstructure: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "上部结构", |
|||
primaryKey: false, |
|||
field: "superstructure", |
|||
autoIncrement: false |
|||
}, |
|||
superstructureMaterials: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "上部结构材料", |
|||
primaryKey: false, |
|||
field: "superstructure_materials", |
|||
autoIncrement: false |
|||
}, |
|||
bridgeDeckPavementType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桥面铺装类型", |
|||
primaryKey: false, |
|||
field: "bridge_deck_pavement_type", |
|||
autoIncrement: false |
|||
}, |
|||
bridgeDeckWidth: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桥面宽", |
|||
primaryKey: false, |
|||
field: "bridge_deck_width", |
|||
autoIncrement: false |
|||
}, |
|||
clearWidthOfBridgeDeck: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桥面净宽", |
|||
primaryKey: false, |
|||
field: "clear_width_of_bridge_deck", |
|||
autoIncrement: false |
|||
}, |
|||
clearanceUnderBridge: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桥下净空", |
|||
primaryKey: false, |
|||
field: "clearance_under_bridge", |
|||
autoIncrement: false |
|||
}, |
|||
seismicGrade: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "抗震等级", |
|||
primaryKey: false, |
|||
field: "seismic_grade", |
|||
autoIncrement: false |
|||
}, |
|||
navigationClass: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "通航等级", |
|||
primaryKey: false, |
|||
field: "navigation_class", |
|||
autoIncrement: false |
|||
}, |
|||
abutmentType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桥台类型", |
|||
primaryKey: false, |
|||
field: "abutment_type", |
|||
autoIncrement: false |
|||
}, |
|||
pierType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桥墩类型", |
|||
primaryKey: false, |
|||
field: "pier_type", |
|||
autoIncrement: false |
|||
}, |
|||
typesOfPierAndAbutmentAntiCollisionFacilities: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "墩台防撞设施类型", |
|||
primaryKey: false, |
|||
field: "types_of_pier_and_abutment_anti_collision_facilities", |
|||
autoIncrement: false |
|||
}, |
|||
expansionJointType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "伸缩缝类型", |
|||
primaryKey: false, |
|||
field: "expansion_joint_type", |
|||
autoIncrement: false |
|||
}, |
|||
supportType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "支座类型", |
|||
primaryKey: false, |
|||
field: "support_type", |
|||
autoIncrement: false |
|||
}, |
|||
characteristicsOfCurvedSlope: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "弯坡斜特征", |
|||
primaryKey: false, |
|||
field: "characteristics_of_curved_slope", |
|||
autoIncrement: false |
|||
}, |
|||
bridgeHeight: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桥梁高度", |
|||
primaryKey: false, |
|||
field: "bridge_height", |
|||
autoIncrement: false |
|||
}, |
|||
sidewalkWidth: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "人行道宽度", |
|||
primaryKey: false, |
|||
field: "sidewalk_width", |
|||
autoIncrement: false |
|||
}, |
|||
constructionUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "建设单位", |
|||
primaryKey: false, |
|||
field: "construction_unit", |
|||
autoIncrement: false |
|||
}, |
|||
completionTime: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "建成时间", |
|||
primaryKey: false, |
|||
field: "completion_time", |
|||
autoIncrement: false |
|||
}, |
|||
openingDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "通车日期", |
|||
primaryKey: false, |
|||
field: "opening_date", |
|||
autoIncrement: false |
|||
}, |
|||
reconstructionTime: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "改建时间", |
|||
primaryKey: false, |
|||
field: "reconstruction_time", |
|||
autoIncrement: false |
|||
}, |
|||
totalCost: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "总造价", |
|||
primaryKey: false, |
|||
field: "total_cost", |
|||
autoIncrement: false |
|||
}, |
|||
nameOfDesignUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "设计单位名称", |
|||
primaryKey: false, |
|||
field: "name_of_design_unit", |
|||
autoIncrement: false |
|||
}, |
|||
nameOfConstructionUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "施工单位名称", |
|||
primaryKey: false, |
|||
field: "name_of_construction_unit", |
|||
autoIncrement: false |
|||
}, |
|||
nameOfSupervisionUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "监理单位名称", |
|||
primaryKey: false, |
|||
field: "name_of_supervision_unit", |
|||
autoIncrement: false |
|||
}, |
|||
natureOfConstruction: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "建设性质", |
|||
primaryKey: false, |
|||
field: "nature_of_construction", |
|||
autoIncrement: false |
|||
}, |
|||
evaluationDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "评定日期", |
|||
primaryKey: false, |
|||
field: "evaluation_date", |
|||
autoIncrement: false |
|||
}, |
|||
technicalConditionEvaluation: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "技术状况评定", |
|||
primaryKey: false, |
|||
field: "technical_condition_evaluation", |
|||
autoIncrement: false |
|||
}, |
|||
assessmentUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "评定单位", |
|||
primaryKey: false, |
|||
field: "assessment_unit", |
|||
autoIncrement: false |
|||
}, |
|||
locationOfMajorDiseases: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "主要病害位置", |
|||
primaryKey: false, |
|||
field: "location_of_major_diseases", |
|||
autoIncrement: false |
|||
}, |
|||
diseaseDescription: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "病害描述", |
|||
primaryKey: false, |
|||
field: "disease_description", |
|||
autoIncrement: false |
|||
}, |
|||
takeControlMeasures: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "采取管制措施", |
|||
primaryKey: false, |
|||
field: "take_control_measures", |
|||
autoIncrement: false |
|||
}, |
|||
dateOfLastPeriodicInspection: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "最近定期检查日期", |
|||
primaryKey: false, |
|||
field: "date_of_last_periodic_inspection", |
|||
autoIncrement: false |
|||
}, |
|||
natureOfManagementAndMaintenanceUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "管养单位性质", |
|||
primaryKey: false, |
|||
field: "nature_of_management_and_maintenance_unit", |
|||
autoIncrement: false |
|||
}, |
|||
managementAndMaintenanceUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "管养单位", |
|||
primaryKey: false, |
|||
field: "management_and_maintenance_unit", |
|||
autoIncrement: false |
|||
}, |
|||
supervisionUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "监管单位", |
|||
primaryKey: false, |
|||
field: "supervision_unit", |
|||
autoIncrement: false |
|||
}, |
|||
reconstructionConstructionUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "改造施工单位", |
|||
primaryKey: false, |
|||
field: "reconstruction_construction_unit", |
|||
autoIncrement: false |
|||
}, |
|||
whetherItIsASubsidyProjectOfTheMinistry: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否部补助项目", |
|||
primaryKey: false, |
|||
field: "whether_it_is_a_subsidy_project_of_the_ministry", |
|||
autoIncrement: false |
|||
}, |
|||
engineeringProperties: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "工程性质", |
|||
primaryKey: false, |
|||
field: "engineering_properties", |
|||
autoIncrement: false |
|||
}, |
|||
reconstructionPart: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "改造部位", |
|||
primaryKey: false, |
|||
field: "reconstruction_part", |
|||
autoIncrement: false |
|||
}, |
|||
modificationCompletionDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "改造完工日期", |
|||
primaryKey: false, |
|||
field: "modification_completion_date", |
|||
autoIncrement: false |
|||
}, |
|||
year1: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "年份1", |
|||
primaryKey: false, |
|||
field: "year_1", |
|||
autoIncrement: false |
|||
}, |
|||
spanCombination1: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "跨径组合1", |
|||
primaryKey: false, |
|||
field: "span_combination_1", |
|||
autoIncrement: false |
|||
}, |
|||
investment1: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "投资1", |
|||
primaryKey: false, |
|||
field: "investment_1", |
|||
autoIncrement: false |
|||
}, |
|||
year2: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "年份2", |
|||
primaryKey: false, |
|||
field: "year_2", |
|||
autoIncrement: false |
|||
}, |
|||
spanCombination2: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "跨径组合2", |
|||
primaryKey: false, |
|||
field: "span_combination_2", |
|||
autoIncrement: false |
|||
}, |
|||
investment2: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "投资2", |
|||
primaryKey: false, |
|||
field: "investment_2", |
|||
autoIncrement: false |
|||
}, |
|||
year3: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "年份3", |
|||
primaryKey: false, |
|||
field: "year_3", |
|||
autoIncrement: false |
|||
}, |
|||
spanCombination3: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "跨径组合3", |
|||
primaryKey: false, |
|||
field: "span_combination_3", |
|||
autoIncrement: false |
|||
}, |
|||
investment3: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "投资3", |
|||
primaryKey: false, |
|||
field: "investment_3", |
|||
autoIncrement: false |
|||
}, |
|||
year4: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "年份4", |
|||
primaryKey: false, |
|||
field: "year_4", |
|||
autoIncrement: false |
|||
}, |
|||
spanCombination4: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "跨径组合4", |
|||
primaryKey: false, |
|||
field: "span_combination_4", |
|||
autoIncrement: false |
|||
}, |
|||
investment4: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "投资4", |
|||
primaryKey: false, |
|||
field: "investment_4", |
|||
autoIncrement: false |
|||
}, |
|||
year5: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "年份5", |
|||
primaryKey: false, |
|||
field: "year_5", |
|||
autoIncrement: false |
|||
}, |
|||
spanCombination5: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "跨径组合5", |
|||
primaryKey: false, |
|||
field: "span_combination_5", |
|||
autoIncrement: false |
|||
}, |
|||
investment5: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "投资5", |
|||
primaryKey: false, |
|||
field: "investment_5", |
|||
autoIncrement: false |
|||
}, |
|||
plannedFundCategory: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划资金类别", |
|||
primaryKey: false, |
|||
field: "planned_fund_category", |
|||
autoIncrement: false |
|||
}, |
|||
plannedYear: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划年度", |
|||
primaryKey: false, |
|||
field: "planned_year", |
|||
autoIncrement: false |
|||
}, |
|||
planDocumentNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划文号", |
|||
primaryKey: false, |
|||
field: "plan_document_no", |
|||
autoIncrement: false |
|||
}, |
|||
planItemUniqueCode: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划项目唯一编码", |
|||
primaryKey: false, |
|||
field: "plan_item_unique_code", |
|||
autoIncrement: false |
|||
}, |
|||
plannedProjectType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划项目类型", |
|||
primaryKey: false, |
|||
field: "planned_project_type", |
|||
autoIncrement: false |
|||
}, |
|||
planProjectName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划项目名称", |
|||
primaryKey: false, |
|||
field: "plan_project_name", |
|||
autoIncrement: false |
|||
}, |
|||
completionStatus: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "完工情况", |
|||
primaryKey: false, |
|||
field: "completion_status", |
|||
autoIncrement: false |
|||
}, |
|||
yearOfCompletion: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "完工年度", |
|||
primaryKey: false, |
|||
field: "year_of_completion", |
|||
autoIncrement: false |
|||
}, |
|||
reasonForChange: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "变更原因", |
|||
primaryKey: false, |
|||
field: "reason_for_change", |
|||
autoIncrement: false |
|||
}, |
|||
changeTime: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "变更时间", |
|||
primaryKey: false, |
|||
field: "change_time", |
|||
autoIncrement: false |
|||
}, |
|||
reportingUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "填报单位", |
|||
primaryKey: false, |
|||
field: "reporting_unit", |
|||
autoIncrement: false |
|||
}, |
|||
remarks: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "备注", |
|||
primaryKey: false, |
|||
field: "remarks", |
|||
autoIncrement: false |
|||
}, |
|||
whetherOverpassBridge: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否跨线桥", |
|||
primaryKey: false, |
|||
field: "whether_overpass_bridge", |
|||
autoIncrement: false |
|||
}, |
|||
offLineBridgeOrNot: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否线外桥", |
|||
primaryKey: false, |
|||
field: "off_line_bridge_or_not", |
|||
autoIncrement: false |
|||
}, |
|||
whetherDangerousBridgeReconstruction: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否危桥改造", |
|||
primaryKey: false, |
|||
field: "whether_dangerous_bridge_reconstruction", |
|||
autoIncrement: false |
|||
}, |
|||
districtcounty: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "所在区县", |
|||
primaryKey: false, |
|||
field: "districtcounty", |
|||
autoIncrement: false |
|||
}, |
|||
locationCity: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "所在地市", |
|||
primaryKey: false, |
|||
field: "location_city", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "bridge", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Bridge = Bridge; |
|||
return Bridge; |
|||
}; |
@ -0,0 +1,493 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const BusCar = sequelize.define("busCar", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "bus_car_id_uindex" |
|||
}, |
|||
company: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "所属公司", |
|||
primaryKey: false, |
|||
field: "company", |
|||
autoIncrement: false |
|||
}, |
|||
fleet: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "所属车队", |
|||
primaryKey: false, |
|||
field: "fleet", |
|||
autoIncrement: false |
|||
}, |
|||
line: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "所属线路", |
|||
primaryKey: false, |
|||
field: "line", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleNumber: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆编号", |
|||
primaryKey: false, |
|||
field: "vehicle_number", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleLicensePlateNumber: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆牌照号", |
|||
primaryKey: false, |
|||
field: "vehicle_license_plate_number", |
|||
autoIncrement: false |
|||
}, |
|||
operationCategory: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "运营类别", |
|||
primaryKey: false, |
|||
field: "operation_category", |
|||
autoIncrement: false |
|||
}, |
|||
serviceLife: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "已使用年限", |
|||
primaryKey: false, |
|||
field: "service_life", |
|||
autoIncrement: false |
|||
}, |
|||
engineModel: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "发动机型号", |
|||
primaryKey: false, |
|||
field: "engine_model", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleModel: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆型号", |
|||
primaryKey: false, |
|||
field: "vehicle_model", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleCategory: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆类别", |
|||
primaryKey: false, |
|||
field: "vehicle_category", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleStatus: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆状态", |
|||
primaryKey: false, |
|||
field: "vehicle_status", |
|||
autoIncrement: false |
|||
}, |
|||
dateOfEntry: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "入户日期", |
|||
primaryKey: false, |
|||
field: "date_of_entry", |
|||
autoIncrement: false |
|||
}, |
|||
purchaseDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "购进日期", |
|||
primaryKey: false, |
|||
field: "purchase_date", |
|||
autoIncrement: false |
|||
}, |
|||
energyConsumptionType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "能耗类型", |
|||
primaryKey: false, |
|||
field: "energy_consumption_type", |
|||
autoIncrement: false |
|||
}, |
|||
numberOfStandardUnits: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "标台数", |
|||
primaryKey: false, |
|||
field: "number_of_standard_units", |
|||
autoIncrement: false |
|||
}, |
|||
maintenanceUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "维保单位", |
|||
primaryKey: false, |
|||
field: "maintenance_unit", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆类型", |
|||
primaryKey: false, |
|||
field: "vehicle_type", |
|||
autoIncrement: false |
|||
}, |
|||
brandAndModel: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "厂牌型号", |
|||
primaryKey: false, |
|||
field: "brand_and_model", |
|||
autoIncrement: false |
|||
}, |
|||
manufacturer: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "生产厂家", |
|||
primaryKey: false, |
|||
field: "manufacturer", |
|||
autoIncrement: false |
|||
}, |
|||
drivingLicenseNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "行驶证编号", |
|||
primaryKey: false, |
|||
field: "driving_license_no", |
|||
autoIncrement: false |
|||
}, |
|||
engineNumber: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "发动机编号", |
|||
primaryKey: false, |
|||
field: "engine_number", |
|||
autoIncrement: false |
|||
}, |
|||
mainEnergyConsumption: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "主能耗", |
|||
primaryKey: false, |
|||
field: "main_energy_consumption", |
|||
autoIncrement: false |
|||
}, |
|||
secondaryEnergyConsumption: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "副能耗", |
|||
primaryKey: false, |
|||
field: "secondary_energy_consumption", |
|||
autoIncrement: false |
|||
}, |
|||
emissionStandard: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "排放标准", |
|||
primaryKey: false, |
|||
field: "emission_standard", |
|||
autoIncrement: false |
|||
}, |
|||
startDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "启用日期", |
|||
primaryKey: false, |
|||
field: "start_date", |
|||
autoIncrement: false |
|||
}, |
|||
lastTransferDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "最近一次调动日期", |
|||
primaryKey: false, |
|||
field: "last_transfer_date", |
|||
autoIncrement: false |
|||
}, |
|||
conductor: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车长", |
|||
primaryKey: false, |
|||
field: "conductor", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleWidth: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车宽", |
|||
primaryKey: false, |
|||
field: "vehicle_width", |
|||
autoIncrement: false |
|||
}, |
|||
carHeight: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车高", |
|||
primaryKey: false, |
|||
field: "car_height", |
|||
autoIncrement: false |
|||
}, |
|||
approvedPassengerCapacity: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "核定载客数", |
|||
primaryKey: false, |
|||
field: "approved_passenger_capacity", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleIdentificationNumber: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆识别号", |
|||
primaryKey: false, |
|||
field: "vehicle_identification_number", |
|||
autoIncrement: false |
|||
}, |
|||
gearboxBrand: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "变速箱品牌", |
|||
primaryKey: false, |
|||
field: "gearbox_brand", |
|||
autoIncrement: false |
|||
}, |
|||
manualCarWashingFee: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "人工洗车费", |
|||
primaryKey: false, |
|||
field: "manual_car_washing_fee", |
|||
autoIncrement: false |
|||
}, |
|||
laborCost: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "劳务费", |
|||
primaryKey: false, |
|||
field: "labor_cost", |
|||
autoIncrement: false |
|||
}, |
|||
curbWeight: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "整备质量", |
|||
primaryKey: false, |
|||
field: "curb_weight", |
|||
autoIncrement: false |
|||
}, |
|||
totalMass: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "总质量", |
|||
primaryKey: false, |
|||
field: "total_mass", |
|||
autoIncrement: false |
|||
}, |
|||
airConditioningTemperature: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "空调温度", |
|||
primaryKey: false, |
|||
field: "air_conditioning_temperature", |
|||
autoIncrement: false |
|||
}, |
|||
airConditionedCarOrNot: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否空调车", |
|||
primaryKey: false, |
|||
field: "air_conditioned_car_or_not", |
|||
autoIncrement: false |
|||
}, |
|||
turnOnTheAirConditioningTemperature: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "开空调温度", |
|||
primaryKey: false, |
|||
field: "turn_on_the_air_conditioning_temperature", |
|||
autoIncrement: false |
|||
}, |
|||
power: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "功率", |
|||
primaryKey: false, |
|||
field: "power", |
|||
autoIncrement: false |
|||
}, |
|||
transmission: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "变速器", |
|||
primaryKey: false, |
|||
field: "transmission", |
|||
autoIncrement: false |
|||
}, |
|||
seatingCapacity: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "座位数", |
|||
primaryKey: false, |
|||
field: "seating_capacity", |
|||
autoIncrement: false |
|||
}, |
|||
airConditioningBrand: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "空调品牌", |
|||
primaryKey: false, |
|||
field: "air_conditioning_brand", |
|||
autoIncrement: false |
|||
}, |
|||
seatType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "座椅类型", |
|||
primaryKey: false, |
|||
field: "seat_type", |
|||
autoIncrement: false |
|||
}, |
|||
tireSpecifications: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "轮胎规格", |
|||
primaryKey: false, |
|||
field: "tire_specifications", |
|||
autoIncrement: false |
|||
}, |
|||
roadTransportCertificateNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "道路运输证号", |
|||
primaryKey: false, |
|||
field: "road_transport_certificate_no", |
|||
autoIncrement: false |
|||
}, |
|||
parkingPoint: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "停放点", |
|||
primaryKey: false, |
|||
field: "parking_point", |
|||
autoIncrement: false |
|||
}, |
|||
carWashingType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "洗车类型", |
|||
primaryKey: false, |
|||
field: "car_washing_type", |
|||
autoIncrement: false |
|||
}, |
|||
maintenanceFreeWheelEnd: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "免维护轮端", |
|||
primaryKey: false, |
|||
field: "maintenance_free_wheel_end", |
|||
autoIncrement: false |
|||
}, |
|||
firstGuaranteeDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "首保日期", |
|||
primaryKey: false, |
|||
field: "first_guarantee_date", |
|||
autoIncrement: false |
|||
}, |
|||
dateOfRenovation: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "整修日期", |
|||
primaryKey: false, |
|||
field: "date_of_renovation", |
|||
autoIncrement: false |
|||
}, |
|||
motorVehicleOwner: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "机动车所有人", |
|||
primaryKey: false, |
|||
field: "motor_vehicle_owner", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "bus_car", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.BusCar = BusCar; |
|||
return BusCar; |
|||
}; |
@ -0,0 +1,232 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const BusLine = sequelize.define("busLine", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "bus_line_id_uindex" |
|||
}, |
|||
company: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "公司", |
|||
primaryKey: false, |
|||
field: "company", |
|||
autoIncrement: false |
|||
}, |
|||
fleet: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车队", |
|||
primaryKey: false, |
|||
field: "fleet", |
|||
autoIncrement: false |
|||
}, |
|||
carCaptain: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车队长", |
|||
primaryKey: false, |
|||
field: "car_captain", |
|||
autoIncrement: false |
|||
}, |
|||
assistantCarCaptain: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "副车队长", |
|||
primaryKey: false, |
|||
field: "assistant_car_captain", |
|||
autoIncrement: false |
|||
}, |
|||
officeLocation: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "办公地点", |
|||
primaryKey: false, |
|||
field: "office_location", |
|||
autoIncrement: false |
|||
}, |
|||
lineName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "线路名称", |
|||
primaryKey: false, |
|||
field: "line_name", |
|||
autoIncrement: false |
|||
}, |
|||
lineType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "线路类型", |
|||
primaryKey: false, |
|||
field: "line_type", |
|||
autoIncrement: false |
|||
}, |
|||
lineDivision: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "线路划分", |
|||
primaryKey: false, |
|||
field: "line_division", |
|||
autoIncrement: false |
|||
}, |
|||
gpsNumber: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "GPS编号", |
|||
primaryKey: false, |
|||
field: "gps_number", |
|||
autoIncrement: false |
|||
}, |
|||
startingPointEndPoint: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "起点终点", |
|||
primaryKey: false, |
|||
field: "starting_point_end_point", |
|||
autoIncrement: false |
|||
}, |
|||
numberOfVehicles: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆数", |
|||
primaryKey: false, |
|||
field: "number_of_vehicles", |
|||
autoIncrement: false |
|||
}, |
|||
totalKilometers: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "全程公里数", |
|||
primaryKey: false, |
|||
field: "total_kilometers", |
|||
autoIncrement: false |
|||
}, |
|||
ticketPrice: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "票价", |
|||
primaryKey: false, |
|||
field: "ticket_price", |
|||
autoIncrement: false |
|||
}, |
|||
openingTime: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "开通时间", |
|||
primaryKey: false, |
|||
field: "opening_time", |
|||
autoIncrement: false |
|||
}, |
|||
runningTime: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "运行时间", |
|||
primaryKey: false, |
|||
field: "running_time", |
|||
autoIncrement: false |
|||
}, |
|||
openingTimeSummer: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "开班时间夏令", |
|||
primaryKey: false, |
|||
field: "opening_time_summer", |
|||
autoIncrement: false |
|||
}, |
|||
shiftClosingTimeSummer: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "收班时间夏令", |
|||
primaryKey: false, |
|||
field: "shift_closing_time_summer", |
|||
autoIncrement: false |
|||
}, |
|||
openingTimeWinter: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "开班时间冬令", |
|||
primaryKey: false, |
|||
field: "opening_time_winter", |
|||
autoIncrement: false |
|||
}, |
|||
shiftClosingTimeWinter: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "收班时间冬令", |
|||
primaryKey: false, |
|||
field: "shift_closing_time_winter", |
|||
autoIncrement: false |
|||
}, |
|||
uplinkOfStationsAlongTheWay: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "沿途站点上行", |
|||
primaryKey: false, |
|||
field: "uplink_of_stations_along_the_way", |
|||
autoIncrement: false |
|||
}, |
|||
downlinkOfStationsAlongTheWay: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "沿途站点下行", |
|||
primaryKey: false, |
|||
field: "downlink_of_stations_along_the_way", |
|||
autoIncrement: false |
|||
}, |
|||
area: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "所属区域", |
|||
primaryKey: false, |
|||
field: "area", |
|||
autoIncrement: false |
|||
}, |
|||
remarks: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "备注", |
|||
primaryKey: false, |
|||
field: "remarks", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "bus_line", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.BusLine = BusLine; |
|||
return BusLine; |
|||
}; |
@ -0,0 +1,286 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const MunicipalBusiness = sequelize.define("municipalBusiness", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "municipal_business_id_uindex" |
|||
}, |
|||
nameOfBusinessOwner: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "业户名称", |
|||
primaryKey: false, |
|||
field: "name_of_business_owner", |
|||
autoIncrement: false |
|||
}, |
|||
productName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "品名", |
|||
primaryKey: false, |
|||
field: "product_name", |
|||
autoIncrement: false |
|||
}, |
|||
creditSocialCode: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "信用社会代码", |
|||
primaryKey: false, |
|||
field: "credit_social_code", |
|||
autoIncrement: false |
|||
}, |
|||
administrativeDivision: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "行政区划", |
|||
primaryKey: false, |
|||
field: "administrative_division", |
|||
autoIncrement: false |
|||
}, |
|||
economicNature: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经济性质", |
|||
primaryKey: false, |
|||
field: "economic_nature", |
|||
autoIncrement: false |
|||
}, |
|||
address: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "地址", |
|||
primaryKey: false, |
|||
field: "address", |
|||
autoIncrement: false |
|||
}, |
|||
contactNumber: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "联系电话", |
|||
primaryKey: false, |
|||
field: "contact_number", |
|||
autoIncrement: false |
|||
}, |
|||
email: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "电子邮箱", |
|||
primaryKey: false, |
|||
field: "email", |
|||
autoIncrement: false |
|||
}, |
|||
legalRepresentative: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "法定代表人", |
|||
primaryKey: false, |
|||
field: "legal_representative", |
|||
autoIncrement: false |
|||
}, |
|||
typeOfLegalPersonCertificate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "法人证件类型", |
|||
primaryKey: false, |
|||
field: "type_of_legal_person_certificate", |
|||
autoIncrement: false |
|||
}, |
|||
natureOfTransportation: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "运输性质", |
|||
primaryKey: false, |
|||
field: "nature_of_transportation", |
|||
autoIncrement: false |
|||
}, |
|||
legalPersonCertificateNumber: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "法人证件号码", |
|||
primaryKey: false, |
|||
field: "legal_person_certificate_number", |
|||
autoIncrement: false |
|||
}, |
|||
telephoneNumberOfLegalRepresentative: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "法定代表人电话", |
|||
primaryKey: false, |
|||
field: "telephone_number_of_legal_representative", |
|||
autoIncrement: false |
|||
}, |
|||
nameOfThePersonInChargeOfTheBusiness: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经营业户负责人姓名", |
|||
primaryKey: false, |
|||
field: "name_of_the_person_in_charge_of_the_business", |
|||
autoIncrement: false |
|||
}, |
|||
telephoneNumberOfThePersonInChargeOfTheBusiness: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经营业户负责人电话号码", |
|||
primaryKey: false, |
|||
field: "telephone_number_of_the_person_in_charge_of_the_business", |
|||
autoIncrement: false |
|||
}, |
|||
handledBy: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经办人", |
|||
primaryKey: false, |
|||
field: "handled_by", |
|||
autoIncrement: false |
|||
}, |
|||
phoneNumberOfHandler: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经办人电话", |
|||
primaryKey: false, |
|||
field: "phone_number_of_handler", |
|||
autoIncrement: false |
|||
}, |
|||
natureOfBusiness: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经营范围", |
|||
primaryKey: false, |
|||
field: "nature_of_business", |
|||
autoIncrement: false |
|||
}, |
|||
businessStatus: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经营状态", |
|||
primaryKey: false, |
|||
field: "business_status", |
|||
autoIncrement: false |
|||
}, |
|||
businessLicenseNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经营许可证号", |
|||
primaryKey: false, |
|||
field: "business_license_no", |
|||
autoIncrement: false |
|||
}, |
|||
fromTheExpiryDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "有效期起", |
|||
primaryKey: false, |
|||
field: "from_the_expiry_date", |
|||
autoIncrement: false |
|||
}, |
|||
expiryDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "有效期止", |
|||
primaryKey: false, |
|||
field: "expiry_date", |
|||
autoIncrement: false |
|||
}, |
|||
issuingAuthority: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "发证机构", |
|||
primaryKey: false, |
|||
field: "issuing_authority", |
|||
autoIncrement: false |
|||
}, |
|||
dateOfIssuance: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "核发日期", |
|||
primaryKey: false, |
|||
field: "date_of_issuance", |
|||
autoIncrement: false |
|||
}, |
|||
licenseCategory: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "证照类别", |
|||
primaryKey: false, |
|||
field: "license_category", |
|||
autoIncrement: false |
|||
}, |
|||
licenseIssuanceType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "证照发放类型", |
|||
primaryKey: false, |
|||
field: "license_issuance_type", |
|||
autoIncrement: false |
|||
}, |
|||
numberOfSharedVehicles: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "共有车辆数", |
|||
primaryKey: false, |
|||
field: "number_of_shared_vehicles", |
|||
autoIncrement: false |
|||
}, |
|||
creationDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "创建日期", |
|||
primaryKey: false, |
|||
field: "creation_date", |
|||
autoIncrement: false |
|||
}, |
|||
type: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "类型 出租车/危货", |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "municipal_business", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.MunicipalBusiness = MunicipalBusiness; |
|||
return MunicipalBusiness; |
|||
}; |
@ -0,0 +1,385 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const MunicipalVehicle = sequelize.define("municipalVehicle", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "municipal_vehicle_id_uindex" |
|||
}, |
|||
nameOfBusinessOwner: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "业户名称", |
|||
primaryKey: false, |
|||
field: "name_of_business_owner", |
|||
autoIncrement: false |
|||
}, |
|||
productName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "品名", |
|||
primaryKey: false, |
|||
field: "product_name", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleRegistry: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车籍地", |
|||
primaryKey: false, |
|||
field: "vehicle_registry", |
|||
autoIncrement: false |
|||
}, |
|||
licensePlateNumber: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车牌号", |
|||
primaryKey: false, |
|||
field: "license_plate_number", |
|||
autoIncrement: false |
|||
}, |
|||
fuelType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "燃料类型", |
|||
primaryKey: false, |
|||
field: "fuel_type", |
|||
autoIncrement: false |
|||
}, |
|||
address: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "住址", |
|||
primaryKey: false, |
|||
field: "address", |
|||
autoIncrement: false |
|||
}, |
|||
economicNature: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经济性质", |
|||
primaryKey: false, |
|||
field: "economic_nature", |
|||
autoIncrement: false |
|||
}, |
|||
approvedPassengerCapacity: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "核定载客位数", |
|||
primaryKey: false, |
|||
field: "approved_passenger_capacity", |
|||
autoIncrement: false |
|||
}, |
|||
approvedLoadMass: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "核定载质量", |
|||
primaryKey: false, |
|||
field: "approved_load_mass", |
|||
autoIncrement: false |
|||
}, |
|||
numberOfVehicleAxles: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆车轴数", |
|||
primaryKey: false, |
|||
field: "number_of_vehicle_axles", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleBrand: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆厂牌", |
|||
primaryKey: false, |
|||
field: "vehicle_brand", |
|||
autoIncrement: false |
|||
}, |
|||
natureOfBusiness: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经营范围", |
|||
primaryKey: false, |
|||
field: "nature_of_business", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleOperationStatus: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆营运状态", |
|||
primaryKey: false, |
|||
field: "vehicle_operation_status", |
|||
autoIncrement: false |
|||
}, |
|||
busTypeAndClass: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "客车类型与等级", |
|||
primaryKey: false, |
|||
field: "bus_type_and_class", |
|||
autoIncrement: false |
|||
}, |
|||
annualReviewResults: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "年审结果", |
|||
primaryKey: false, |
|||
field: "annual_review_results", |
|||
autoIncrement: false |
|||
}, |
|||
dateOfThisAnnualReview: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "本次年审日期", |
|||
primaryKey: false, |
|||
field: "date_of_this_annual_review", |
|||
autoIncrement: false |
|||
}, |
|||
dateOfNextAnnualReview: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "下次年审日期", |
|||
primaryKey: false, |
|||
field: "date_of_next_annual_review", |
|||
autoIncrement: false |
|||
}, |
|||
dateOfRegistration: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "注册登记日期", |
|||
primaryKey: false, |
|||
field: "date_of_registration", |
|||
autoIncrement: false |
|||
}, |
|||
sourceOfTransportationCapacity: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "运力来源", |
|||
primaryKey: false, |
|||
field: "source_of_transportation_capacity", |
|||
autoIncrement: false |
|||
}, |
|||
fromTheExpiryDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "有效期起", |
|||
primaryKey: false, |
|||
field: "from_the_expiry_date", |
|||
autoIncrement: false |
|||
}, |
|||
expiryDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "有效期止", |
|||
primaryKey: false, |
|||
field: "expiry_date", |
|||
autoIncrement: false |
|||
}, |
|||
engineDisplacement: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "发动机排量", |
|||
primaryKey: false, |
|||
field: "engine_displacement", |
|||
autoIncrement: false |
|||
}, |
|||
engineNumber: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "发动机号", |
|||
primaryKey: false, |
|||
field: "engine_number", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleEnginePower: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆发动机功率", |
|||
primaryKey: false, |
|||
field: "vehicle_engine_power", |
|||
autoIncrement: false |
|||
}, |
|||
businessLicenseNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经营许可证号", |
|||
primaryKey: false, |
|||
field: "business_license_no", |
|||
autoIncrement: false |
|||
}, |
|||
licensePlateColor: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车牌颜色", |
|||
primaryKey: false, |
|||
field: "license_plate_color", |
|||
autoIncrement: false |
|||
}, |
|||
totalVehicleMass: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆总质量", |
|||
primaryKey: false, |
|||
field: "total_vehicle_mass", |
|||
autoIncrement: false |
|||
}, |
|||
totalQuasiTractionMassOfVehicle: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆准牵引总质量", |
|||
primaryKey: false, |
|||
field: "total_quasi_traction_mass_of_vehicle", |
|||
autoIncrement: false |
|||
}, |
|||
roadTransportCertificateNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "道路运输证号", |
|||
primaryKey: false, |
|||
field: "road_transport_certificate_no", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleHeight: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆车高", |
|||
primaryKey: false, |
|||
field: "vehicle_height", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleConductor: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆车长", |
|||
primaryKey: false, |
|||
field: "vehicle_conductor", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleWidth: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆车宽", |
|||
primaryKey: false, |
|||
field: "vehicle_width", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆类型", |
|||
primaryKey: false, |
|||
field: "vehicle_type", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleTypeWithDrivingLicense: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "行驶证车辆类型", |
|||
primaryKey: false, |
|||
field: "vehicle_type_with_driving_license", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleWheelbase: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车辆轴距", |
|||
primaryKey: false, |
|||
field: "vehicle_wheelbase", |
|||
autoIncrement: false |
|||
}, |
|||
ratingDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "等级评定日期", |
|||
primaryKey: false, |
|||
field: "rating_date", |
|||
autoIncrement: false |
|||
}, |
|||
technicalEvaluationGrade: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "技术评定等级", |
|||
primaryKey: false, |
|||
field: "technical_evaluation_grade", |
|||
autoIncrement: false |
|||
}, |
|||
nextRatingDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "下次等级评定日期", |
|||
primaryKey: false, |
|||
field: "next_rating_date", |
|||
autoIncrement: false |
|||
}, |
|||
creationDate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "创建日期", |
|||
primaryKey: false, |
|||
field: "creation_date", |
|||
autoIncrement: false |
|||
}, |
|||
type: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "类型 出租车/危货", |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "municipal_vehicle", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.MunicipalVehicle = MunicipalVehicle; |
|||
return MunicipalVehicle; |
|||
}; |
@ -0,0 +1,187 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Overspeed = sequelize.define("overspeed", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "overspeed_id_uindex" |
|||
}, |
|||
districtcounty: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "区/县", |
|||
primaryKey: false, |
|||
field: "districtcounty", |
|||
autoIncrement: false |
|||
}, |
|||
nameOfInspectionPoint: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "检测点名称", |
|||
primaryKey: false, |
|||
field: "name_of_inspection_point", |
|||
autoIncrement: false |
|||
}, |
|||
licensePlate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车牌号码", |
|||
primaryKey: false, |
|||
field: "license_plate", |
|||
autoIncrement: false |
|||
}, |
|||
numberOfAxles: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车轴数", |
|||
primaryKey: false, |
|||
field: "number_of_axles", |
|||
autoIncrement: false |
|||
}, |
|||
overrunRate: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "超限率", |
|||
primaryKey: false, |
|||
field: "overrun_rate", |
|||
autoIncrement: false |
|||
}, |
|||
overrunWeight: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "超限重量", |
|||
primaryKey: false, |
|||
field: "overrun_weight", |
|||
autoIncrement: false |
|||
}, |
|||
grossVehicleWeight: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车货总重", |
|||
primaryKey: false, |
|||
field: "gross_vehicle_weight", |
|||
autoIncrement: false |
|||
}, |
|||
vehicleCargoWeightLimit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车货限重", |
|||
primaryKey: false, |
|||
field: "vehicle_cargo_weight_limit", |
|||
autoIncrement: false |
|||
}, |
|||
testTime: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "检测时间", |
|||
primaryKey: false, |
|||
field: "test_time", |
|||
autoIncrement: false |
|||
}, |
|||
nameOfBusinessOwner: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经营业户名称", |
|||
primaryKey: false, |
|||
field: "name_of_business_owner", |
|||
autoIncrement: false |
|||
}, |
|||
businessAddress: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经营业户地址", |
|||
primaryKey: false, |
|||
field: "business_address", |
|||
autoIncrement: false |
|||
}, |
|||
notifier: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "通知人", |
|||
primaryKey: false, |
|||
field: "notifier", |
|||
autoIncrement: false |
|||
}, |
|||
notificationMethod: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "通知方式", |
|||
primaryKey: false, |
|||
field: "notification_method", |
|||
autoIncrement: false |
|||
}, |
|||
notificationResults: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "通知结果", |
|||
primaryKey: false, |
|||
field: "notification_results", |
|||
autoIncrement: false |
|||
}, |
|||
processingTime: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "处理时间", |
|||
primaryKey: false, |
|||
field: "processing_time", |
|||
autoIncrement: false |
|||
}, |
|||
deductPoints: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "扣分", |
|||
primaryKey: false, |
|||
field: "deduct_points", |
|||
autoIncrement: false |
|||
}, |
|||
fine: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "罚款", |
|||
primaryKey: false, |
|||
field: "fine", |
|||
autoIncrement: false |
|||
}, |
|||
remarks: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "备注", |
|||
primaryKey: false, |
|||
field: "remarks", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "overspeed", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Overspeed = Overspeed; |
|||
return Overspeed; |
|||
}; |
@ -1,61 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Places = sequelize.define("places", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "places_id_uindex" |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "场所名称", |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
describe: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "描述", |
|||
primaryKey: false, |
|||
field: "describe", |
|||
autoIncrement: false |
|||
}, |
|||
userId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "userId", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "user" |
|||
} |
|||
}, |
|||
}, { |
|||
tableName: "places", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Places = Places; |
|||
|
|||
const User = dc.models.User; |
|||
Places.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); |
|||
User.hasMany(Places, { foreignKey: 'userId', sourceKey: 'id' }); |
|||
|
|||
return Places; |
|||
}; |
@ -1,51 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const PostResource = sequelize.define("postResource", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "post_resource_id_uindex" |
|||
}, |
|||
postId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "post_id", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "post" |
|||
} |
|||
}, |
|||
resource: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "resource", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "code", |
|||
model: "resource" |
|||
} |
|||
} |
|||
}, { |
|||
tableName: "post_resource", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.PostResource = PostResource; |
|||
return PostResource; |
|||
}; |
@ -0,0 +1,124 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Project = sequelize.define("project", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "project_id_uindex" |
|||
}, |
|||
entryName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "项目名称", |
|||
primaryKey: false, |
|||
field: "entry_name", |
|||
autoIncrement: false |
|||
}, |
|||
projectMileage: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "工程里程", |
|||
primaryKey: false, |
|||
field: "project_mileage", |
|||
autoIncrement: false |
|||
}, |
|||
investment: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "投资", |
|||
primaryKey: false, |
|||
field: "investment", |
|||
autoIncrement: false |
|||
}, |
|||
buildUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "建设单位", |
|||
primaryKey: false, |
|||
field: "build_unit", |
|||
autoIncrement: false |
|||
}, |
|||
constructionControlUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "监理单位", |
|||
primaryKey: false, |
|||
field: "construction_control_unit", |
|||
autoIncrement: false |
|||
}, |
|||
designUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "设计单位", |
|||
primaryKey: false, |
|||
field: "design_unit", |
|||
autoIncrement: false |
|||
}, |
|||
constructionUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "施工单位", |
|||
primaryKey: false, |
|||
field: "construction_unit", |
|||
autoIncrement: false |
|||
}, |
|||
supervisorAndSupervisor: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "监督负责人及监督人员", |
|||
primaryKey: false, |
|||
field: "supervisor_and_supervisor", |
|||
autoIncrement: false |
|||
}, |
|||
projectProgress: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "项目进展情况", |
|||
primaryKey: false, |
|||
field: "project_progress", |
|||
autoIncrement: false |
|||
}, |
|||
done: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "done", |
|||
autoIncrement: false |
|||
}, |
|||
type: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "类型 道路:road / 桥梁:bridge", |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "project", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Project = Project; |
|||
return Project; |
|||
}; |
@ -0,0 +1,52 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Publicity = sequelize.define("publicity", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "publicity_id_uindex" |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
video: { |
|||
type: DataTypes.ARRAY(DataTypes.INTEGER), |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "video", |
|||
autoIncrement: false |
|||
}, |
|||
enable: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: false, |
|||
defaultValue: true, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "enable", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "publicity", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Publicity = Publicity; |
|||
return Publicity; |
|||
}; |
@ -1,34 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const RegionType = sequelize.define("regionType", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "region_type_id_uindex" |
|||
}, |
|||
type: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "region_type", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.RegionType = RegionType; |
|||
return RegionType; |
|||
}; |
@ -0,0 +1,160 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Report = sequelize.define("report", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "report_id_uindex" |
|||
}, |
|||
reportType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "上报类型 巡查:patrol / 养护:conserve", |
|||
primaryKey: false, |
|||
field: "report_type", |
|||
autoIncrement: false |
|||
}, |
|||
projectType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "工程类型 道路:road / 桥梁:birdge / 涵洞:culvert", |
|||
primaryKey: false, |
|||
field: "project_type", |
|||
autoIncrement: false |
|||
}, |
|||
road: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "road", |
|||
autoIncrement: false |
|||
}, |
|||
roadSectionStart: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "road_section_start", |
|||
autoIncrement: false |
|||
}, |
|||
roadSectionEnd: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "road_section_end", |
|||
autoIncrement: false |
|||
}, |
|||
longitude: { |
|||
type: DataTypes.DOUBLE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "longitude", |
|||
autoIncrement: false |
|||
}, |
|||
latitude: { |
|||
type: DataTypes.DOUBLE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "latitude", |
|||
autoIncrement: false |
|||
}, |
|||
content: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "content", |
|||
autoIncrement: false |
|||
}, |
|||
scenePic: { |
|||
type: DataTypes.ARRAY(DataTypes.STRING), |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "scene_pic", |
|||
autoIncrement: false |
|||
}, |
|||
conserveBeforePic: { |
|||
type: DataTypes.ARRAY(DataTypes.STRING), |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "conserve_before_pic", |
|||
autoIncrement: false |
|||
}, |
|||
conserveUnderwayPic: { |
|||
type: DataTypes.ARRAY(DataTypes.STRING), |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "conserve_underway_pic", |
|||
autoIncrement: false |
|||
}, |
|||
conserveAfterPic: { |
|||
type: DataTypes.ARRAY(DataTypes.STRING), |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "conserve_after_pic", |
|||
autoIncrement: false |
|||
}, |
|||
userId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "user_id", |
|||
autoIncrement: false |
|||
}, |
|||
time: { |
|||
type: DataTypes.DATE, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "time", |
|||
autoIncrement: false |
|||
}, |
|||
address: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "address", |
|||
autoIncrement: false |
|||
}, |
|||
}, { |
|||
tableName: "report", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Report = Report; |
|||
return Report; |
|||
}; |
@ -1,88 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const ReportCollection = sequelize.define("reportCollection", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "report_collection_id_uindex" |
|||
}, |
|||
regionId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "县区(id)", |
|||
primaryKey: false, |
|||
field: "regionId", |
|||
autoIncrement: false |
|||
}, |
|||
dateTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "dateTime", |
|||
autoIncrement: false |
|||
}, |
|||
placeCount: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "场所总数", |
|||
primaryKey: false, |
|||
field: "placeCount", |
|||
autoIncrement: false |
|||
}, |
|||
hiddenDangerCount: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "排查隐患总数", |
|||
primaryKey: false, |
|||
field: "hiddenDangerCount", |
|||
autoIncrement: false |
|||
}, |
|||
hiddenDangerItem12Count: { |
|||
type: DataTypes.JSON, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "排查隐患详细类目 1-12 项 总数", |
|||
primaryKey: false, |
|||
field: "hiddenDangerItem12Count", |
|||
autoIncrement: false |
|||
}, |
|||
userId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "填报人(县区联络员)", |
|||
primaryKey: false, |
|||
field: "userId", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "report_collection", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.ReportCollection = ReportCollection; |
|||
|
|||
const User = dc.models.User; |
|||
ReportCollection.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); |
|||
User.hasMany(ReportCollection, { foreignKey: 'userId', sourceKey: 'id' }); |
|||
|
|||
const Department = dc.models.Department; |
|||
ReportCollection.belongsTo(Department, { foreignKey: 'regionId', targetKey: 'id' }); |
|||
Department.hasMany(ReportCollection, { foreignKey: 'regionId', sourceKey: 'id' }); |
|||
|
|||
return ReportCollection; |
|||
}; |
@ -1,74 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const ReportConfigition = sequelize.define("reportConfigition", { |
|||
reportName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "报表名称", |
|||
primaryKey: false, |
|||
field: "reportName", |
|||
autoIncrement: false |
|||
}, |
|||
regionId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "区域id", |
|||
primaryKey: false, |
|||
field: "regionId", |
|||
autoIncrement: false |
|||
}, |
|||
reportTypeId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "报表类型", |
|||
primaryKey: false, |
|||
field: "reportTypeId", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "reportType" |
|||
} |
|||
}, |
|||
excuteTime: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "生成时间 cron表达式", |
|||
primaryKey: false, |
|||
field: "excuteTime", |
|||
autoIncrement: false |
|||
}, |
|||
isEnable: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "启用状态", |
|||
primaryKey: false, |
|||
field: "isEnable", |
|||
autoIncrement: false |
|||
}, |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "序号", |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "report_configition_id_uindex" |
|||
} |
|||
}, { |
|||
tableName: "report_configition", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.ReportConfigition = ReportConfigition; |
|||
return ReportConfigition; |
|||
}; |
@ -1,69 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const ReportCountyCollect = sequelize.define("reportCountyCollect", { |
|||
id: { |
|||
type: DataTypes.BIGINT, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "序号", |
|||
primaryKey: false, |
|||
field: "id", |
|||
autoIncrement: false |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "名称", |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
address: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "地址", |
|||
primaryKey: false, |
|||
field: "address", |
|||
autoIncrement: false |
|||
}, |
|||
hiddenDanger: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "排查发现隐患", |
|||
primaryKey: false, |
|||
field: "hiddenDanger", |
|||
autoIncrement: false |
|||
}, |
|||
correctiveAction: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "采取措施", |
|||
primaryKey: false, |
|||
field: "correctiveAction", |
|||
autoIncrement: false |
|||
}, |
|||
punishment: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "实施处罚,强制措施情况", |
|||
primaryKey: false, |
|||
field: "punishment", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "report_countyCollect", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.ReportCountyCollect = ReportCountyCollect; |
|||
return ReportCountyCollect; |
|||
}; |
@ -1,82 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const ReportDownManage = sequelize.define("reportDownManage", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: "nextval(\"report_downManage_id_seq\"::regclass)", |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: false, |
|||
unique: "report_downmanage_id_uindex" |
|||
}, |
|||
reportName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "报表名称", |
|||
primaryKey: false, |
|||
field: "reportName", |
|||
autoIncrement: false |
|||
}, |
|||
regionId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "区域id", |
|||
primaryKey: false, |
|||
field: "regionId", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "department" |
|||
} |
|||
}, |
|||
reportTypeId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "报表类型id\n1.整治表\n2.汇总表", |
|||
primaryKey: false, |
|||
field: "reportTypeId", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "reportType" |
|||
} |
|||
}, |
|||
filePath: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "文件路径", |
|||
primaryKey: false, |
|||
field: "filePath", |
|||
autoIncrement: false, |
|||
}, |
|||
creatTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "creatTime", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "report_downManage", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.ReportDownManage = ReportDownManage; |
|||
|
|||
const { ReportType, Department } = dc.models; |
|||
ReportDownManage.belongsTo(ReportType, { foreignKey: 'reportTypeId', targetKey: 'id' }); |
|||
ReportDownManage.belongsTo(Department, { foreignKey: 'regionId', targetKey: 'id' }); |
|||
return ReportDownManage; |
|||
}; |
@ -1,115 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const ReportRectify = sequelize.define("reportRectify", { |
|||
id: { |
|||
type: DataTypes.BIGINT, |
|||
allowNull: true, |
|||
defaultValue: "nextval(\"report_countyCollect_id_seq\"::regclass)", |
|||
comment: "序号", |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: false, |
|||
unique: "report_countycollect_id_uindex" |
|||
}, |
|||
regionId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "县区(id)", |
|||
primaryKey: false, |
|||
field: "regionId", |
|||
autoIncrement: false |
|||
}, |
|||
dateTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "dateTime", |
|||
autoIncrement: false |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "名称", |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
address: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "地址", |
|||
primaryKey: false, |
|||
field: "address", |
|||
autoIncrement: false |
|||
}, |
|||
hiddenDanger: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "排查发现隐患", |
|||
primaryKey: false, |
|||
field: "hiddenDanger", |
|||
autoIncrement: false |
|||
}, |
|||
correctiveAction: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "采取措施", |
|||
primaryKey: false, |
|||
field: "correctiveAction", |
|||
autoIncrement: false |
|||
}, |
|||
punishment: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "实施处罚,强制措施情况", |
|||
primaryKey: false, |
|||
field: "punishment", |
|||
autoIncrement: false |
|||
}, |
|||
userId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "web端上报", |
|||
primaryKey: false, |
|||
field: "userId", |
|||
autoIncrement: false |
|||
}, |
|||
isAudit: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "市级 确认审核", |
|||
primaryKey: false, |
|||
field: "isAudit", |
|||
autoIncrement: false |
|||
}, |
|||
}, { |
|||
tableName: "report_rectify", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.ReportRectify = ReportRectify; |
|||
|
|||
const User = dc.models.User; |
|||
ReportRectify.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); |
|||
User.hasMany(ReportRectify, { foreignKey: 'userId', sourceKey: 'id' }); |
|||
|
|||
const Department = dc.models.Department; |
|||
ReportRectify.belongsTo(Department, { foreignKey: 'regionId', targetKey: 'id' }); |
|||
Department.hasMany(ReportRectify, { foreignKey: 'regionId', sourceKey: 'id' }); |
|||
|
|||
return ReportRectify; |
|||
}; |
@ -1,33 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const ReportType = sequelize.define("reportType", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: false |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "report_type", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.ReportType = ReportType; |
|||
return ReportType; |
|||
}; |
@ -1,44 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Resource = sequelize.define("resource", { |
|||
code: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "code", |
|||
autoIncrement: false, |
|||
unique: "resource_code_uindex" |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false, |
|||
unique: "resource_name_uindex" |
|||
}, |
|||
parentResource: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "parent_resource", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "resource", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Resource = Resource; |
|||
return Resource; |
|||
}; |
@ -0,0 +1,709 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Road = sequelize.define("road", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "road_id_uindex" |
|||
}, |
|||
routeName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "路线名称", |
|||
primaryKey: false, |
|||
field: "route_name", |
|||
autoIncrement: false |
|||
}, |
|||
routeCode: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "路线代码", |
|||
primaryKey: false, |
|||
field: "route_code", |
|||
autoIncrement: false |
|||
}, |
|||
sectionNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "路段序号", |
|||
primaryKey: false, |
|||
field: "section_no", |
|||
autoIncrement: false |
|||
}, |
|||
townshipCode: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "乡镇编码", |
|||
primaryKey: false, |
|||
field: "township_code", |
|||
autoIncrement: false |
|||
}, |
|||
startingPlaceName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "起点地名", |
|||
primaryKey: false, |
|||
field: "starting_place_name", |
|||
autoIncrement: false |
|||
}, |
|||
startStation: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "起点桩号", |
|||
primaryKey: false, |
|||
field: "start_station", |
|||
autoIncrement: false |
|||
}, |
|||
categoryOfStartingPointAndDividingPoint: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "起点分界点类别", |
|||
primaryKey: false, |
|||
field: "category_of_starting_point_and_dividing_point", |
|||
autoIncrement: false |
|||
}, |
|||
stopPlaceName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "止点地名", |
|||
primaryKey: false, |
|||
field: "stop_place_name", |
|||
autoIncrement: false |
|||
}, |
|||
categoryOfDeadCenterAndDividingPoint: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "止点分界点类别", |
|||
primaryKey: false, |
|||
field: "category_of_dead_center_and_dividing_point", |
|||
autoIncrement: false |
|||
}, |
|||
stopStation: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "止点桩号", |
|||
primaryKey: false, |
|||
field: "stop_station", |
|||
autoIncrement: false |
|||
}, |
|||
sectionType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "路段类型", |
|||
primaryKey: false, |
|||
field: "section_type", |
|||
autoIncrement: false |
|||
}, |
|||
routeCodeBeforeRoadNetworkAdjustment: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "路网调整前路线编码", |
|||
primaryKey: false, |
|||
field: "route_code_before_road_network_adjustment", |
|||
autoIncrement: false |
|||
}, |
|||
serialNumberOfOriginalSection: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "原路段序号", |
|||
primaryKey: false, |
|||
field: "serial_number_of_original_section", |
|||
autoIncrement: false |
|||
}, |
|||
startingStakeNumberOfTheOriginalRoadSection: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "原路段起点桩号", |
|||
primaryKey: false, |
|||
field: "starting_stake_number_of_the_original_road_section", |
|||
autoIncrement: false |
|||
}, |
|||
endingPointStakeNoOfTheOriginalRoadSection: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "原路段止点桩号", |
|||
primaryKey: false, |
|||
field: "ending_point_stake_no_of_the_original_road_section", |
|||
autoIncrement: false |
|||
}, |
|||
routeLevel: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "路线等级", |
|||
primaryKey: false, |
|||
field: "route_level", |
|||
autoIncrement: false |
|||
}, |
|||
natureOfRoadSection: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "路段性质", |
|||
primaryKey: false, |
|||
field: "nature_of_road_section", |
|||
autoIncrement: false |
|||
}, |
|||
completionTime: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "建成时间", |
|||
primaryKey: false, |
|||
field: "completion_time", |
|||
autoIncrement: false |
|||
}, |
|||
reconstructionTime: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "改建时间", |
|||
primaryKey: false, |
|||
field: "reconstruction_time", |
|||
autoIncrement: false |
|||
}, |
|||
natureOfConstruction: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "建设性质", |
|||
primaryKey: false, |
|||
field: "nature_of_construction", |
|||
autoIncrement: false |
|||
}, |
|||
gbmAndCivilizedModelRoad: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "GBM及文明样板路", |
|||
primaryKey: false, |
|||
field: "gbm_and_civilized_model_road", |
|||
autoIncrement: false |
|||
}, |
|||
landforms: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "地貌", |
|||
primaryKey: false, |
|||
field: "landforms", |
|||
autoIncrement: false |
|||
}, |
|||
natureOfCharges: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "收费性质", |
|||
primaryKey: false, |
|||
field: "nature_of_charges", |
|||
autoIncrement: false |
|||
}, |
|||
tollStation: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "所属收费站", |
|||
primaryKey: false, |
|||
field: "toll_station", |
|||
autoIncrement: false |
|||
}, |
|||
numberOfCulverts: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "涵洞数量", |
|||
primaryKey: false, |
|||
field: "number_of_culverts", |
|||
autoIncrement: false |
|||
}, |
|||
technicalLevel: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "技术等级", |
|||
primaryKey: false, |
|||
field: "technical_level", |
|||
autoIncrement: false |
|||
}, |
|||
pavementType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "路面类型", |
|||
primaryKey: false, |
|||
field: "pavement_type", |
|||
autoIncrement: false |
|||
}, |
|||
pavementWidth: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "路面宽度", |
|||
primaryKey: false, |
|||
field: "pavement_width", |
|||
autoIncrement: false |
|||
}, |
|||
subgradeWidth: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "路基宽度", |
|||
primaryKey: false, |
|||
field: "subgrade_width", |
|||
autoIncrement: false |
|||
}, |
|||
laneCharacteristics: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "车道特征", |
|||
primaryKey: false, |
|||
field: "lane_characteristics", |
|||
autoIncrement: false |
|||
}, |
|||
whetherItIsOpenToTrafficInSunnyOrRainyDays: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否晴雨通车", |
|||
primaryKey: false, |
|||
field: "whether_it_is_open_to_traffic_in_sunny_or_rainy_days", |
|||
autoIncrement: false |
|||
}, |
|||
designSpeedPerHour: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "设计时速", |
|||
primaryKey: false, |
|||
field: "design_speed_per_hour", |
|||
autoIncrement: false |
|||
}, |
|||
urbanManagementSectionOrNot: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否城管路段", |
|||
primaryKey: false, |
|||
field: "urban_management_section_or_not", |
|||
autoIncrement: false |
|||
}, |
|||
managementAndMaintenanceUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "管养单位", |
|||
primaryKey: false, |
|||
field: "management_and_maintenance_unit", |
|||
autoIncrement: false |
|||
}, |
|||
roadAdministrationUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "路政管理单位", |
|||
primaryKey: false, |
|||
field: "road_administration_unit", |
|||
autoIncrement: false |
|||
}, |
|||
alimentation: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "列养情况", |
|||
primaryKey: false, |
|||
field: "alimentation", |
|||
autoIncrement: false |
|||
}, |
|||
sourceOfListedMaintenanceFunds: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "列养资金来源", |
|||
primaryKey: false, |
|||
field: "source_of_listed_maintenance_funds", |
|||
autoIncrement: false |
|||
}, |
|||
curingTime: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "养护时间", |
|||
primaryKey: false, |
|||
field: "curing_time", |
|||
autoIncrement: false |
|||
}, |
|||
greeningMileage: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "可绿化里程", |
|||
primaryKey: false, |
|||
field: "greening_mileage", |
|||
autoIncrement: false |
|||
}, |
|||
greeningMileaged: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "已绿化里程", |
|||
primaryKey: false, |
|||
field: "greening_mileaged", |
|||
autoIncrement: false |
|||
}, |
|||
typeOfRepeatedRoadSection: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "重复道路路段类型", |
|||
primaryKey: false, |
|||
field: "type_of_repeated_road_section", |
|||
autoIncrement: false |
|||
}, |
|||
serialNumberOfRepeatedSection: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "重复路段序号", |
|||
primaryKey: false, |
|||
field: "serial_number_of_repeated_section", |
|||
autoIncrement: false |
|||
}, |
|||
repeatedSectionRouteCode: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "重复路段路线编码", |
|||
primaryKey: false, |
|||
field: "repeated_section_route_code", |
|||
autoIncrement: false |
|||
}, |
|||
plannedFundCategory: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划资金类别", |
|||
primaryKey: false, |
|||
field: "planned_fund_category", |
|||
autoIncrement: false |
|||
}, |
|||
plannedYear: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划年度", |
|||
primaryKey: false, |
|||
field: "planned_year", |
|||
autoIncrement: false |
|||
}, |
|||
planDocumentNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划文号", |
|||
primaryKey: false, |
|||
field: "plan_document_no", |
|||
autoIncrement: false |
|||
}, |
|||
planItemUniqueCode: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划项目唯一编码", |
|||
primaryKey: false, |
|||
field: "plan_item_unique_code", |
|||
autoIncrement: false |
|||
}, |
|||
plannedProjectRouteCode: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划项目路线编码", |
|||
primaryKey: false, |
|||
field: "planned_project_route_code", |
|||
autoIncrement: false |
|||
}, |
|||
planProjectName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划项目名称", |
|||
primaryKey: false, |
|||
field: "plan_project_name", |
|||
autoIncrement: false |
|||
}, |
|||
plannedProjectType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划项目类型", |
|||
primaryKey: false, |
|||
field: "planned_project_type", |
|||
autoIncrement: false |
|||
}, |
|||
completionStatus: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "完工情况", |
|||
primaryKey: false, |
|||
field: "completion_status", |
|||
autoIncrement: false |
|||
}, |
|||
yearOfCompletion: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "完工年度", |
|||
primaryKey: false, |
|||
field: "year_of_completion", |
|||
autoIncrement: false |
|||
}, |
|||
plannedFundCategoryOne: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划资金类别_1", |
|||
primaryKey: false, |
|||
field: "planned_fund_category__one", |
|||
autoIncrement: false |
|||
}, |
|||
plannedYearOne: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划年度_1", |
|||
primaryKey: false, |
|||
field: "planned_year__one", |
|||
autoIncrement: false |
|||
}, |
|||
planDocumentNoOne: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划文号_1", |
|||
primaryKey: false, |
|||
field: "plan_document_no__one", |
|||
autoIncrement: false |
|||
}, |
|||
planItemUniqueCodeOne: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划项目唯一编码_1", |
|||
primaryKey: false, |
|||
field: "plan_item_unique_code__one", |
|||
autoIncrement: false |
|||
}, |
|||
planProjectNameOne: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计划项目名称_1", |
|||
primaryKey: false, |
|||
field: "plan_project_name__one", |
|||
autoIncrement: false |
|||
}, |
|||
completionStatusOne: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "完工情况_1", |
|||
primaryKey: false, |
|||
field: "completion_status__one", |
|||
autoIncrement: false |
|||
}, |
|||
yearOfCompletionOne: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "完工年度_1", |
|||
primaryKey: false, |
|||
field: "year_of_completion__one", |
|||
autoIncrement: false |
|||
}, |
|||
stationRange: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桩号范围", |
|||
primaryKey: false, |
|||
field: "station_range", |
|||
autoIncrement: false |
|||
}, |
|||
reportingUnit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "填报单位", |
|||
primaryKey: false, |
|||
field: "reporting_unit", |
|||
autoIncrement: false |
|||
}, |
|||
reasonForChange: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "变更原因", |
|||
primaryKey: false, |
|||
field: "reason_for_change", |
|||
autoIncrement: false |
|||
}, |
|||
changeTime: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "变更时间", |
|||
primaryKey: false, |
|||
field: "change_time", |
|||
autoIncrement: false |
|||
}, |
|||
lastRepairAndMaintenanceYear: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "最近一次修复养护年度", |
|||
primaryKey: false, |
|||
field: "last_repair_and_maintenance_year", |
|||
autoIncrement: false |
|||
}, |
|||
whetherMaintenanceManagedHighway: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否按干线公路管理接养", |
|||
primaryKey: false, |
|||
field: "whether_maintenance_managed_highway", |
|||
autoIncrement: false |
|||
}, |
|||
remarks: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "备注", |
|||
primaryKey: false, |
|||
field: "remarks", |
|||
autoIncrement: false |
|||
}, |
|||
routeCodeOfLastYear: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "上年路线编码", |
|||
primaryKey: false, |
|||
field: "route_code_of_last_year", |
|||
autoIncrement: false |
|||
}, |
|||
routeNameOfLastYear: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "上年路线名称", |
|||
primaryKey: false, |
|||
field: "route_name_of_last_year", |
|||
autoIncrement: false |
|||
}, |
|||
startingStationOfLastYear: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "上年起点桩号", |
|||
primaryKey: false, |
|||
field: "starting_station_of_last_year", |
|||
autoIncrement: false |
|||
}, |
|||
lastYearsEndingPointStakeNumber: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "上年止点桩号", |
|||
primaryKey: false, |
|||
field: "last_years_ending_point_stake_number", |
|||
autoIncrement: false |
|||
}, |
|||
graphicMileage: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "图形里程", |
|||
primaryKey: false, |
|||
field: "graphic_mileage", |
|||
autoIncrement: false |
|||
}, |
|||
chainageMileage: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "桩号里程", |
|||
primaryKey: false, |
|||
field: "chainage_mileage", |
|||
autoIncrement: false |
|||
}, |
|||
districtcounty: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "所在区县", |
|||
primaryKey: false, |
|||
field: "districtcounty", |
|||
autoIncrement: false |
|||
}, |
|||
locationCity: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "所在地市", |
|||
primaryKey: false, |
|||
field: "location_city", |
|||
autoIncrement: false |
|||
}, |
|||
level: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "level", |
|||
autoIncrement: false |
|||
}, |
|||
surfaceThickness: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "面层厚度", |
|||
primaryKey: false, |
|||
field: "surface_thickness", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "road", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Road = Road; |
|||
return Road; |
|||
}; |
@ -1,311 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const UserPlaceSecurityRecord = sequelize.define("userPlaceSecurityRecord", { |
|||
id: { |
|||
type: DataTypes.BIGINT, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "id", |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "user_placesecurityrecord_id_uindex" |
|||
}, |
|||
time: { |
|||
type: DataTypes.DATE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "录入时间", |
|||
primaryKey: false, |
|||
field: "time", |
|||
autoIncrement: false |
|||
}, |
|||
placeId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "场所id", |
|||
primaryKey: false, |
|||
field: "placeId", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "places" |
|||
} |
|||
}, |
|||
hiddenDangerItem12: { |
|||
type: DataTypes.JSON, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "12项隐患信息", |
|||
primaryKey: false, |
|||
field: "hiddenDangerItem12", |
|||
autoIncrement: false |
|||
}, |
|||
description: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "存在具体问题描述", |
|||
primaryKey: false, |
|||
field: "description", |
|||
autoIncrement: false |
|||
}, |
|||
audit1ManId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "乡镇人审核", |
|||
primaryKey: false, |
|||
field: "audit1ManId", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "user" |
|||
} |
|||
}, |
|||
audit2ManId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "区县人复核", |
|||
primaryKey: false, |
|||
field: "audit2ManId", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "user" |
|||
} |
|||
}, |
|||
regionId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "所属县/区", |
|||
primaryKey: false, |
|||
field: "regionId", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "department" |
|||
} |
|||
}, |
|||
userId: { |
|||
type: DataTypes.BIGINT, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "用户id,填报人", |
|||
primaryKey: false, |
|||
field: "userId", |
|||
autoIncrement: false |
|||
}, |
|||
placeType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "场所性质", |
|||
primaryKey: false, |
|||
field: "placeType", |
|||
autoIncrement: false |
|||
}, |
|||
address: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "场所地址", |
|||
primaryKey: false, |
|||
field: "address", |
|||
autoIncrement: false |
|||
}, |
|||
phone: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "负责人手机号", |
|||
primaryKey: false, |
|||
field: "phone", |
|||
autoIncrement: false |
|||
}, |
|||
dimension: { |
|||
type: DataTypes.REAL, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "面积", |
|||
primaryKey: false, |
|||
field: "dimension", |
|||
autoIncrement: false |
|||
}, |
|||
floors: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "多少层", |
|||
primaryKey: false, |
|||
field: "floors", |
|||
autoIncrement: false |
|||
}, |
|||
numberOfPeople: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "常住人数", |
|||
primaryKey: false, |
|||
field: "numberOfPeople", |
|||
autoIncrement: false |
|||
}, |
|||
location: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经纬度", |
|||
primaryKey: false, |
|||
field: "location", |
|||
autoIncrement: false |
|||
}, |
|||
isEnable: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否为合用场所", |
|||
primaryKey: false, |
|||
field: "isEnable", |
|||
autoIncrement: false |
|||
}, |
|||
rejectManId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "驳回人", |
|||
primaryKey: false, |
|||
field: "rejectManId", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "user" |
|||
} |
|||
}, |
|||
rejectReasons: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "驳回意见", |
|||
primaryKey: false, |
|||
field: "rejectReasons", |
|||
autoIncrement: false |
|||
}, |
|||
isDraft: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否草稿", |
|||
primaryKey: false, |
|||
field: "isDraft", |
|||
autoIncrement: false |
|||
}, |
|||
placeOwner: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "场所负责人", |
|||
primaryKey: false, |
|||
field: "placeOwner", |
|||
autoIncrement: false |
|||
}, |
|||
localtionDescribe: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "经纬度定位描述", |
|||
primaryKey: false, |
|||
field: "localtionDescribe", |
|||
autoIncrement: false |
|||
}, |
|||
correctiveAction: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "采取措施", |
|||
primaryKey: false, |
|||
field: "correctiveAction", |
|||
autoIncrement: false |
|||
}, |
|||
type: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否重新发起", |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
}, |
|||
punishment: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "实施处罚,强制措施情况", |
|||
primaryKey: false, |
|||
field: "punishment", |
|||
autoIncrement: false |
|||
}, |
|||
audit1ManIdTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "乡镇人审核时间", |
|||
primaryKey: false, |
|||
field: "audit1ManIdTime", |
|||
autoIncrement: false |
|||
}, |
|||
audit2ManIdTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "区县人复核时间", |
|||
primaryKey: false, |
|||
field: "audit2ManIdTime", |
|||
autoIncrement: false |
|||
}, |
|||
rejectTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "驳回日期", |
|||
primaryKey: false, |
|||
field: "rejectTime", |
|||
autoIncrement: false |
|||
}, |
|||
departmentId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
primaryKey: false, |
|||
field: "department_id", |
|||
autoIncrement: false, |
|||
}, |
|||
}, { |
|||
tableName: "user_placeSecurityRecord", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.UserPlaceSecurityRecord = UserPlaceSecurityRecord; |
|||
|
|||
const Places = dc.models.Places; |
|||
UserPlaceSecurityRecord.belongsTo(Places, { foreignKey: 'placeId', targetKey: 'id' }); |
|||
Places.hasMany(UserPlaceSecurityRecord, { foreignKey: 'placeId', sourceKey: 'id' }); |
|||
|
|||
const User = dc.models.User; |
|||
UserPlaceSecurityRecord.belongsTo(User, { as: 'user', foreignKey: 'userId', targetKey: 'id' }); |
|||
User.hasMany(UserPlaceSecurityRecord, { foreignKey: 'userId', sourceKey: 'id' }); |
|||
|
|||
UserPlaceSecurityRecord.belongsTo(User, { as: 'audit1ManUser', foreignKey: 'audit1ManId', targetKey: 'id' }); |
|||
|
|||
UserPlaceSecurityRecord.belongsTo(User, { as: 'audit2ManUser', foreignKey: 'audit2ManId', targetKey: 'id' }); |
|||
|
|||
UserPlaceSecurityRecord.belongsTo(User, { as: 'rejectManUser', foreignKey: 'rejectManId', targetKey: 'id' }); |
|||
|
|||
return UserPlaceSecurityRecord; |
|||
}; |
@ -1,61 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const UserResource = sequelize.define("userResource", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "post_resource_id_uindex" |
|||
}, |
|||
userId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "user_id", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "post" |
|||
} |
|||
}, |
|||
resourceId: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "resource", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "code", |
|||
model: "resource" |
|||
} |
|||
} |
|||
}, { |
|||
tableName: "user_resource", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.UserResource = UserResource; |
|||
|
|||
const User = dc.models.User; |
|||
UserResource.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); |
|||
User.hasMany(UserResource, { foreignKey: 'userId', sourceKey: 'id' }); |
|||
|
|||
const Resource = dc.models.Resource; |
|||
UserResource.belongsTo(Resource, { foreignKey: 'resourceId', targetKey: 'code' }); |
|||
Resource.hasMany(UserResource, { foreignKey: 'resourceId', sourceKey: 'code' }); |
|||
Resource.hasMany(Resource, { foreignKey: 'parentResource', sourceKey: 'code' }); |
|||
|
|||
return UserResource; |
|||
}; |
@ -1,13 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
const Approval = require('../../controllers/approval/index'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
/** |
|||
* @api {POST} approval/submit 提交审批、驳回修改. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup Approval |
|||
*/ |
|||
app.fs.api.logAttr['GET/approval/submit'] = { content: '提交审批、驳回修改', visible: true }; |
|||
router.post('/approval/submit', Approval.submitApproval); |
|||
}; |
@ -1,9 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
const common = require('../../controllers/common'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
|
|||
router.get('/data-dictionary/:model', common.getDataDictionary); |
|||
router.put('/data-dictionary/:model', common.putDataDictionary); |
|||
}; |
@ -0,0 +1,149 @@ |
|||
'use strict'; |
|||
|
|||
const vehicle = require('../../controllers/data/vehicle'); |
|||
const road = require('../../controllers/data/road'); |
|||
const bridge = require('../../controllers/data/bridge'); |
|||
const project = require('../../controllers/data/project'); |
|||
const overspeed = require('../../controllers/data/overspeed'); |
|||
const bus = require('../../controllers/data/bus'); |
|||
const publicity = require('../../controllers/data/publicity'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
|
|||
// 运政
|
|||
//客运车
|
|||
async function setVehicleType (ctx, next) { |
|||
ctx.request.body = { |
|||
...(ctx.request.body || {}), |
|||
type: 'vehicle' |
|||
} |
|||
await next() |
|||
} |
|||
app.fs.api.logAttr['GET/vehicle'] = { content: '获取运政列表', visible: true }; |
|||
router.get('/vehicle', setVehicleType, vehicle.get); |
|||
|
|||
app.fs.api.logAttr['PUT/vehicle'] = { content: '编辑运政数据', visible: true }; |
|||
router.put('/vehicle', setVehicleType, vehicle.edit); |
|||
|
|||
app.fs.api.logAttr['DEL/vehicle/:id'] = { content: '删除运政数据', visible: false }; |
|||
router.del('/vehicle/:id', setVehicleType, vehicle.del); |
|||
|
|||
// 路政
|
|||
async function setRoadManageType (ctx, next) { |
|||
ctx.request.body = { |
|||
...(ctx.request.body || {}), |
|||
type: 'road_manage' |
|||
} |
|||
await next() |
|||
} |
|||
app.fs.api.logAttr['GET/road_manage'] = { content: '获取路政列表', visible: true }; |
|||
router.get('/road_manage', setRoadManageType, vehicle.get); |
|||
|
|||
app.fs.api.logAttr['PUT/road_manage'] = { content: '编辑路政数据', visible: true }; |
|||
router.put('/road_manage', setRoadManageType, vehicle.edit); |
|||
|
|||
app.fs.api.logAttr['DEL/road_manage/:id'] = { content: '删除路政数据', visible: false }; |
|||
router.del('/road_manage/:id', setRoadManageType, vehicle.del); |
|||
|
|||
// 出租/危货
|
|||
app.fs.api.logAttr['GET/vehicle/specific'] = { content: '获取具体车辆列表', visible: true }; |
|||
router.get('/vehicle/specific', vehicle.specificGet); |
|||
|
|||
app.fs.api.logAttr['PUT/vehicle/specific'] = { content: '编辑具体车辆数据', visible: true }; |
|||
router.put('/vehicle/specific', vehicle.specificEdit); |
|||
|
|||
app.fs.api.logAttr['DEL/vehicle/:vehicleId/specific'] = { content: '删除具体车辆数据', visible: false }; |
|||
router.del('/vehicle/:vehicleId/specific', vehicle.specificDel); |
|||
|
|||
// 业户
|
|||
app.fs.api.logAttr['GET/vehicle/business'] = { content: '获取业户列表', visible: true }; |
|||
router.get('/vehicle/business', vehicle.businessGet); |
|||
|
|||
app.fs.api.logAttr['PUT/vehicle/business'] = { content: '编辑业户数据', visible: true }; |
|||
router.put('/vehicle/business', vehicle.businessEdit); |
|||
|
|||
app.fs.api.logAttr['DEL/vehicle/business/:businessId'] = { content: '删除业户数据', visible: false }; |
|||
router.del('/vehicle/business/:businessId', vehicle.businessDel); |
|||
// 运政 END
|
|||
|
|||
// 道路
|
|||
app.fs.api.logAttr['POST/road/import'] = { content: '导入道路数据', visible: true }; |
|||
router.post('/road/import', road.importIn); |
|||
|
|||
app.fs.api.logAttr['GET/road'] = { content: '获取道路数据', visible: true }; |
|||
router.get('/road', road.get); |
|||
|
|||
app.fs.api.logAttr['GET/road/section'] = { content: '获取道路路段数据', visible: true }; |
|||
router.get('/road/section', road.getRoadSection); |
|||
|
|||
app.fs.api.logAttr['put/road'] = { content: '编辑道路数据', visible: true }; |
|||
router.put('/road', road.edit); |
|||
|
|||
app.fs.api.logAttr['DEL/road/:roadId'] = { content: '删除道路数据', visible: false }; |
|||
router.del('/road/:roadId', road.del); |
|||
// 道路 END
|
|||
|
|||
// 桥梁
|
|||
app.fs.api.logAttr['GET/bridge'] = { content: '获取桥梁数据', visible: true }; |
|||
router.get('/bridge', bridge.bridgeGet); |
|||
|
|||
app.fs.api.logAttr['PUT/bridge'] = { content: '编辑桥梁数据', visible: true }; |
|||
router.put('/bridge', bridge.bridgeEdit); |
|||
|
|||
app.fs.api.logAttr['DEL/bridge/:bridgeId'] = { content: '删除桥梁数据', visible: false }; |
|||
router.del('/bridge/:bridgeId', bridge.bridgeDel); |
|||
// 桥梁 END
|
|||
|
|||
// project
|
|||
app.fs.api.logAttr['GET/project'] = { content: '获取工程数据', visible: true }; |
|||
router.get('/project', project.projectGet); |
|||
|
|||
app.fs.api.logAttr['PUT/project'] = { content: '编辑工程数据', visible: true }; |
|||
router.put('/project', project.projectEdit); |
|||
|
|||
app.fs.api.logAttr['DEL/project/:projectId'] = { content: '删除工程数据', visible: false }; |
|||
router.del('/project/:projectId', project.projectDel); |
|||
// project END
|
|||
|
|||
//overspeed
|
|||
app.fs.api.logAttr['GET/overspeed'] = { content: '获取治超数据', visible: true }; |
|||
router.get('/overspeed', overspeed.overspeedGet); |
|||
|
|||
app.fs.api.logAttr['PUT/overspeed'] = { content: '编辑治超数据', visible: true }; |
|||
router.put('/overspeed', overspeed.overspeedEdit); |
|||
|
|||
app.fs.api.logAttr['DEL/overspeed/:overspeedId'] = { content: '删除治超数据', visible: false }; |
|||
router.del('/overspeed/:overspeedId', overspeed.overspeedDel); |
|||
//overspeed END
|
|||
|
|||
//bus
|
|||
app.fs.api.logAttr['GET/bus/line'] = { content: '获取公交路线数据', visible: true }; |
|||
router.get('/bus/line', bus.lineGet); |
|||
|
|||
app.fs.api.logAttr['PUT/bus/line'] = { content: '编辑公交路线数据', visible: true }; |
|||
router.put('/bus/line', bus.lineEdit); |
|||
|
|||
app.fs.api.logAttr['DEL/bus/line/:lineId'] = { content: '删除公交路线数据', visible: false }; |
|||
router.del('/bus/line/:lineId', bus.lineDel); |
|||
|
|||
app.fs.api.logAttr['GET/bus/car'] = { content: '获取公交车辆数据', visible: true }; |
|||
router.get('/bus/car', bus.carGet); |
|||
|
|||
app.fs.api.logAttr['PUT/bus/car'] = { content: '编辑公交车辆数据', visible: true }; |
|||
router.put('/bus/car', bus.carEdit); |
|||
|
|||
app.fs.api.logAttr['DEL/bus/car/:carId'] = { content: '删除公交车辆数据', visible: false }; |
|||
router.del('/bus/car/:carId', bus.carDel); |
|||
//bus END
|
|||
|
|||
//publicity
|
|||
app.fs.api.logAttr['GET/publicity'] = { content: '获取宣传数据', visible: true }; |
|||
router.get('/publicity', publicity.publicityGet); |
|||
|
|||
app.fs.api.logAttr['PUT/publicity'] = { content: '编辑宣传数据', visible: true }; |
|||
router.put('/publicity', publicity.publicityEdit); |
|||
|
|||
app.fs.api.logAttr['DEL/publicity/:publicityId'] = { content: '删除宣传数据', visible: false }; |
|||
router.del('/publicity/:publicityId', publicity.publicityDel); |
|||
//publicity END
|
|||
}; |
@ -1,13 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
const Department = require('../../controllers/department/index'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
/** |
|||
* @api {GET} counties/list 获取南昌市下所有区县. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup Department |
|||
*/ |
|||
app.fs.api.logAttr['GET/counties/list'] = { content: '获取南昌市下所有区县', visible: true }; |
|||
router.get('/counties/list', Department.getCountiesList); |
|||
}; |
@ -1,28 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
const Authority = require('../../controllers/organization/authority'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
/** |
|||
* @api {GET} resource 查询所有权限码. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup Org |
|||
*/ |
|||
app.fs.api.logAttr['GET/resource'] = { content: '查询所有权限码', visible: true }; |
|||
router.get('resource', Authority.getResource); |
|||
/** |
|||
* @api {GET} user/resource 查询用户权限. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup Org |
|||
*/ |
|||
app.fs.api.logAttr['GET/user/resource'] = { content: '查询用户权限', visible: true }; |
|||
router.get('user/resource', Authority.getUserResource); |
|||
|
|||
/** |
|||
* @api {POST} user/resource 更新用户权限. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup Org |
|||
*/ |
|||
app.fs.api.logAttr['POST/user/resource'] = { content: '更新用户权限', visible: true }; |
|||
router.post('user/resource', Authority.updateUserRes); |
|||
}; |
@ -0,0 +1,36 @@ |
|||
'use strict'; |
|||
|
|||
const Department = require('../../controllers/organization/department') |
|||
const user = require('../../controllers/organization/user'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
app.fs.api.logAttr['GET/department'] = { content: '获取部门列表', visible: false }; |
|||
router.get('/department', Department.getdep); |
|||
|
|||
app.fs.api.logAttr['PUT/department'] = { content: '编辑部门信息', visible: false }; |
|||
router.put('/department', Department.editDep); |
|||
|
|||
app.fs.api.logAttr['DEL/department/:depId'] = { content: '删除部门信息', visible: false }; |
|||
router.del('/department/:depId', Department.delDep); |
|||
|
|||
app.fs.api.logAttr['GET/user'] = { content: '获取所有用户信息', visible: false }; |
|||
router.get('/user', user.getUserAll); |
|||
|
|||
app.fs.api.logAttr['GET/department/:depId/user'] = { content: '获取部门下用户信息', visible: false }; |
|||
router.get('/department/:depId/user', user.getUser); |
|||
|
|||
app.fs.api.logAttr['POST/department/user'] = { content: '创建部门下用户信息', visible: false }; |
|||
router.post('/department/user', user.creatUser); |
|||
|
|||
app.fs.api.logAttr['PUT/department/user/:userId'] = { content: '修改部门下用户信息', visible: false }; |
|||
router.put('/department/user/:userId', user.updateUser); |
|||
|
|||
app.fs.api.logAttr['DEL/department/user/:userIds'] = { content: '删除部门下用户信息', visible: false }; |
|||
router.del('/department/user/:userIds', user.deleteUser); |
|||
|
|||
// app.fs.api.logAttr['PUT/department/user/:userId/resetPwd'] = { content: '重置用户密码', visible: false };
|
|||
// router.put('/department/user/:userId/resetPwd', user.resetPwd);
|
|||
|
|||
app.fs.api.logAttr['PUT/department/user/:userId/password'] = { content: '修改用户密码', visible: false }; |
|||
router.put('/department/user/:userId/password', user.setPassword); |
|||
}; |
@ -1,32 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
const user = require('../../controllers/organization/user'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
|
|||
app.fs.api.logAttr['GET/organization/department'] = { content: '获取部门信息', visible: false }; |
|||
router.get('/organization/department', user.getDepMessage); |
|||
|
|||
app.fs.api.logAttr['GET/organization/department/:depId/user'] = { content: '获取部门下用户信息', visible: false }; |
|||
router.get('/organization/department/:depId/user', user.getUser); |
|||
|
|||
app.fs.api.logAttr['POST/organization/department/user'] = { content: '创建部门下用户信息', visible: false }; |
|||
router.post('/organization/department/user', user.creatUser); |
|||
|
|||
app.fs.api.logAttr['PUT/organization/department/user/:id'] = { content: '修改部门下用户信息', visible: false }; |
|||
router.put('/organization/department/user/:id', user.updateUser); |
|||
|
|||
app.fs.api.logAttr['DEL/organization/department/user/:ids'] = { content: '删除部门下用户信息', visible: false }; |
|||
router.del('/organization/department/user/:ids', user.deleteUser); |
|||
|
|||
app.fs.api.logAttr['PUT/organization/department/user/resetPwd/:id'] = { content: '重置用户密码', visible: false }; |
|||
router.put('/organization/department/user/resetPwd/:id', user.resetPwd); |
|||
|
|||
/** |
|||
* @api {PUT} user/password/:id 修改用户密码 |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup Organization |
|||
*/ |
|||
app.fs.api.logAttr['PUT/user/password/:userId'] = { content: '修改用户密码', visible: false }; |
|||
router.put('/user/password/:userId', user.updateUserPassword); |
|||
}; |
@ -0,0 +1,26 @@ |
|||
'use strict'; |
|||
|
|||
const operation = require('../../controllers/overview/operation'); |
|||
const management = require('../../controllers/overview/management'); |
|||
const build = require('../../controllers/overview/building'); |
|||
const conserve = require('../../controllers/overview/conserve'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
app.fs.api.logAttr['GET/operation/car_level'] = { content: '获取公交车辆层级信息', visible: false }; |
|||
router.get('/operation/car_level', operation.busCarLevelList); |
|||
|
|||
app.fs.api.logAttr['GET/manage/overspeed'] = { content: '获取治超详情列', visible: false }; |
|||
router.get('/manage/overspeed', management.overSpeedList); |
|||
|
|||
app.fs.api.logAttr['GET/manage/overspeed/processed'] = { content: '获取治超监测点处理数据', visible: false }; |
|||
router.get('/manage/overspeed/processed', management.overSpeedProcessed); |
|||
|
|||
app.fs.api.logAttr['GET/build/road_state'] = { content: '获取道路统计', visible: false }; |
|||
router.get('/build/road_state', build.roadState); |
|||
|
|||
app.fs.api.logAttr['GET/conserve/statistic'] = { content: '获取道路养护统计及列表', visible: false }; |
|||
router.get('/conserve/statistic', conserve.statistic); |
|||
|
|||
app.fs.api.logAttr['GET/transportation/statistic'] = { content: '获取运政统计', visible: false }; |
|||
router.get('/transportation/statistic', operation.vehicleStatistic); |
|||
} |
@ -1,70 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
const placeSecurityRecord = require('../../controllers/placeSecurityRecord'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
/** |
|||
* @api {POST} /add/placeSecurityRecord 提交填报信息/保存填报草稿. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup placeSecurityRecord |
|||
*/ |
|||
app.fs.api.logAttr['POST/add/placeSecurityRecord'] = { content: '提交填报信息/保存填报草稿', visible: true }; |
|||
router.post('/add/placeSecurityRecord', placeSecurityRecord.addPlaceSecurityRecord); |
|||
|
|||
/** |
|||
* @api {PUT} /placeSecurityRecord/:id 编辑填报信息. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup placeSecurityRecord |
|||
*/ |
|||
app.fs.api.logAttr['PUT/placeSecurityRecord/:id'] = { content: '编辑填报信息', visible: true }; |
|||
router.put('/placeSecurityRecord/:id', placeSecurityRecord.editPlaceSecurityRecord); |
|||
|
|||
/** |
|||
* @api {PUT} /placeSecurityRecord/:id 修改type字段 |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup placeSecurityRecord |
|||
*/ |
|||
app.fs.api.logAttr['PUT/updateType/:id'] = { content: '修改type字段', visible: true }; |
|||
router.put('/updateType/:id', placeSecurityRecord.updateType); |
|||
|
|||
/** |
|||
* @api {DELETE} /placeSecurityRecord/:id 删除填报信息. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup placeSecurityRecord |
|||
*/ |
|||
app.fs.api.logAttr['DELETE/placeSecurityRecord/:id'] = { content: '删除填报信息', visible: true }; |
|||
router.del('/placeSecurityRecord/:id', placeSecurityRecord.deletePlaceSecurityRecord); |
|||
|
|||
/** |
|||
* @api {GET} /placeSecurityRecord/:id 根据填报信息ID查询填报信息. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup placeSecurityRecord |
|||
*/ |
|||
app.fs.api.logAttr['GET/placeSecurityRecord/:id'] = { content: '根据填报信息ID查询填报信息', visible: true }; |
|||
router.get('/placeSecurityRecord/:id', placeSecurityRecord.getPlaceSecurityRecordById); |
|||
|
|||
/** |
|||
* @api {GET} /recently/placeSecurityRecord/:placeId 根据场所ID获取该场所最近用户填报信息. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup placeSecurityRecord |
|||
*/ |
|||
app.fs.api.logAttr['GET/recently/placeSecurityRecord/:placeId'] = { content: '根据场所ID获取该场所最近用户填报信息', visible: true }; |
|||
router.get('/recently/placeSecurityRecord/:placeId', placeSecurityRecord.getRecentlyPlaceSecurityRecordByPlaceId); |
|||
|
|||
/** |
|||
* @api {GET} /placeSecurityRecords 根据筛选条件获取用户填报信息. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup placeSecurityRecord |
|||
*/ |
|||
app.fs.api.logAttr['GET/placeSecurityRecords'] = { content: '根据筛选条件获取用户填报信息', visible: true }; |
|||
router.get('/placeSecurityRecords', placeSecurityRecord.getPlaceSecurityRecords); |
|||
|
|||
/** |
|||
* @api {GET} /approve/placeSecurityRecords 根据筛选条件获取用户审批填报信息. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup placeSecurityRecord |
|||
*/ |
|||
app.fs.api.logAttr['GET/approve/placeSecurityRecords'] = { content: '根据筛选条件获取用户审批填报信息', visible: true }; |
|||
router.get('/approve/placeSecurityRecords', placeSecurityRecord.getApprovePlaceSecurityRecords); |
|||
|
|||
}; |
@ -1,30 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
const places = require('../../controllers/places'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
/** |
|||
* @api {GET} /user/places/:userId 根据用户ID获取该用户创建的所有场所信息. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup places |
|||
*/ |
|||
app.fs.api.logAttr['GET/user/places/:userId'] = { content: '根据用户ID获取该用户创建的所有场所信息', visible: true }; |
|||
router.get('/user/places/:userId', places.getPlacesByUserId); |
|||
|
|||
/** |
|||
* @api {GET} /approveUser/places/:approveUserId 根据审批用户ID获取该审批用户范围内填报人创建的场所信息. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup places |
|||
*/ |
|||
app.fs.api.logAttr['GET/approveUser/places/:approveUserId'] = { content: '根据审批用户ID获取该审批用户范围内填报人创建的场所信息', visible: true }; |
|||
router.get('/approveUser/places/:approveUserId', places.getPlacesByApproveUserId); |
|||
|
|||
/** |
|||
* @api {GET} /all/places 获取所有场所信息. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup places |
|||
*/ |
|||
app.fs.api.logAttr['GET/all/places'] = { content: '获取所有场所信息', visible: true }; |
|||
router.get('/all/places', places.getAllPlaces); |
|||
|
|||
}; |
@ -1,41 +1,20 @@ |
|||
'use strict'; |
|||
|
|||
const report = require('../../controllers/report'); |
|||
const reportConfig = require('../../controllers/report/config') |
|||
const reportRectify = require('../../controllers/report/compile') |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
/** |
|||
* @api {GET} report 报表. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup report |
|||
*/ |
|||
app.fs.api.logAttr['GET/report/list'] = { content: '报表下载列表', visible: true }; |
|||
router.get('/report/list', report.getReportList); |
|||
app.fs.api.logAttr['GET/report/list'] = { content: '获取上报列表', visible: false }; |
|||
router.get('/report/list', report.reportList); |
|||
|
|||
// 报表配置
|
|||
app.fs.api.logAttr['GET/allAreas'] = { content: '获取全部区域', visible: true }; |
|||
router.get('/allAreas', reportConfig.getAreas); |
|||
app.fs.api.logAttr['GET/report/position'] = { content: '获取最新上报位置', visible: false }; |
|||
router.get('/report/position', report.reportPosition); |
|||
|
|||
app.fs.api.logAttr['POST/report/config'] = { content: '添加报表配置', visible: true }; |
|||
router.post('/report/config', reportConfig.addReportConfig); |
|||
app.fs.api.logAttr['GET/report/:reportId/detail'] = { content: '获取上报详情', visible: false }; |
|||
router.get('/report/:reportId//detail', report.reportDetail); |
|||
|
|||
app.fs.api.logAttr['GET/report/config'] = { content: '获取报表配置', visible: true }; |
|||
router.get('/report/config', reportConfig.getReportConfig); |
|||
app.fs.api.logAttr['POST/report'] = { content: '创建上报', visible: false }; |
|||
router.post('/report', report.createReport); |
|||
|
|||
app.fs.api.logAttr['PUT/report/:reportId/config'] = { content: '编辑报表配置', visible: true }; |
|||
router.put('/report/:reportId/config', reportConfig.editReportConfig); |
|||
|
|||
app.fs.api.logAttr['DEL/report/:reportId/config'] = { content: '删除报表配置', visible: true }; |
|||
router.del('/report/:reportId/config', reportConfig.delReportConfig); |
|||
|
|||
// 报表编辑
|
|||
app.fs.api.logAttr['GET/report/rectify'] = { content: '获取合用场所安全隐患排查整治汇总表', visible: true }; |
|||
router.get('/report/rectify', reportRectify.getReportRectify); |
|||
|
|||
app.fs.api.logAttr['GET/report/rectify/detail'] = { content: '获取合用场所安全隐患排查整治汇总表详情', visible: true }; |
|||
router.get('/report/rectify/detail', reportRectify.getReportRectifyDetail); |
|||
|
|||
app.fs.api.logAttr['POST/report/rectify/detail'] = { content: '保存合用场所安全隐患排查整治汇总表编辑信息', visible: true }; |
|||
router.post('/report/rectify/detail', reportRectify.compileReportRectifyDetail); |
|||
}; |
|||
app.fs.api.logAttr['DEL/report/:reportId'] = { content: '删除上报', visible: false }; |
|||
router.del('/report/:reportId', report.deleteReport); |
|||
} |
@ -1,28 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
const statistic = require('../../controllers/statistic') |
|||
module.exports = function (app, router, opts) { |
|||
/** |
|||
* @api {GET} getGovern 获取数据中台. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup wxReport |
|||
*/ |
|||
app.fs.api.logAttr['GET/daily/report/data/statistic'] = { content: '获取数据中台', visible: true }; |
|||
router.get('/daily/report/data/statistic', statistic.reportDailyStatistic); |
|||
/** |
|||
* @api {GET} getGovern 获取数据中台地区填报数量. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup wxReport |
|||
*/ |
|||
app.fs.api.logAttr['GET/daily/report/area/statistic'] = { content: '获取数据中台地区填报数量', visible: true }; |
|||
router.get('/daily/report/area/statistic', statistic.reportAreaStatistic); |
|||
|
|||
/** |
|||
* @api {GET} getGovern 获取填报管理数据. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup wxReport |
|||
*/ |
|||
app.fs.api.logAttr['GET/report/management/statistic'] = { content: '获取填报管理数据', visible: true }; |
|||
router.get('/report/management/statistic', statistic.dangerAreaQuery); |
|||
|
|||
} |
@ -1,78 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
const wxReport = require('../../controllers/wxReport/index'); |
|||
module.exports = function (app, router, opts) { |
|||
/*******************首页-市级***************************/ |
|||
/** |
|||
* @api {GET} getDayReport 获取每日汇总. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup wxReport |
|||
*/ |
|||
app.fs.api.logAttr['GET/getDayReport'] = { content: '获取每日汇总', visible: true }; |
|||
router.get('/getDayReport', wxReport.getDayReport); |
|||
|
|||
/** |
|||
* @api {GET} getGovern 获取排查整治汇总. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup wxReport |
|||
*/ |
|||
app.fs.api.logAttr['GET/getGovern'] = { content: '获取排查整治汇总', visible: true }; |
|||
router.get('/getGovern', wxReport.getGovern); |
|||
|
|||
/** |
|||
* @api {GET} getGovernDetail 获取排查整治汇总详情. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup wxReport |
|||
*/ |
|||
app.fs.api.logAttr['GET/getGovernDetail'] = { content: '获取排查整治汇总详情', visible: true }; |
|||
router.get('/getGovernDetail', wxReport.getGovernDetail); |
|||
|
|||
/** |
|||
* @api {PUT} /operateGovern 确认整治汇总场所数据. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup wxReport |
|||
*/ |
|||
app.fs.api.logAttr['PUT/operateGovern'] = { content: '确认整治汇总场所数据', visible: true }; |
|||
router.put('/operateGovern', wxReport.operateGovern); |
|||
|
|||
/** |
|||
* @api {GET} getSecurityRiskList 获取安全隐患排查详细数据列表. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup wxReport |
|||
*/ |
|||
app.fs.api.logAttr['GET/getSecurityRiskList'] = { content: '获取安全隐患排查详细数据列表', visible: true }; |
|||
router.get('/getSecurityRiskList', wxReport.getSecurityRiskList); |
|||
|
|||
/** |
|||
* @api {GET} /getHomeCount/:userId/:departmentId/:userRegionType 获取待处理数量. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup wxReport |
|||
*/ |
|||
app.fs.api.logAttr['GET/getHomeCount/:userId/:departmentId/:userRegionType'] = { content: '获取待处理数量', visible: true }; |
|||
router.get('/getHomeCount/:userId/:departmentId/:userRegionType', wxReport.getHomeCount); |
|||
|
|||
|
|||
/** |
|||
* @api {PUT} /operateReport/:id/:userId 每日汇总表上报. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup wxReport |
|||
*/ |
|||
app.fs.api.logAttr['PUT/operateReport/:id/:userId'] = { content: '每日汇总表上报', visible: true }; |
|||
router.put('/operateReport/:id/:userId', wxReport.operateReport); |
|||
|
|||
/** |
|||
* @api {GET} /approve/reportCollections 根据筛选条件获取用户审核报表信息. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup wxReport |
|||
*/ |
|||
app.fs.api.logAttr['GET/approve/reportCollections'] = { content: '根据筛选条件获取用户审核报表信息', visible: true }; |
|||
router.get('/approve/reportCollections', wxReport.getApproveReportCollections); |
|||
|
|||
/** |
|||
* @api {PUT} /operateGovernReport/:userId 上报排查整治汇总表. |
|||
* @apiVersion 1.0.0 |
|||
* @apiGroup wxReport |
|||
*/ |
|||
app.fs.api.logAttr['PUT/operateGovernReport/:userId'] = { content: '上报排查整治汇总表', visible: true }; |
|||
router.put('/operateGovernReport/:userId', wxReport.operateGovernReport); |
|||
} |
@ -0,0 +1,19 @@ |
|||
pipeline { |
|||
agent { |
|||
node{ |
|||
label 'jnlp-slave' |
|||
} |
|||
} |
|||
|
|||
stages { |
|||
stage('Highways4Good Api ......') { |
|||
steps { |
|||
sh 'switch-auth.sh anxinyun' |
|||
buildName "#${BUILD_NUMBER} ~/fs-cloud/${JOB_NAME}:${IMAGE_VERSION}" |
|||
buildDescription "registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}" |
|||
sh 'docker build -t registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION} ./api' |
|||
sh 'docker push registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}' |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,19 @@ |
|||
pipeline { |
|||
agent { |
|||
node{ |
|||
label 'jnlp-slave' |
|||
} |
|||
} |
|||
|
|||
stages { |
|||
stage('Highways4Good Web......') { |
|||
steps { |
|||
sh 'switch-auth.sh anxinyun' |
|||
buildName "#${BUILD_NUMBER} ~/fs-cloud/${JOB_NAME}:${IMAGE_VERSION}" |
|||
buildDescription "registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}" |
|||
sh 'docker build -t registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION} ./web' |
|||
sh 'docker push registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}' |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,8 @@ |
|||
-- ---------------------------- |
|||
-- Records of DEP |
|||
-- ---------------------------- |
|||
INSERT INTO "department" VALUES (1, '默认部门', NULL, false); |
|||
-- ---------------------------- |
|||
-- Records of user |
|||
-- ---------------------------- |
|||
INSERT INTO "user" VALUES (1, '管理员', 'SuperAdmin', 'e10adc3949ba59abbe56e057f20f883e', 1, 'f', NULL, NULL, NULL, TRUE); |
@ -0,0 +1,9 @@ |
|||
INSERT INTO statistic (name, count, type) values ('客运车', 0, 'vehicle'); |
|||
INSERT INTO statistic (name, count, type) values ('标线', 0, 'road_manage'); |
|||
INSERT INTO statistic (name, count, type) values ('人行道', 0, 'road_manage'); |
|||
INSERT INTO statistic (name, count, type) values ('标志牌', 0, 'road_manage'); |
|||
INSERT INTO statistic (name, count, type) values ('防护栏', 0, 'road_manage'); |
|||
INSERT INTO statistic (name, count, type) values ('检查井', 0, 'road_manage'); |
|||
INSERT INTO statistic (name, count, type) values ('雨水口', 0, 'road_manage'); |
|||
INSERT INTO statistic (name, count, type) values ('路牌名', 0, 'road_manage'); |
|||
INSERT INTO statistic (name, count, type) values ('养护责任牌', 0, 'road_manage'); |
@ -0,0 +1,17 @@ |
|||
{ |
|||
// 使用 IntelliSense 了解相关属性。 |
|||
// 悬停以查看现有属性的描述。 |
|||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 |
|||
"version": "0.2.0", |
|||
"configurations": [ |
|||
{ |
|||
"type": "node", |
|||
"request": "launch", |
|||
"name": "启动程序", |
|||
"skipFiles": [ |
|||
"<node_internals>/**" |
|||
], |
|||
"program": "${workspaceFolder}\\index.js" |
|||
} |
|||
] |
|||
} |
After Width: | Height: | Size: 205 KiB |
After Width: | Height: | Size: 183 KiB |
After Width: | Height: | Size: 242 KiB |
After Width: | Height: | Size: 858 KiB |
After Width: | Height: | Size: 808 KiB |
After Width: | Height: | Size: 234 KiB |
After Width: | Height: | Size: 895 KiB |
After Width: | Height: | Size: 220 KiB |
After Width: | Height: | Size: 987 KiB |
After Width: | Height: | Size: 260 KiB |
After Width: | Height: | Size: 970 KiB |
After Width: | Height: | Size: 759 KiB |
After Width: | Height: | Size: 166 KiB |
After Width: | Height: | Size: 108 KiB |
After Width: | Height: | Size: 216 KiB |
After Width: | Height: | Size: 762 KiB |
After Width: | Height: | Size: 206 KiB |
After Width: | Height: | Size: 710 KiB |
After Width: | Height: | Size: 264 KiB |