Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
5f4ca675
Commit
5f4ca675
authored
Jun 02, 2020
by
sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 调整方案商机 字段
parent
0e893f81
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
100 additions
and
44 deletions
+100
-44
icp-deliver/app/base/controller/impl/bizchance/bizoptCtl.js
+1
-1
icp-deliver/app/base/controller/impl/delivery/deliverybillCtl.js
+17
-0
icp-deliver/app/base/db/impl/bizchance/bizoptDao.js
+1
-1
icp-deliver/app/base/db/models/delivery/business_opportunity.js
+8
-8
icp-deliver/app/base/db/models/delivery/delivery_bill.js
+22
-15
icp-deliver/app/base/db/models/delivery/scheme.js
+33
-4
icp-deliver/app/base/db/models/delivery/status_log.js
+5
-1
icp-deliver/app/base/service/impl/bizchance/bizoptSve.js
+8
-9
icp-deliver/app/base/service/impl/bizchance/schemeSve.js
+5
-5
No files found.
icp-deliver/app/base/controller/impl/bizchance/bizoptCtl.js
View file @
5f4ca675
...
@@ -19,7 +19,7 @@ class BizOptCtl extends CtlBase {
...
@@ -19,7 +19,7 @@ class BizOptCtl extends CtlBase {
val
.
customer_name
=
val
.
business_info
.
person
;
val
.
customer_name
=
val
.
business_info
.
person
;
val
.
updated_at
=
moment
(
val
.
updated_at
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
val
.
updated_at
=
moment
(
val
.
updated_at
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
val
.
created_at
=
moment
(
val
.
created_at
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
val
.
created_at
=
moment
(
val
.
created_at
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
val
.
schemeStatus
=
val
[
"scheme.status"
];
val
.
schemeStatus
=
val
[
"scheme.s
cheme_s
tatus"
];
result
.
push
(
val
);
result
.
push
(
val
);
}
}
rs
.
results
.
rows
=
result
;
rs
.
results
.
rows
=
result
;
...
...
icp-deliver/app/base/controller/impl/delivery/deliverybillCtl.js
0 → 100644
View file @
5f4ca675
var
system
=
require
(
"../../../system"
);
const
http
=
require
(
"http"
);
const
querystring
=
require
(
'querystring'
);
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
moment
=
require
(
"moment"
);
class
DeliverybillCtl
extends
CtlBase
{
constructor
()
{
super
(
"delivery"
,
CtlBase
.
getServiceName
(
DeliverybillCtl
));
}
async
findAndCountAll
(
pobj
,
qobj
,
req
)
{
//设置查询条件
const
rs
=
await
this
.
service
.
findAndCountAll
(
pobj
);
return
system
.
getResult
(
rs
);
}
}
module
.
exports
=
DeliverybillCtl
;
icp-deliver/app/base/db/impl/bizchance/bizoptDao.js
View file @
5f4ca675
...
@@ -22,7 +22,7 @@ class BizoptDao extends Dao {
...
@@ -22,7 +22,7 @@ class BizoptDao extends Dao {
qc
.
include
=
[
qc
.
include
=
[
{
{
model
:
this
.
db
.
models
.
scheme
,
model
:
this
.
db
.
models
.
scheme
,
attributes
:
[
"status"
]
attributes
:
[
"s
cheme_s
tatus"
]
}
}
]
]
return
qw
;
return
qw
;
...
...
icp-deliver/app/base/db/models/delivery/business_opportunity.js
View file @
5f4ca675
...
@@ -26,11 +26,11 @@ module.exports = (db, DataTypes) => {
...
@@ -26,11 +26,11 @@ module.exports = (db, DataTypes) => {
allowNull
:
true
,
allowNull
:
true
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
source
:
{
//
渠道来源
source
_name
:
{
//
渠道来源
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
address
:
{
// 区域地址
service_
address
:
{
// 区域地址
allowNull
:
false
,
allowNull
:
false
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
...
@@ -38,12 +38,12 @@ module.exports = (db, DataTypes) => {
...
@@ -38,12 +38,12 @@ module.exports = (db, DataTypes) => {
allowNull
:
true
,
allowNull
:
true
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
service_company_id
:
{
// 公司
id
facilitator_id
:
{
// 服务商
id
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
service_company_name
:
{
// 公司
名称
facilitator_name
:
{
// 服务商
名称
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
salesman_opcode
:
{
// 组织架构路径
salesman_opcode
:
{
// 组织架构路径
...
@@ -58,7 +58,7 @@ module.exports = (db, DataTypes) => {
...
@@ -58,7 +58,7 @@ module.exports = (db, DataTypes) => {
allowNull
:
true
,
allowNull
:
true
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
salesman_phone
_number
:
{
// 业务员联系方式
salesman_phone
:
{
// 业务员联系方式
allowNull
:
true
,
allowNull
:
true
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
}
}
...
...
icp-deliver/app/base/db/models/delivery/delivery_bill.js
View file @
5f4ca675
...
@@ -5,17 +5,25 @@ const appconfig = system.getSysConfig();
...
@@ -5,17 +5,25 @@ const appconfig = system.getSysConfig();
* 交付单表
* 交付单表
*/
*/
module
.
exports
=
(
db
,
DataTypes
)
=>
{
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"delivery
_
bill"
,
{
return
db
.
define
(
"deliverybill"
,
{
delivery_code
:
{
//交付单编号
delivery_code
:
{
//交付单编号
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
source_number
:
{
// 来源单号
(订单编号)
source_number
:
{
// 来源单号
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
source
:
{
// 渠道来源
source_name
:
{
// 渠道名称
allowNull
:
false
,
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
demand_code
:
{
// 商机编号
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
scheme_number
:
{
// 方案编号
allowNull
:
true
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
product_code
:
{
// 产品编码
product_code
:
{
// 产品编码
...
@@ -26,15 +34,15 @@ module.exports = (db, DataTypes) => {
...
@@ -26,15 +34,15 @@ module.exports = (db, DataTypes) => {
allowNull
:
false
,
allowNull
:
false
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
address
:
{
// 区域地址
service_
address
:
{
// 区域地址
allowNull
:
false
,
allowNull
:
false
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
service
_info
:
{
//服务概况
delivery
_info
:
{
//服务概况
allowNull
:
false
,
allowNull
:
false
,
type
:
DataTypes
.
JSON
type
:
DataTypes
.
JSON
},
},
status
:
{
// 服务单流转状态
delivery_
status
:
{
// 服务单流转状态
allowNull
:
false
,
allowNull
:
false
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
...
@@ -50,13 +58,12 @@ module.exports = (db, DataTypes) => {
...
@@ -50,13 +58,12 @@ module.exports = (db, DataTypes) => {
allowNull
:
true
,
allowNull
:
true
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
facilitator_id
:
{
// 服务商id
service_company_id
:
{
// 公司id
allowNull
:
true
,
allowNull
:
false
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
service_company_name
:
{
// 公司
名称
facilitator_name
:
{
// 服务商
名称
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
salesman_opcode
:
{
// 组织架构路径
salesman_opcode
:
{
// 组织架构路径
...
@@ -71,7 +78,7 @@ module.exports = (db, DataTypes) => {
...
@@ -71,7 +78,7 @@ module.exports = (db, DataTypes) => {
allowNull
:
true
,
allowNull
:
true
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
salesman_phone
_number
:
{
// 业务员联系方式
salesman_phone
:
{
// 业务员联系方式
allowNull
:
true
,
allowNull
:
true
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
}
}
...
...
icp-deliver/app/base/db/models/delivery/scheme.js
View file @
5f4ca675
...
@@ -12,14 +12,14 @@ module.exports = (db, DataTypes) => {
...
@@ -12,14 +12,14 @@ module.exports = (db, DataTypes) => {
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
scheme_number
:
{
//方案编号
scheme_number
:
{
//方案编号
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
scheme_info
:
{
//方案详情
scheme_info
:
{
//方案详情
allowNull
:
false
,
allowNull
:
false
,
type
:
DataTypes
.
JSON
type
:
DataTypes
.
JSON
},
},
status
:
{
//方案状态
s
cheme_s
tatus
:
{
//方案状态
allowNull
:
false
,
allowNull
:
false
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
...
@@ -27,10 +27,39 @@ module.exports = (db, DataTypes) => {
...
@@ -27,10 +27,39 @@ module.exports = (db, DataTypes) => {
allowNull
:
true
,
allowNull
:
true
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
remark
:
{
//备注
remark_info
:
{
//备注
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
bizopt_id
:
{
//商机id
allowNull
:
false
,
type
:
DataTypes
.
STRING
},
facilitator_id
:
{
//服务商id
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
facilitator_name
:
{
//服务商名称
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
salesman_opcode
:
{
//组织架构路径
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
salesman_id
:
{
//业务员id
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
salesman_name
:
{
//业务员名称
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
salesman_phone
:
{
//业务员联系方式
allowNull
:
true
,
allowNull
:
true
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
}
}
},
{
},
{
paranoid
:
false
,
//假的删除
paranoid
:
false
,
//假的删除
underscored
:
true
,
underscored
:
true
,
...
@@ -38,7 +67,7 @@ module.exports = (db, DataTypes) => {
...
@@ -38,7 +67,7 @@ module.exports = (db, DataTypes) => {
freezeTableName
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
//freezeTableName: true,
// define the table's name
// define the table's name
tableName
:
'scheme'
,
tableName
:
'scheme
_information
'
,
validate
:
{
validate
:
{
},
},
...
...
icp-deliver/app/base/db/models/delivery/status_log.js
View file @
5f4ca675
...
@@ -14,7 +14,11 @@ module.exports = (db, DataTypes) => {
...
@@ -14,7 +14,11 @@ module.exports = (db, DataTypes) => {
allowNull
:
false
,
allowNull
:
false
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
},
status
:
{
// 流转状态
status_date
:
{
// 状态日期
allowNull
:
true
,
type
:
DataTypes
.
DATE
},
status_code
:
{
// 流转状态
allowNull
:
false
,
allowNull
:
false
,
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
}
}
...
...
icp-deliver/app/base/service/impl/bizchance/bizoptSve.js
View file @
5f4ca675
...
@@ -21,8 +21,8 @@ class BizoptService extends ServiceBase {
...
@@ -21,8 +21,8 @@ class BizoptService extends ServiceBase {
customer_number
:
data
.
business_info
.
phone
,
customer_number
:
data
.
business_info
.
phone
,
annual_report
:
data
.
business_info
.
annual_report
||
false
,
annual_report
:
data
.
business_info
.
annual_report
||
false
,
content
:
data
.
business_info
.
content
,
content
:
data
.
business_info
.
content
,
address
:
data
.
address
,
service_address
:
data
.
service_
address
,
source
:
data
.
sourc
e
,
source
_name
:
data
.
source_nam
e
,
business_status
:
data
.
business_status
,
business_status
:
data
.
business_status
,
source_number
:
data
.
source_number
,
source_number
:
data
.
source_number
,
updated_at
:
moment
(
data
.
updated_at
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
updated_at
:
moment
(
data
.
updated_at
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
...
@@ -34,13 +34,12 @@ class BizoptService extends ServiceBase {
...
@@ -34,13 +34,12 @@ class BizoptService extends ServiceBase {
schemeData
=
{
schemeData
=
{
id
:
data
.
scheme
.
id
,
id
:
data
.
scheme
.
id
,
scheme_number
:
data
.
scheme
.
scheme_number
,
scheme_number
:
data
.
scheme
.
scheme_number
,
status
:
data
.
scheme
.
status
,
scheme_status
:
data
.
scheme
.
scheme_status
,
address
:
data
.
address
,
reject_reason
:
data
.
scheme
.
reject_reason
,
reject_reason
:
data
.
scheme
.
reject_reason
||
"无"
,
company_name
:
data
.
scheme
.
scheme_info
.
company
,
company_name
:
data
.
scheme
.
scheme_info
.
company
,
address
:
data
.
scheme
.
scheme_info
.
address
,
address
:
data
.
scheme
.
scheme_info
.
address
,
annual_report
:
data
.
scheme
.
scheme_info
.
annual_report
||
false
,
annual_report
:
data
.
scheme
.
scheme_info
.
annual_report
||
false
,
remark
:
data
.
scheme
.
remark
||
"无"
,
remark
_info
:
data
.
scheme
.
remark_info
,
updated_at
:
moment
(
data
.
scheme
.
updated_at
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
updated_at
:
moment
(
data
.
scheme
.
updated_at
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
created_at
:
moment
(
data
.
scheme
.
created_at
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
created_at
:
moment
(
data
.
scheme
.
created_at
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
}
}
...
@@ -85,18 +84,18 @@ class BizoptService extends ServiceBase {
...
@@ -85,18 +84,18 @@ class BizoptService extends ServiceBase {
this
.
statuslogDao
.
create
({
this
.
statuslogDao
.
create
({
flow_type
:
system
.
FLOWCODE
.
BIZ
,
flow_type
:
system
.
FLOWCODE
.
BIZ
,
flow_id
:
pobj
.
bizId
,
flow_id
:
pobj
.
bizId
,
status
:
system
.
BUSSTATUS
.
CLOSED
status
_code
:
system
.
BUSSTATUS
.
CLOSED
});
});
if
(
schemeResult
)
{
if
(
schemeResult
)
{
await
this
.
schemeDao
.
updateByWhere
({
await
this
.
schemeDao
.
updateByWhere
({
status
:
system
.
SCHEMESTATUS
.
CLOSED
s
cheme_s
tatus
:
system
.
SCHEMESTATUS
.
CLOSED
},
{
},
{
id
:
schemeResult
.
id
id
:
schemeResult
.
id
},
t
);
},
t
);
this
.
statuslogDao
.
create
({
this
.
statuslogDao
.
create
({
flow_type
:
system
.
FLOWCODE
.
SCHEME
,
flow_type
:
system
.
FLOWCODE
.
SCHEME
,
flow_id
:
schemeResult
.
id
,
flow_id
:
schemeResult
.
id
,
status
:
system
.
SCHEMESTATUS
.
CLOSED
status
_code
:
system
.
SCHEMESTATUS
.
CLOSED
});
});
}
}
return
"success"
return
"success"
...
...
icp-deliver/app/base/service/impl/bizchance/schemeSve.js
View file @
5f4ca675
...
@@ -23,7 +23,7 @@ class SchemeService extends ServiceBase {
...
@@ -23,7 +23,7 @@ class SchemeService extends ServiceBase {
let
schemeData
=
await
this
.
dao
.
findOne
({
let
schemeData
=
await
this
.
dao
.
findOne
({
bizopt_id
:
data
.
bizopt_id
bizopt_id
:
data
.
bizopt_id
})
})
if
(
schemeData
&&
[
system
.
SCHEMESTATUS
.
WAITINGCONFIRM
,
system
.
SCHEMESTATUS
.
CLOSED
].
includes
(
schemeData
.
status
))
{
if
(
schemeData
&&
[
system
.
SCHEMESTATUS
.
WAITINGCONFIRM
,
system
.
SCHEMESTATUS
.
CLOSED
].
includes
(
schemeData
.
s
cheme_s
tatus
))
{
throw
new
Error
(
"此方案状态下不可操作"
);
throw
new
Error
(
"此方案状态下不可操作"
);
}
}
if
(
!
schemeData
)
{
if
(
!
schemeData
)
{
...
@@ -48,14 +48,14 @@ class SchemeService extends ServiceBase {
...
@@ -48,14 +48,14 @@ class SchemeService extends ServiceBase {
this
.
statuslogDao
.
create
({
this
.
statuslogDao
.
create
({
flow_type
:
system
.
FLOWCODE
.
BIZ
,
flow_type
:
system
.
FLOWCODE
.
BIZ
,
flow_id
:
data
.
bizopt_id
,
flow_id
:
data
.
bizopt_id
,
status
:
system
.
BUSSTATUS
.
WAITINGCONFIRM
status
_code
:
system
.
BUSSTATUS
.
WAITINGCONFIRM
});
});
let
scheme_id
=
null
;
let
scheme_id
=
null
;
if
(
schemeData
)
{
if
(
schemeData
)
{
await
this
.
dao
.
updateByWhere
({
await
this
.
dao
.
updateByWhere
({
...
data
,
...
data
,
demand_code
:
bizData
.
demand_code
,
demand_code
:
bizData
.
demand_code
,
status
:
system
.
SCHEMESTATUS
.
WAITINGCONFIRM
s
cheme_s
tatus
:
system
.
SCHEMESTATUS
.
WAITINGCONFIRM
},
{
},
{
id
:
schemeData
.
id
id
:
schemeData
.
id
},
t
);
},
t
);
...
@@ -64,7 +64,7 @@ class SchemeService extends ServiceBase {
...
@@ -64,7 +64,7 @@ class SchemeService extends ServiceBase {
let
schemeResult
=
await
this
.
dao
.
create
({
let
schemeResult
=
await
this
.
dao
.
create
({
...
data
,
...
data
,
demand_code
:
bizData
.
demand_code
,
demand_code
:
bizData
.
demand_code
,
status
:
system
.
SCHEMESTATUS
.
WAITINGCONFIRM
,
s
cheme_s
tatus
:
system
.
SCHEMESTATUS
.
WAITINGCONFIRM
,
bizopt_id
:
data
.
bizopt_id
bizopt_id
:
data
.
bizopt_id
},
t
);
},
t
);
scheme_id
=
schemeResult
.
id
;
scheme_id
=
schemeResult
.
id
;
...
@@ -72,7 +72,7 @@ class SchemeService extends ServiceBase {
...
@@ -72,7 +72,7 @@ class SchemeService extends ServiceBase {
this
.
statuslogDao
.
create
({
this
.
statuslogDao
.
create
({
flow_type
:
system
.
FLOWCODE
.
SCHEME
,
flow_type
:
system
.
FLOWCODE
.
SCHEME
,
flow_id
:
scheme_id
,
flow_id
:
scheme_id
,
status
:
system
.
SCHEMESTATUS
.
WAITINGCONFIRM
status
_code
:
system
.
SCHEMESTATUS
.
WAITINGCONFIRM
});
});
return
{
bizId
:
data
.
bizopt_id
};
return
{
bizId
:
data
.
bizopt_id
};
}
catch
(
err
)
{
}
catch
(
err
)
{
...
...
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