Commit 1b11abe8 by 宋毅

Merge branch 'center-order' of gitlab.gongsibao.com:jiangyong/zhichan into center-order

parents 11a1ec40 7bc96c63
...@@ -6,6 +6,8 @@ class IcAPI extends APIBase { ...@@ -6,6 +6,8 @@ class IcAPI extends APIBase {
super(); super();
// this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve"); // this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve"); this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
this.needinfoSve = system.getObject("service.dbneed.needinfoSve");
this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
...@@ -17,7 +19,7 @@ class IcAPI extends APIBase { ...@@ -17,7 +19,7 @@ class IcAPI extends APIBase {
if (!pobj.actionType) { if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空"); return system.getResult(null, "actionType参数不能为空");
} }
if(pobj.actionType=='getPolicyNeedList' || pobj.actionType=='submitPolicyNeedNotes' ){ if (pobj.actionType == 'getPolicyNeedList' || pobj.actionType == 'submitPolicyNeedNotes') {
if (!pobj.userInfo) { if (!pobj.userInfo) {
return system.getResult(system.noLogin, "user no login!"); return system.getResult(system.noLogin, "user no login!");
} }
...@@ -49,6 +51,15 @@ class IcAPI extends APIBase { ...@@ -49,6 +51,15 @@ class IcAPI extends APIBase {
case "abolishProgramme"://服务商方案作废 case "abolishProgramme"://服务商方案作废
opResult = await this.needsolutionSve.abolishProgramme(pobj); opResult = await this.needsolutionSve.abolishProgramme(pobj);
break; break;
case "submitSolution"://提交需求
opResult = await this.needinfoSve.createicneedinfo(pobj);
break;
case "paySuccess"://支付成功回调
opResult = await this.orderinfoSve.createsolutionOrder(pobj);
break;
case "solutionClose"://需求关闭
opResult = await this.needinfoSve.solutionClose(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -69,10 +69,10 @@ module.exports = { ...@@ -69,10 +69,10 @@ module.exports = {
//凭单类型 //凭单类型
"direction_type": { "sr": "收", "zc": "支" }, "direction_type": { "sr": "收", "zc": "支" },
"push_return_type": { "0": "推送失败", "1": "推送成功" }, "push_return_type": { "0": "推送失败", "1": "推送成功" },
"push_chance_type": { "wts": "未推送", "yts": "已推送", "ygj": "已跟进", "ycd": "已成单" }, "push_chance_type": { "wts": "未推送", "yts": "已推送", "ygj": "已跟进", "ycd": "已成单","ygb" :"已关闭"},
"policy_type":{'fzbt':'租金减免','jrdk':'金融贷款','zdfc':'行政措施','ssjm':'税收优惠','rlzy':'人力资源'}, "policy_type":{'fzbt':'租金减免','jrdk':'金融贷款','zdfc':'行政措施','ssjm':'税收优惠','rlzy':'人力资源'},
"customer_intention":{"dgj":"待跟进","yyx":"有意向","wyx":"无意向"}, "customer_intention":{"dgj":"待跟进","yyx":"有意向","wyx":"无意向"},
"solution_status":{"ytj":"已提交","yfk":"已付款","yzf":"已作废","ytk":"已退款"}, "solution_status":{"dqr":"待确认","ywc":"已完成","yzf":"已作废"},
}, },
} }
......
...@@ -31,6 +31,10 @@ module.exports = (db, DataTypes) => { ...@@ -31,6 +31,10 @@ module.exports = (db, DataTypes) => {
}, },
city: DataTypes.STRING(50), // 城市 city: DataTypes.STRING(50), // 城市
province: DataTypes.STRING(50), // 省份 province: DataTypes.STRING(50), // 省份
typeCode: DataTypes.STRING(50), //类型编码',
typeName: DataTypes.STRING(50), //类型名称',
channelTypeCode: DataTypes.STRING(50), //渠道类型编码',
channelTypeName: DataTypes.STRING(50), //渠道类型名称',
}, { }, {
paranoid: true,//假的删除 paranoid: true,//假的删除
underscored: true, underscored: true,
......
...@@ -10,6 +10,7 @@ class OrderInfoService extends ServiceBase { ...@@ -10,6 +10,7 @@ class OrderInfoService extends ServiceBase {
this.ordercontactsDao = system.getObject("db.dbcorder.ordercontactsDao"); this.ordercontactsDao = system.getObject("db.dbcorder.ordercontactsDao");
this.orderReceiptVoucherDao = system.getObject("db.dbcpay.orderreceiptvoucherDao"); this.orderReceiptVoucherDao = system.getObject("db.dbcpay.orderreceiptvoucherDao");
this.moneyJourneyDao = system.getObject("db.dbcpay.moneyjourneyDao"); this.moneyJourneyDao = system.getObject("db.dbcpay.moneyjourneyDao");
this.needsolutionDao = system.getObject("db.dbneed.needsolutionDao");
} }
//----------------------订单创建-----------start---------------- //----------------------订单创建-----------start----------------
...@@ -284,97 +285,32 @@ class OrderInfoService extends ServiceBase { ...@@ -284,97 +285,32 @@ class OrderInfoService extends ServiceBase {
return system.getResultSuccess(); return system.getResultSuccess();
} }
// caseService 拟开展服务项目 多 必 /**
// caseCustomerType 目标用户 多 必 * 创建商标订单
// caseProfitType 盈利模式 多 必 * @param {*} pobj
// caseApprovalProgram 需专项审批的项目 多 * {
// //caseApprovalProgramName 需专项审批的项目 "actionType": "addOrder",
// //caseApprovalProgramUrl 需专项审批的项目文件 "actionBody": {
// caseWeb 网站或APP情况 "orderNo":"orderNo"
// caseWebName 网站或APP情况名称 必 "channelItemCode":"zzsbzc",
// caseApp 网站或APP情况 "id":1,
// caseAppName 网站或APP情况名称 "quantity":1,
// caseWebCertificateUrl 公司域名证书 必 "totalSum":300,
// caseTMCertificateUrl 公司商标证书 必 "channelOrder":null,
"deliveryData":null
}
// 必 }
// apDxProgramType 申请的电信业务种类 默认 */
// apProgramScope 申请的业务覆盖范围 默认 async createTmOrder(pobj) {
// apCompany 公司名称 var packagingTmResult = await this.packagingTmDeliveryData(pobj, pobj.actionBody);
// apCompanyCode 企业统一社会信用代码 if (packagingTmResult.status != 0) {
// apCompanyRegCapital 注册资本 return packagingTmResult;
// apCompanyRegAddr 注册地址 }
// apCompanyTel 公司固定电话
// apCompanyLicenseurl 企业法人营业执照
// apCompanyWorkAddr 主要办公地址
// apCompanyType 公司性质
// 必
// companyCate 公司目前主营业务所属行业
// companyPersonnelNum 公司现有人员规模
// companyBusinessScope 公司经营规模
// companyLegalpersonName 法定代表人姓名
// companyLpCertificateCode 法定代表人证件号
// companyLpCertificateType 法定代表人证件类型
// companyLpPhone 法定代表人手机
// companyLpEmail 法定代表人邮箱
// companyLpCertificateUrl 法定代表人身份证
// companyLicenserName 许可负责人姓名
// companyLoCertificateCode 许可负责人证件号
// companyLoCertificateType 许可负责人证件类型
// companyLoPhone 许可负责人手机
// companyLoEmail 许可负责人邮箱
// companyLoCertificateUrl 许可负责人身份证
// companyCsName 客服负责人姓名
// companyCsCertificateCode 客服负责人证件号
// companyCsCertificateType 客服负责人证件类型
// companyCsPhone 客服负责人手机
// companyCsEmail 客服负责人邮箱
// companyCsCertificateUrl 客服负责人身份证
// companySafetyName 安全负责人姓名
// companySfCertificateCode 安全负责人证件号
// companySfCertificateType 安全负责人证件类型
// companySfPhone 安全负责人手机
// companySfEmail 安全负责人邮箱
// companySfCertificateUrl 安全负责人身份证
// shebaoCertificateUrl 社保证明
// webSafetyOrginfo 网络与信息安全管理组织机构设置及工作职责 必
// webSafetyPersonnel 网络与信息安全管理人员配备情况及其相应资质 必
// shareholderCommitUrl 股东追溯不涉及外资承诺书 必
// shareholderInfo 股东股权情况 多 必
// shareholderName 股东名称
// shareholderShareratio 股权比例
// applicantInfo 申请者《国家企业《信用信息公示系统截图》 多 必
// commitUrl 承诺书 必
// otherCaseUrl 收费方案或其他
// otherIDCCertificateUrl 托管协议及托管商IDC证书 多 必
async createICPOrder(pobj) {
// var packagingICPResult = await this.packagingICPDeliveryData(pobj, pobj.actionBody);
// if (packagingICPResult.status != 0) {
// return packagingICPResult;
// }
var self = this; var self = this;
return await self.db.transaction(async function (t) { return await self.db.transaction(async function (t) {
if (pobj.actionBody.orderNo) { var orderNo = await self.getBusUid("tm" + pobj.appInfo.uapp_id);
self.putOrderDelivery(pobj.actionBody.deliveryData, pobj.actionBody.orderNo); var item = await self.createOrder(pobj, orderNo, t);
} else {
var orderNo = await self.getBusUid("icp" + pobj.appInfo.uapp_id);
self.addOrderDelivery(pobj.actionBody.deliveryData, orderNo); self.addOrderDelivery(pobj.actionBody.deliveryData, orderNo);
}
return system.getResultSuccess({ return system.getResultSuccess({
orderNo: orderNo, orderNo: orderNo,
channelServiceNo: pobj.actionBody.channelOrder.channelServiceNo || orderNo, channelServiceNo: pobj.actionBody.channelOrder.channelServiceNo || orderNo,
...@@ -384,88 +320,89 @@ class OrderInfoService extends ServiceBase { ...@@ -384,88 +320,89 @@ class OrderInfoService extends ServiceBase {
}); });
} }
async packagingICPDeliveryData(pobj, actionBody) {//重新组装商标交付信息 /**
if (actionBody.pageNum) { * 创建其他订单
return "表单参数错误"; * @param {*} pobj
} */
if (Number(actionBody.totalSum) < 300) { async createOtherOrder(pobj) {
return "总价有误,总价不能小于300,20140"; var self = this;
} return await self.db.transaction(async function (t) {
var deliveryData = actionBody.deliveryData; var orderNo = await self.getBusUid("ot" + pobj.appInfo.uapp_id);
if (!deliveryData.nclones) { var item = await self.createOrder(pobj, orderNo, t);
return "商品/服务项不能为空,20150"; return system.getResultSuccess({
} orderNo: orderNo,
if (!deliveryData.tm) { channelServiceNo: pobj.actionBody.channelOrder.channelServiceNo || orderNo,
return "商标信息不能为空,20180"; channelOrderNo: pobj.actionBody.channelOrder.channelOrderNo || orderNo,
} channelParams: pobj.actionBody.channelOrder.channelParams || ""
if (!deliveryData.tm.tmName) { });
return "商标名称不能为空,20180"; });
} }
if (!deliveryData.tm.picUrl) {
return "商标图样不能为空,20210"; // orderNo
// orderPrice
// phone
// companyName
// city
// area
// companyCategory
// companyType
// orgType
// industryType
// scope
// remark
// solutionBizid
async createsolutionOrder(pobj) {
if (pobj.actionBody.orderNo) {
return system.getResult(null, "orderNo不能为空");
} }
if (!deliveryData.apply) { if (actionBody.orderPrice) {
return "申请信息不能为空,20230"; return system.getResult(null, "orderPrice不能为空");
} }
if (!deliveryData.apply.code) { if (actionBody.phone) {
return "申请统一社会信用代码不能为空,20250"; return system.getResult(null, "phone不能为空");
} }
if (!deliveryData.apply.zipCode) { if (actionBody.companyName) {
return "申请邮编不能为空,20280"; return system.getResult(null, "companyName不能为空");
} }
if (!deliveryData.apply.customerType) { if (actionBody.city) {
return "申请人类型不能为空,20310"; return system.getResult(null, "city不能为空");
} }
if (deliveryData.apply.customerType != "ent" && deliveryData.apply.customerType == "person") { if (actionBody.companyCategory) {
return "申请人类型错误,20330"; return system.getResult(null, "companyCategory不能为空");
} }
var deliveryStatus = "dsccl"; if (actionBody.orgType) {
var deliveryStatusName = "待上传材料"; return system.getResult(null, "orgType不能为空");
if (deliveryData.apply.customerType == "ent") {
if (deliveryData.apply.businessLicensePdf && deliveryData.apply.gzwtsUrl) {
deliveryStatus = "dsh";
deliveryStatusName = "待审核";
}
} else {
if (deliveryData.apply.businessLicensePdf && deliveryData.apply.gzwtsUrl && deliveryData.apply.identityCardPdf) {
deliveryStatus = "dsh";
deliveryStatusName = "待审核";
} }
if (actionBody.industryType) {
return system.getResult(null, "industryType不能为空");
} }
var price_item = actionBody.product_info.price_item; if (actionBody.scope) {
var self = this; return system.getResult(null, "scope不能为空");
var nclList = [];
for (let index = 0; index < deliveryData.nclones.length; index++) {
var nclones = deliveryData.nclones[index];
var nclThree = nclones.nclThree;
var tempNclones = {
ncloneCode: nclones.code,
ncloneName: nclones.name,
nclThree: nclThree,
nclCount: nclThree.length,
nclPublicExpense: Number(price_item.price) * nclThree.length,
deliveryStatus: deliveryStatus,//商标交付状态
deliveryStatusName: deliveryStatusName,
submitTime: "",
deliveryType: pobj.appInfo.delivery_type,//应用数据操作类型:00独立,10全委托
tbCode: await self.getBusUid("tb" + pobj.appInfo.uapp_id)//提报号(自动生成)
} }
nclList.push(tempNclones); var producesql = "SELECT pc.pay_code payCode FROM `p_product` pt JOIN p_product_price pc ON pt.id = pc.product_id WHERE pt.channel_item_name LIKE '%" + city
+ "%' AND pc.price_desc LIKE '%" + area
+ "%' and pc.additions_desc LIKE '%" + companyCategory + "%' ;"
var produceinfo = await this.customQuery(producesql);
if (produceinfo) {
pobj.actionBody.payCode = produceinfo[0].payCode;
} }
pobj.actionBody.deliveryData.nclList = nclList; pobj.actionBody.totalSum = pobj.actionBody.orderPrice;
delete pobj.actionBody.deliveryData["nclones"]; pobj.actionBody.payTotalSum = pobj.actionBody.orderPrice;
return system.getResultSuccess();
}
/**
* 创建其他订单
* @param {*} pobj
*/
async createOtherOrder(pobj) {
var self = this; var self = this;
return await self.db.transaction(async function (t) { return await self.db.transaction(async function (t) {
var orderNo = await self.getBusUid("ot" + pobj.appInfo.uapp_id); var orderNo = await self.getBusUid("ic" + pobj.appInfo.uapp_id);
var needsolutioninfo = await self.needsolutionDao.findOne({ channelSolutionNo: pobj.actionBody.solutionBizId }, t)
pobj.actionBody.channelOrder = {
channelServiceNo: pobj.actionBody.orderNo,
channelOrderNo: pobj.actionBody.orderNo,
needNo: needsolutioninfo.needNo,
orderStatus: 2
}
var item = await self.createOrder(pobj, orderNo, t); var item = await self.createOrder(pobj, orderNo, t);
needsolutioninfo.status = "ywc";
await self.needsolutionDao.update(needsolutioninfo, t);
self.addOrderDelivery(pobj.actionBody.deliveryData, orderNo);
return system.getResultSuccess({ return system.getResultSuccess({
orderNo: orderNo, orderNo: orderNo,
channelServiceNo: pobj.actionBody.channelOrder.channelServiceNo || orderNo, channelServiceNo: pobj.actionBody.channelOrder.channelServiceNo || orderNo,
...@@ -474,6 +411,7 @@ class OrderInfoService extends ServiceBase { ...@@ -474,6 +411,7 @@ class OrderInfoService extends ServiceBase {
}); });
}); });
} }
async createChannelSource(pobj) {//创建渠道来源订单 async createChannelSource(pobj) {//创建渠道来源订单
......
...@@ -11,13 +11,13 @@ class NeedinfoService extends ServiceBase { ...@@ -11,13 +11,13 @@ class NeedinfoService extends ServiceBase {
} }
async needinfo2fq(pobj) { async needinfo2fq(pobj) {
pobj.actionBody.needNo=await this.getBusUid("n"); pobj.actionBody.needNo = await this.getBusUid("n");
pobj.actionBody.uapp_id=pobj.appInfo.id; pobj.actionBody.uapp_id = pobj.appInfo.id;
var needinfo = await this.dao.create(pobj.actionBody); var needinfo = await this.dao.create(pobj.actionBody);
var pobj = { var pobj = {
"idempotentId": needinfo.needNo, "idempotentId": needinfo.needNo,
"idempotentSource": needinfo.chanceType_code, "idempotentSource": needinfo.chanceType_code,
"idempotentSourceName": pobj.appInfo.app_name+"_"+pobj.actionBody.chanceTypeName, "idempotentSourceName": pobj.appInfo.app_name + "_" + pobj.actionBody.chanceTypeName,
"phone": needinfo.publishMobile, "phone": needinfo.publishMobile,
"remark": needinfo.notes, "remark": needinfo.notes,
"customerName": needinfo.publishName "customerName": needinfo.publishName
...@@ -34,6 +34,55 @@ class NeedinfoService extends ServiceBase { ...@@ -34,6 +34,55 @@ class NeedinfoService extends ServiceBase {
// } // }
} }
// intentionBizId
// mobile
// userName
// description
// area
// type
// ext
async createicneedinfo(pobj, actionBody) {
var needNo = await this.getBusUid("n");
if (actionBody.intentionBizId) {
return system.getResult(null, "intentionBizId不能为空");
}
if (actionBody.mobile) {
return system.getResult(null, "mobile不能为空");
}
if (actionBody.type) {
return system.getResult(null, "type不能为空");
}
var nobj = {
uapp_id: pobj.appInfo.uapp_id,
channelNeedNo: actionBody.intentionBizId,
needNo: needNo,
channelUserId: pobj.userInfo.channel_userid,
publishName: actionBody.userName,
publishContent: actionBody.description,
publishMobile: actionBody.mobile,
city: actionBody.area,
disposeNotes: actionBody.ext,
channelTypeCode: actionBody.type
}
return await this.dao.create(nobj);
}
async solutionClose(pobj) {
if (actionBody.intentionBizId) {
return system.getResult(null, "intentionBizId不能为空");
}
var needinfo = await this.findOne({ channelNeedNo: actionBody.intentionBizId });
needinfo.status = "ygb";
var self=this;
return await self.db.transaction(async function (t) {
await self.update(needinfo,t);
var needsolutioninfo = await self.needsolutionDao.findOne({ channelNeedNo: pobj.actionBody.intentionBizId }, t)
needsolutioninfo.status = "yzf";
await self.needsolutionDao.update(needsolutioninfo, t);
// await
})
}
async flowinfo(obj) { async flowinfo(obj) {
} }
......
...@@ -35,6 +35,44 @@ class NeedsolutionService extends ServiceBase { ...@@ -35,6 +35,44 @@ class NeedsolutionService extends ServiceBase {
if(!ab.solutionContent.solution){ if(!ab.solutionContent.solution){
return system.getResultFail(-104,"业务方案信息不能为空"); return system.getResultFail(-104,"业务方案信息不能为空");
} }
var solution = ab.solutionContent.solution;
if(bizType=="companyreg"){//普通公司注册
if(!solution.companyName){
return system.getResultFail(-105,"公司名称不能为空");
}
if(!solution.city){
return system.getResultFail(-106,"注册城市不能为空");
}
if(!solution.area){
return system.getResultFail(-107,"注册区域不能为空");
}
if(!solution.companyCategory){
return system.getResultFail(-108,"纳税人类型不能为空");
}
if(!solution.companyType){
return system.getResultFail(-109,"公司性质不能为空");
}
if(!solution.orgType){
return system.getResultFail(-110,"组织类型不能为空");
}
if(!solution.industryType){
return system.getResultFail(-111,"从事行业不能为空");
}
if(!solution.scope){
return system.getResultFail(-112,"经营范围不能为空");
}
}
if(bizType=="companyreg_cloud"){//云上公司注册
if(!solution.park){
return system.getResultFail(-113,"注册园区不能为空");
}
if(!solution.registerType){
return system.getResultFail(-114,"注册类型不能为空");
}
if(!solution.productType){
return system.getResultFail(-115,"产品类型不能为空");
}
}
//获取需求信息 //获取需求信息
var needinfo = await this.needinfoDao.model.findOne({ var needinfo = await this.needinfoDao.model.findOne({
where:{needNo:ab.needNo},raw:true where:{needNo:ab.needNo},raw:true
...@@ -45,7 +83,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -45,7 +83,7 @@ class NeedsolutionService extends ServiceBase {
ab["channelNeedNo"] = needinfo.channelNeedNo; ab["channelNeedNo"] = needinfo.channelNeedNo;
var solutionNo = await this.getBusUid("ns"); var solutionNo = await this.getBusUid("ns");
ab["solutionNo"] = solutionNo; ab["solutionNo"] = solutionNo;
ab["status"] = "ytj"; ab["status"] = "dqr";
ab.solutionContent = JSON.stringify(ab.solutionContent); ab.solutionContent = JSON.stringify(ab.solutionContent);
var od = await this.dao.create(ab); var od = await this.dao.create(ab);
if(od && od.id){ if(od && od.id){
...@@ -142,42 +180,42 @@ class NeedsolutionService extends ServiceBase { ...@@ -142,42 +180,42 @@ class NeedsolutionService extends ServiceBase {
paramWhere.status = ab.status; paramWhere.status = ab.status;
} }
if(bizType=="companyreg"){//普通公司注册 if(bizType=="companyreg"){//普通公司注册
if (ab.entName) {//企业名称 if (ab.companyName) {//企业名称
sql = sql+" and solutionContent->'$.solution.entName' = :entName"; sql = sql+" and solutionContent->'$.solution.companyName' = :companyName";
sqlCount = sqlCount+" and solutionContent->'$.solution.entName' = :entName"; sqlCount = sqlCount+" and solutionContent->'$.solution.companyName' = :companyName";
paramWhere.entName = ab.entName; paramWhere.companyName = ab.companyName;
}// }//
if (ab.organizationType) {//组织类型 if (ab.orgType) {//组织类型
sql = sql+" and solutionContent->'$.solution.organizationType' = :organizationType"; sql = sql+" and solutionContent->'$.solution.orgType' = :orgType";
sqlCount = sqlCount+" and solutionContent->'$.solution.organizationType' = :organizationType"; sqlCount = sqlCount+" and solutionContent->'$.solution.orgType' = :orgType";
paramWhere.organizationType = ab.organizationType; paramWhere.orgType = ab.orgType;
} }
if (ab.entNature) {//公司性质 if (ab.companyType) {//公司性质
sql = sql+" and solutionContent->'$.solution.entNature' = :entNature"; sql = sql+" and solutionContent->'$.solution.companyType' = :companyType";
sqlCount = sqlCount+" and solutionContent->'$.solution.entNature' = :entNature"; sqlCount = sqlCount+" and solutionContent->'$.solution.companyType' = :companyType";
paramWhere.entNature = ab.entNature; paramWhere.companyType = ab.companyType;
} }
if (ab.city) {//城市 if (ab.city) {//城市
sql = sql+" and solutionContent->'$.solution.city' = :city"; sql = sql+" and solutionContent->'$.solution.city' = :city";
sqlCount = sqlCount+" and solutionContent->'$.solution.city' = :city"; sqlCount = sqlCount+" and solutionContent->'$.solution.city' = :city";
paramWhere.city = ab.city; paramWhere.city = ab.city;
} }
if (ab.province) {//省份 if (ab.area) {//区域
sql = sql+" and solutionContent->'$.solution.province' = :province"; sql = sql+" and solutionContent->'$.solution.area' = :area";
sqlCount = sqlCount+" and solutionContent->'$.solution.province' = :province"; sqlCount = sqlCount+" and solutionContent->'$.solution.area' = :area";
paramWhere.province = ab.province; paramWhere.area = ab.area;
} }
if (ab.taxpayerType) {//纳税人类型 if (ab.companyCategory) {//纳税人类型
sql = sql+" and solutionContent->'$.solution.taxpayerType' = :taxpayerType"; sql = sql+" and solutionContent->'$.solution.companyCategory' = :companyCategory";
sqlCount = sqlCount+" and solutionContent->'$.solution.taxpayerType' = :taxpayerType"; sqlCount = sqlCount+" and solutionContent->'$.solution.companyCategory' = :companyCategory";
paramWhere.taxpayerType = ab.taxpayerType; paramWhere.companyCategory = ab.companyCategory;
} }
} }
if(bizType=="companyreg_cloud"){//云上公司注册 if(bizType=="companyreg_cloud"){//云上公司注册
if (ab.regPark) {//注册园区 if (ab.park) {//注册园区
sql = sql+" and solutionContent->'$.solution.regPark' = :regPark"; sql = sql+" and solutionContent->'$.solution.park' = :park";
sqlCount = sqlCount+" and solutionContent->'$.solution.regPark' = :regPark"; sqlCount = sqlCount+" and solutionContent->'$.solution.park' = :park";
paramWhere.regPark = ab.regPark; paramWhere.park = ab.park;
} }
if (ab.productType) {//产品类型 if (ab.productType) {//产品类型
sql = sql+" and solutionContent->'$.solution.productType' = :productType"; sql = sql+" and solutionContent->'$.solution.productType' = :productType";
...@@ -217,13 +255,13 @@ class NeedsolutionService extends ServiceBase { ...@@ -217,13 +255,13 @@ class NeedsolutionService extends ServiceBase {
if(ab.operateType=="INVALID"){// INVALID:作废 if(ab.operateType=="INVALID"){// INVALID:作废
status="yzf"; status="yzf";
}else if(ab.operateType=="REFUND"){// REFUND:退款 }else if(ab.operateType=="REFUND"){// REFUND:退款
status="ytk"; status="yzf";
}else if(ab.operateType=="PAID"){// PAID:支付 }else if(ab.operateType=="PAID"){// PAID:支付
status="yfk"; status="ywc";
}else{ }else{
return system.getResultFail(-104,"操作类型有误"); return system.getResultFail(-104,"操作类型有误");
} }
var solution_status={"ytj":"已提交","yfk":"已付款","yzf":"已作废","ytk":"已退款"}; var solution_status={"dqr":"待确认","ywc":"已完成","yzf":"已作废"};
solutionContent["deliveryStatus"] = status; solutionContent["deliveryStatus"] = status;
solutionContent["deliveryStatusName"] = solution_status[status]; solutionContent["deliveryStatusName"] = solution_status[status];
solutionContent["updated"] = new Date(); solutionContent["updated"] = new Date();
...@@ -254,12 +292,85 @@ class NeedsolutionService extends ServiceBase { ...@@ -254,12 +292,85 @@ class NeedsolutionService extends ServiceBase {
if(!ns || !ns.id){ if(!ns || !ns.id){
return system.getResultFail(-102,"未知方案"); return system.getResultFail(-102,"未知方案");
} }
if(ns.status!="dqr"){
return system.getResultFail(-103,"方案状态错误,只能废弃待确认方案");
}
await this.dao.update({id:ns.id,status:"yzf"});//方案废弃 await this.dao.update({id:ns.id,status:"yzf"});//方案废弃
return system.getResultSuccess(); return system.getResultSuccess();
} }
//根据需求关闭方案(关闭需求后调用)
async abolishProgrammeByNeed(pobj){
var ab = pobj.actionBody;
var app = pobj.appInfo;
if(!app || !app.uapp_id){
return system.getResultFail(-100,"未知渠道");
}
if(!ab.intentionBizId){
return system.getResultFail(-101,"需求编号不能为空");
}
//获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
where:{channelNeedNo:ab.intentionBizId,uapp_id:app.uapp_id},raw:true
});
if(!needinfo || !needinfo.id){
return system.getResultFail(-201,"未知需求信息");
}
//获取方案信息
var ns = await this.dao.model.findAll({
where:{needNo:needinfo.needNo},raw:true
});
for(var i=0;i<ns.length;i++){
var fa = ns[i];
if(fa.status=="ywc"){
return system.getResultFail(-103,"方案状态错误,不能废弃已完成方案");
}
}
await this.dao.model.update({status:"yzf"}, { where: {needNo:needinfo.needNo} });//方案废弃
return system.getResultSuccess();
}
//立即支付下单保存方案
async createSolutionByOrder(pobj){
var ab = pobj.actionBody;
var app = pobj.appInfo;
if(!app || !app.uapp_id){
return system.getResultFail(-100,"未知渠道");
}
if(!ab.solutionBizid){
return system.getResultFail(-101,"需求编号不能为空");
}
var needinfo = await this.needinfoDao.model.findOne({
where:{channelNeedNo:ab.intentionBizId,uapp_id:app.uapp_id},raw:true
});
if(!needinfo || !needinfo.id){
return system.getResultFail(-102,"未知需求信息");
}
var solution = {
"companyName":ab.companyName,
"area":ab.area,
"city": ab.city,
"companyCategory": ab.companyCategory,
"companyType": ab.companyType,
"orgType" :ab.orgType,
"industryType": ab,industryType,
"scope": ab.scope,
"remark":ab.remark
}
}
} }
module.exports = NeedsolutionService; module.exports = NeedsolutionService;
// orderNo
// orderPrice
// phone
// companyName
// city
// area
// companyCategory
// companyType
// orgType
// industryType
// scope
// remark
// solutionBizid
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment