Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjh5
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data_server
gjjh5
Commits
2116139e
Commit
2116139e
authored
Jun 20, 2019
by
姜登
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodegjj
parent
abcb28ad
Pipeline
#9254
passed with stage
in 1 minute 33 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
246 additions
and
1 deletion
+246
-1
task.js
app/controller/task.js
+1
-0
cusdata.js
app/model/nodegjj/cusdata.js
+77
-0
gjjStatus.js
app/model/nodegjj/gjjStatus.js
+110
-0
order.js
app/service/order.js
+30
-0
storage.js
app/service/storage.js
+6
-1
config.local.js
config/config.local.js
+11
-0
config.prod.js
config/config.prod.js
+11
-0
No files found.
app/controller/task.js
View file @
2116139e
...
...
@@ -144,6 +144,7 @@ class TaskController extends Controller {
delete
insertData
.
code
;
await
service
.
storage
.
write
(
insertData
);
await
service
.
partner
.
notice
(
order
);
await
service
.
order
.
oldgjjStatus
({
orderId
,
status
:
'success'
});
}
catch
(
err
)
{
ctx
.
logger
.
error
(
'handleCallback'
,
JSON
.
stringify
(
err
),
JSON
.
stringify
(
result
));
taskNote
=
{
...
...
app/model/nodegjj/cusdata.js
0 → 100644
View file @
2116139e
'use strict'
;
module
.
exports
=
app
=>
{
const
{
DataTypes
}
=
app
.
Sequelize
;
const
cusDatas
=
app
.
nodemodel
.
define
(
'cusDatas'
,
{
id
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
autoIncrement
:
true
,
primaryKey
:
true
,
field
:
'id'
,
},
orderSn
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
false
,
field
:
'orderSn'
,
},
appkey
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
false
,
field
:
'appkey'
,
},
type
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'type'
,
},
date
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
defaultValue
:
app
.
Sequelize
.
literal
(
'CURRENT_TIMESTAMP'
),
field
:
'date'
,
},
// text1: {
// type: DataTypes.STRING(255),
// allowNull: true,
// defaultValue: '',
// field: 'text1',
// },
// text2: {
// type: DataTypes.STRING(255),
// allowNull: true,
// defaultValue: '',
// field: 'text2',
// },
// text3: {
// type: DataTypes.STRING(255),
// allowNull: true,
// defaultValue: '',
// field: 'text3',
// },
// text4: {
// type: DataTypes.STRING(255),
// allowNull: true,
// defaultValue: '',
// field: 'text4',
// },
// date1: {
// type: DataTypes.DATE,
// allowNull: true,
// field: 'date1',
// },
// date2: {
// type: DataTypes.DATE,
// allowNull: true,
// field: 'date2',
// },
},
{
tableName
:
'cus_data'
,
timestamps
:
false
,
});
return
cusDatas
;
};
app/model/nodegjj/gjjStatus.js
0 → 100644
View file @
2116139e
'use strict'
;
module
.
exports
=
app
=>
{
const
{
DataTypes
}
=
app
.
Sequelize
;
const
gjjStatus
=
app
.
nodemodel
.
define
(
'gjjStatus'
,
{
orderId
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
false
,
primaryKey
:
true
,
field
:
'orderId'
,
},
taskId
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
false
,
defaultValue
:
''
,
field
:
'taskId'
,
},
userId
:
{
type
:
DataTypes
.
STRING
(
500
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'userId'
,
},
cityId
:
{
type
:
DataTypes
.
STRING
(
10
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'cityId'
,
},
appkey
:
{
type
:
DataTypes
.
STRING
(
50
),
allowNull
:
false
,
field
:
'appkey'
,
},
callbackUrl
:
{
type
:
DataTypes
.
STRING
(
500
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'callbackUrl'
,
},
status
:
{
type
:
DataTypes
.
STRING
(
20
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'status'
,
},
note
:
{
type
:
DataTypes
.
STRING
(
8000
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'note'
,
get
()
{
const
note
=
this
.
getDataValue
(
'note'
);
if
(
note
)
{
try
{
return
JSON
.
parse
(
note
);
}
catch
(
error
)
{
return
{};
}
}
return
{};
},
set
(
val
)
{
this
.
setDataValue
(
'note'
,
JSON
.
stringify
(
val
));
},
},
created_at
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
false
,
defaultValue
:
app
.
Sequelize
.
literal
(
'CURRENT_TIMESTAMP'
),
field
:
'createDate'
,
},
updated_at
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
false
,
defaultValue
:
app
.
Sequelize
.
literal
(
'CURRENT_TIMESTAMP'
),
field
:
'updateDate'
,
},
text2
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'text2'
,
},
text3
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'text3'
,
},
text4
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'text4'
,
},
text5
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
true
,
defaultValue
:
''
,
field
:
'text5'
,
},
},
{
tableName
:
'gjjh5_status'
,
});
return
gjjStatus
;
};
app/service/order.js
View file @
2116139e
...
...
@@ -46,8 +46,38 @@ class OrderService extends Service {
}
else
{
await
order
[
0
].
update
(
params
);
}
await
ctx
.
nodemodel
.
GjjStatus
.
findOrCreate
({
where
:
{
orderId
:
params
.
orderId
,
},
defaults
:
{
appkey
:
appKey
,
orderId
:
params
.
orderId
,
callbackUrl
:
notifyUrl
,
taskId
:
params
.
taskId
,
cityId
:
params
.
cityId
,
userId
,
status
:
'init'
,
},
})
.
spread
(
async
(
info
,
created
)
=>
{
if
(
created
===
false
)
{
await
info
.
update
({
taskId
,
cityId
:
params
.
cityId
,
status
:
'init'
});
}
});
return
order
[
0
];
}
async
oldgjjStatus
(
params
)
{
const
{
ctx
}
=
this
;
await
ctx
.
nodemodel
.
GjjStatus
.
update
({
status
:
params
.
status
},
{
where
:
{
orderId
:
params
.
orderId
,
},
limit
:
1
,
});
}
}
module
.
exports
=
OrderService
;
app/service/storage.js
View file @
2116139e
...
...
@@ -57,7 +57,12 @@ class StorageService extends Service {
await
ctx
.
model
.
Cusdata
.
create
({
appKey
,
orderId
,
type
:
'gjj'
,
type
:
'gjjH5'
,
});
await
ctx
.
nodemodel
.
Cusdata
.
create
({
appkey
:
appKey
,
orderSn
:
orderId
,
type
:
'gjjH5'
,
});
return
result
.
data
.
data
[
readDataKey
];
}
...
...
config/config.local.js
View file @
2116139e
...
...
@@ -90,6 +90,17 @@ module.exports = () => {
datasources
:
[{
// 东八时区
timezone
:
'+08:00'
,
delegate
:
'nodemodel'
,
baseDir
:
'model/nodegjj'
,
dialect
:
'mysql'
,
host
:
'rm-bp1272001633qc0x9o.mysql.rds.aliyuncs.com'
,
database
:
'nodetest'
,
username
:
'hexin'
,
password
:
'gYUHszn9#q'
,
port
:
3306
,
},
{
// 东八时区
timezone
:
'+08:00'
,
delegate
:
'model'
,
baseDir
:
'model'
,
dialect
:
'mysql'
,
...
...
config/config.prod.js
View file @
2116139e
...
...
@@ -102,6 +102,17 @@ module.exports = () => {
username
:
process
.
env
.
MYSQL_USER
||
'kf_jiandeng'
,
password
:
process
.
env
.
MYSQL_PWD
||
'Zg23Is9c7d2uKz15abZcV'
,
port
:
process
.
env
.
MYSQL_PORT
||
3306
,
},
{
// 东八时区
timezone
:
'+08:00'
,
delegate
:
'nodemodel'
,
baseDir
:
'model/nodegjj'
,
dialect
:
'mysql'
,
host
:
process
.
env
.
MYSQL_PACHONG_HOST
||
'rm-bp1272001633qc0x9o.mysql.rds.aliyuncs.com'
,
database
:
process
.
env
.
MYSQL_NODE_SERVER_DB_NAME
||
'nodetest'
,
username
:
process
.
env
.
MYSQL_USER
||
'hexin'
,
password
:
process
.
env
.
MYSQL_PWD
||
'gYUHszn9#q'
,
port
:
process
.
env
.
MYSQL_PORT
||
3306
,
}],
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment