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
e06d083d
Commit
e06d083d
authored
Feb 13, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
36106559
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
158 additions
and
11 deletions
+158
-11
center-order/app/base/api/impl/action/policy.js
+8
-3
center-order/app/base/db/metadata/apps/platform.js
+3
-1
center-order/app/base/db/models/dbpolicy/policyneed.js
+12
-2
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
+3
-3
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
+128
-0
center-order/表的更新
+4
-2
No files found.
center-order/app/base/api/impl/action/policy.js
View file @
e06d083d
...
@@ -25,6 +25,9 @@ class PolicyAPI extends APIBase {
...
@@ -25,6 +25,9 @@ class PolicyAPI extends APIBase {
if
(
!
pobj
.
userInfo
)
{
if
(
!
pobj
.
userInfo
)
{
return
system
.
getResult
(
system
.
noLogin
,
"user no login!"
);
return
system
.
getResult
(
system
.
noLogin
,
"user no login!"
);
}
}
if
(
!
pobj
.
appInfo
)
{
return
system
.
getResult
(
system
.
noLogin
,
"app is null!"
);
}
}
}
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
req
);
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
req
);
return
result
;
return
result
;
...
@@ -36,13 +39,15 @@ class PolicyAPI extends APIBase {
...
@@ -36,13 +39,15 @@ class PolicyAPI extends APIBase {
opResult
=
await
this
.
policyinfoSve
.
policyQuery
(
pobj
);
opResult
=
await
this
.
policyinfoSve
.
policyQuery
(
pobj
);
break
;
break
;
case
"submitPolicyNeed"
:
//政策申请提报
case
"submitPolicyNeed"
:
//政策申请提报
opResult
=
system
.
getResult
(
null
,
"接口开发中"
);
// opResult = system.getResult(null, "接口开发中");
opResult
=
this
.
policyneedSve
.
submitPolicyNeed
(
pobj
);
break
;
break
;
case
"getPolicyNeedList"
:
//获取政策申请列表
case
"getPolicyNeedList"
:
//获取政策申请列表
opResult
=
system
.
getResult
(
null
,
"接口开发中"
);
// opResult = system.getResult(null, "接口开发中");
opResult
=
this
.
policyneedSve
.
getPolicyNeedList
(
pobj
);
break
;
break
;
case
"submitPolicyNeedNotes"
:
//申请信息备注提交
case
"submitPolicyNeedNotes"
:
//申请信息备注提交
opResult
=
system
.
getResult
(
null
,
"接口开发中"
);
opResult
=
this
.
policyneedSve
.
submitPolicyNeedNotes
(
pobj
);
break
;
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
...
center-order/app/base/db/metadata/apps/platform.js
View file @
e06d083d
...
@@ -69,7 +69,8 @@ module.exports = {
...
@@ -69,7 +69,8 @@ module.exports = {
//凭单类型
//凭单类型
"direction_type"
:
{
"sr"
:
"收"
,
"zc"
:
"支"
},
"direction_type"
:
{
"sr"
:
"收"
,
"zc"
:
"支"
},
"push_return_type"
:
{
"0"
:
"推送失败"
,
"1"
:
"推送成功"
},
"push_return_type"
:
{
"0"
:
"推送失败"
,
"1"
:
"推送成功"
},
"policy_type"
:{
'zh'
:
'综合'
,
'fzbt'
:
'房租补贴'
,
'jrdk'
:
'金融贷款'
,
'zdfc'
:
'重点扶持'
,
'ssjm'
:
'税收减免'
},
"policy_type"
:{
'fzbt'
:
'租金减免'
,
'jrdk'
:
'金融贷款'
,
'zdfc'
:
'扶持措施'
,
'ssjm'
:
'税收优惠'
,
'rlzy'
:
'人力资源'
},
"customer_intention"
:{
"dgj"
:
"待跟进"
,
"yyx"
:
"有意向"
,
"wyx"
:
"无意向"
},
},
},
}
}
}
}
\ No newline at end of file
center-order/app/base/db/models/dbpolicy/policyneed.js
View file @
e06d083d
...
@@ -9,12 +9,22 @@ module.exports = (db, DataTypes) => {
...
@@ -9,12 +9,22 @@ module.exports = (db, DataTypes) => {
industry
:
DataTypes
.
STRING
(
100
),
// 行业名称
industry
:
DataTypes
.
STRING
(
100
),
// 行业名称
region
:
DataTypes
.
STRING
(
100
),
// 地区
region
:
DataTypes
.
STRING
(
100
),
// 地区
mobile
:
DataTypes
.
STRING
(
100
),
// 联系电话
mobile
:
DataTypes
.
STRING
(
100
),
// 联系电话
policy_id
:
DataTypes
.
INTEGER
,
// 政策id
policy_id
:
DataTypes
.
INTEGER
,
// 政策id
policySnapshot
:
DataTypes
.
TEXT
(
'long'
),
// 政策快照
policySnapshot
:
DataTypes
.
TEXT
(
'long'
),
// 政策快照
applyDate
:
DataTypes
.
DATE
,
// 申请日期
applyDate
:
DataTypes
.
DATE
,
// 申请日期
opNotes
:
DataTypes
.
TEXT
(
'long'
),
// 备注
opNotes
:
DataTypes
.
TEXT
(
'long'
),
// 备注
createUserId
:
DataTypes
.
INTEGER
,
// 创建用户id
createUserId
:
DataTypes
.
INTEGER
,
// 创建用户id
popularizeUserId
:
DataTypes
.
INTEGER
,
// 推广人id,即业务员id
popularizeUserId
:
DataTypes
.
INTEGER
,
// 推广人id,即业务员id
popularizeUserCode
:
DataTypes
.
STRING
(
64
),
// 推广人帐号
customerIntentionName
:
DataTypes
.
STRING
(
100
),
// 客户意向
customerIntention
:{
// "customer_intention":{"dgj":"待跟进","yyx":"有意向","wyx":"无意向"},
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
customer_intention
),
set
:
function
(
val
)
{
this
.
setDataValue
(
"customerIntention"
,
val
);
this
.
setDataValue
(
"customerIntentionName"
,
uiconfig
.
config
.
pdict
.
customer_intention
[
val
]);
}
},
},
{
},
{
paranoid
:
false
,
//假的删除
paranoid
:
false
,
//假的删除
underscored
:
true
,
underscored
:
true
,
...
...
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
View file @
e06d083d
...
@@ -10,7 +10,7 @@ class PolicyinfoService extends ServiceBase {
...
@@ -10,7 +10,7 @@ class PolicyinfoService extends ServiceBase {
var
obj
=
pobj
.
actionBody
;
var
obj
=
pobj
.
actionBody
;
var
app
=
pobj
.
appInfo
;
var
app
=
pobj
.
appInfo
;
var
paramObj
=
{
uapp_id
:
app
.
uapp_id
};
var
paramObj
=
{
uapp_id
:
app
.
uapp_id
};
var
attributes
=
[
"policyType"
,
"policyTypeName"
,
"policyDate"
,
"policyContent"
,
"policyCity"
,
"policyProvince"
,
var
attributes
=
[
"
id"
,
"
policyType"
,
"policyTypeName"
,
"policyDate"
,
"policyContent"
,
"policyCity"
,
"policyProvince"
,
"policyLinkUrl"
,
"policySource"
,
"policyName"
,
"policyNo"
];
"policyLinkUrl"
,
"policySource"
,
"policyName"
,
"policyNo"
];
if
(
obj
){
if
(
obj
){
if
(
obj
.
policyProvince
){
if
(
obj
.
policyProvince
){
...
@@ -25,8 +25,8 @@ class PolicyinfoService extends ServiceBase {
...
@@ -25,8 +25,8 @@ class PolicyinfoService extends ServiceBase {
console
.
log
(
paramObj
);
console
.
log
(
paramObj
);
}
}
var
result
=
{};
var
result
=
{};
//"policy_type":{'
zh':'综合','fzbt':'房租补贴','jrdk':'金融贷款','zdfc':'重点扶持','ssjm':'税收减免
'},
//"policy_type":{'
fzbt':'租金减免','jrdk':'金融贷款','zdfc':'扶持措施','ssjm':'税收优惠','rlzy':'人力资源
'},
result
[
"
zh"
]
=
await
this
.
findByParams
(
"zh
"
,
paramObj
,
attributes
);
result
[
"
rlzy"
]
=
await
this
.
findByParams
(
"rlzy
"
,
paramObj
,
attributes
);
result
[
"fzbt"
]
=
await
this
.
findByParams
(
"fzbt"
,
paramObj
,
attributes
);
result
[
"fzbt"
]
=
await
this
.
findByParams
(
"fzbt"
,
paramObj
,
attributes
);
result
[
"jrdk"
]
=
await
this
.
findByParams
(
"jrdk"
,
paramObj
,
attributes
);
result
[
"jrdk"
]
=
await
this
.
findByParams
(
"jrdk"
,
paramObj
,
attributes
);
result
[
"zdfc"
]
=
await
this
.
findByParams
(
"zdfc"
,
paramObj
,
attributes
);
result
[
"zdfc"
]
=
await
this
.
findByParams
(
"zdfc"
,
paramObj
,
attributes
);
...
...
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
View file @
e06d083d
...
@@ -3,6 +3,134 @@ const ServiceBase = require("../../sve.base");
...
@@ -3,6 +3,134 @@ const ServiceBase = require("../../sve.base");
class
PolicyneedService
extends
ServiceBase
{
class
PolicyneedService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"dbpolicy"
,
ServiceBase
.
getDaoName
(
PolicyneedService
));
super
(
"dbpolicy"
,
ServiceBase
.
getDaoName
(
PolicyneedService
));
this
.
policyinfoDao
=
system
.
getObject
(
"db.dbpolicy.policyinfoDao"
);
}
//提交政策需求
async
submitPolicyNeed
(
pobj
){
var
user
=
pobj
.
userInfo
;
var
app
=
pobj
.
appInfo
;
var
obj
=
pobj
.
actionBody
;
var
paramObj
=
{
uapp_id
:
app
.
uapp_id
};
if
(
!
obj
.
contacts
){
return
system
.
getResult
(
null
,
"联系人不能为空"
);
}
if
(
!
obj
.
mobile
){
return
system
.
getResult
(
null
,
"联系电话不能为空"
);
}
if
(
obj
.
policy_id
){
var
policyinfo
=
await
this
.
policyinfoDao
.
model
.
findOne
({
where
:{
id
:
obj
.
policy_id
},
raw
:
true
});
if
(
policyinfo
&&
policyinfo
.
id
){
paramObj
[
"policySnapshot"
]
=
JSON
.
stringify
(
policyinfo
);
paramObj
[
"policy_id"
]
=
obj
.
policy_id
;
// paramObj["policyName"] = policyinfo.policyName;
}
}
paramObj
[
"contacts"
]
=
obj
.
contacts
;
paramObj
[
"mobile"
]
=
obj
.
mobile
;
paramObj
[
"company"
]
=
obj
.
company
;
paramObj
[
"industry"
]
=
obj
.
industry
;
paramObj
[
"region"
]
=
obj
.
region
;
paramObj
[
"applyDate"
]
=
new
Date
();
if
(
obj
.
popularizeUserCode
){
paramObj
[
"popularizeUserCode"
]
=
obj
.
popularizeUserCode
;
}
var
policyNeed
=
await
this
.
dao
.
create
(
paramObj
);
return
system
.
getResultSuccess
();
}
//需求列表
async
getPolicyNeedList
(
pobj
){
var
user
=
pobj
.
userInfo
;
var
app
=
pobj
.
appInfo
;
var
obj
=
pobj
.
actionBody
||
{};
if
(
!
user
||
!
user
.
channel_userid
){
return
system
.
getResult
(
null
,
"未知用户"
);
}
var
pageSize
=
Number
(
obj
.
pageSize
||
20
);
var
pageIndex
=
Number
(
obj
.
pageIndex
||
1
);
var
from
=
pageIndex
==
1
?
0
:
Number
((
pageIndex
-
1
)
*
pageSize
);
if
(
pageSize
>
50
)
{
pageSize
=
50
;
}
var
sql
=
"select * from "
+
"(select id,uapp_id,contacts,customerIntention,customerIntentionName,company,industry,region,mobile,policy_id,applyDate,opNotes,popularizeUserCode "
+
"from b_policy_need where uapp_id="
+
app
.
uapp_id
+
" and popularizeUserCode='"
+
user
.
channel_userid
+
"') as need "
+
"LEFT JOIN "
+
"(select id, policyNo,policyName,policyType,policyTypeName,policySource,policyLinkUrl,"
+
"policyDate,policyProvince,policyCity,policyContent from b_policy_info) as policy "
+
"on need.policy_id=policy.id where 1=1 "
;
// var sql = "SELECT * from b_policy_need where popularizeUserCode='"+user.channel_userid+"' and uapp_id="+app.uapp_id;
if
(
obj
.
policyName
){
sql
=
sql
+
" and policyName like '%"
+
obj
.
policyName
+
"%'"
;
}
if
(
obj
.
policyProvince
){
sql
=
sql
+
" and policyProvince ='"
+
obj
.
policyProvince
+
"'"
;
if
(
obj
.
policyCity
){
sql
=
sql
+
" and policyCity ='"
+
obj
.
policyCity
+
"'"
;
}
}
if
(
obj
.
policyType
){
sql
=
sql
+
" and policyType = '"
+
obj
.
policyType
+
"'"
;
}
if
(
obj
.
customerIntention
){
sql
=
sql
+
" and customerIntention = '"
+
obj
.
customerIntention
+
"'"
;
}
sql
=
sql
+
" order by need.id desc LIMIT "
+
pageSize
+
" OFFSET "
+
from
+
""
;
console
.
log
(
sql
);
var
sqlCount
=
"SELECT count(1) as dataCount FROM b_policy_need where "
+
" popularizeUserCode='"
+
user
.
channel_userid
+
"' and uapp_id="
+
app
.
uapp_id
;
var
tmpResult
=
await
this
.
customQuery
(
sql
,{});
var
tmpResultCount
=
await
this
.
customQuery
(
sqlCount
,{});
// if (!tmpResult || tmpResult.length == 0) {
// return system.getResultSuccess(null, "暂无数据");
// }
var
result
=
system
.
getResultSuccess
(
tmpResult
);
result
.
dataCount
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
return
result
;
}
//需求备注提交
async
submitPolicyNeedNotes
(
pobj
){
var
user
=
pobj
.
userInfo
;
var
app
=
pobj
.
appInfo
;
var
obj
=
pobj
.
actionBody
||
{};
if
(
!
user
||
!
user
.
channel_userid
){
return
system
.
getResult
(
null
,
"未知用户"
);
}
if
(
!
obj
.
needId
){
return
system
.
getResult
(
null
,
"需求id不能为空"
);
}
if
(
!
obj
.
customerIntention
){
return
system
.
getResult
(
null
,
"客户意向不能为空"
);
}
if
(
!
obj
.
intentionContent
){
return
system
.
getResult
(
null
,
"意向内容不能为空"
);
}
var
policyneed
=
await
this
.
dao
.
model
.
findOne
({
where
:{
id
:
obj
.
needId
,
uapp_id
:
app
.
uapp_id
},
raw
:
true
});
if
(
!
policyneed
||
!
policyneed
.
id
){
return
system
.
getResult
(
null
,
"未知政策需求"
);
}
if
(
policyneed
.
popularizeUserCode
!=
user
.
channel_userid
){
return
system
.
getResult
(
null
,
"非法操作,只能修改本人数据"
);
}
var
paramObj
=
{
id
:
obj
.
needId
,
customerIntention
:
obj
.
customerIntention
};
var
noteparam
=
{
customerIntention
:
obj
.
customerIntention
,
intentionContent
:
obj
.
intentionContent
,
submitDate
:
new
Date
()};
if
(
policyneed
.
opNotes
){
var
notes
=
JSON
.
parse
(
policyneed
.
opNotes
);
var
noteList
=
notes
.
data
;
noteList
.
push
(
noteparam
);
paramObj
[
"opNotes"
]
=
JSON
.
stringify
({
data
:
noteList
});
}
else
{
paramObj
[
"opNotes"
]
=
JSON
.
stringify
({
data
:[
noteparam
]});
}
var
newPolicyNeed
=
await
this
.
dao
.
update
(
paramObj
);
return
system
.
getResultSuccess
();
}
}
}
}
module
.
exports
=
PolicyneedService
;
module
.
exports
=
PolicyneedService
;
center-order/表的更新
View file @
e06d083d
示例:--
--------------------------------开始--------------------------------------------------------------------
示例:--
--------------------------------开始--------------------------------------------------------------------
...
@@ -19,7 +19,7 @@ CREATE TABLE `b_policy_info` (
...
@@ -19,7 +19,7 @@ CREATE TABLE `b_policy_info` (
`uapp_id` int(11) NULL DEFAULT NULL,
`uapp_id` int(11) NULL DEFAULT NULL,
`policyNo` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '政策编号',
`policyNo` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '政策编号',
`policyName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '政策名称',
`policyName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '政策名称',
`policyType` enum('
zh','fzbt','jrdk','zdfc','ssjm') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'zh' COMMENT '政策类型 \'zh\':\'综合
\',\'fzbt\':\'房租补贴\',\'jrdk\':\'金融贷款\',\'zdfc\':\'重点扶持\',\'ssjm\':\'税收减免\'',
`policyType` enum('
rlzy','fzbt','jrdk','zdfc','ssjm') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'zh' COMMENT '政策类型 \'rlzy\':\'人力资源
\',\'fzbt\':\'房租补贴\',\'jrdk\':\'金融贷款\',\'zdfc\':\'重点扶持\',\'ssjm\':\'税收减免\'',
`policyTypeName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '政策类型名称',
`policyTypeName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '政策类型名称',
`policySource` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '政策出处',
`policySource` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '政策出处',
`policyLinkUrl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '政策链接',
`policyLinkUrl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '政策链接',
...
@@ -53,5 +53,6 @@ CREATE TABLE `b_policy_need` (
...
@@ -53,5 +53,6 @@ CREATE TABLE `b_policy_need` (
`version` int(11) NOT NULL DEFAULT 0,
`version` int(11) NOT NULL DEFAULT 0,
`createUserId` int(11) NULL DEFAULT NULL COMMENT '创建用户id',
`createUserId` int(11) NULL DEFAULT NULL COMMENT '创建用户id',
`popularizeUserId` int(11) NULL DEFAULT NULL COMMENT '推广人id,即业务员id',
`popularizeUserId` int(11) NULL DEFAULT NULL COMMENT '推广人id,即业务员id',
`popularizeUserCode` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '推广人帐号',
PRIMARY KEY (`id`) USING BTREE
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
\ No newline at end of file
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