Commit 478eb2e7 by 高宇强

gyq

parent 19645d24
......@@ -38,6 +38,7 @@ class DeliverybillCtl extends CtlBase {
}
}
else if (robj.businessName == '云上园区注册'){
robj.registeredType = element.delivery_info.registeredType;//园区注册时,根据该值跳界面
if (robj.baseInfo.isWhether == "是"){//如果有刻章需求或者是虚拟地址
robj.relatedProducts = '有';
}
......@@ -62,12 +63,13 @@ class DeliverybillCtl extends CtlBase {
}
}
/*根据交付单编号获取交付单详情*/
async findInfoByDeliverCode(pobj,qobj,req){
/*根据交付单编号获取交付单详情和材料详情*/
async DealInfo(pobj,qobj,req){//
if (pobj.deliverNumber && pobj.deliverNumber != 'undefined')
{
try{
var rs = await this.service.findInfoByDeliverCode(pobj);
var ms = await this.materialService.findInfoByDeliverNumber(pobj);
var rarr = {}
if (rs){
rarr.id = rs.id;//数据的id
......@@ -76,148 +78,24 @@ class DeliverybillCtl extends CtlBase {
rarr.businessType = rs.product_code;//产品编码
rarr.channelSource = rs.source_name;//渠道名称
rarr.channelNumber = rs.source_number;//渠道编码
//rarr.baseInfo = rs.delivery_info;//交付单详情
rarr.baseInfo = rs.delivery_info;//交付单详情
rarr.serviceCode = rs.service_address;//服务地区编码
if (rarr.businessName == "园区注册"){
if (rarr.businessName == "云上园区注册"){
rarr.serviceArea = appconfig.pdict.registeredParkDict[rarr.serviceCode];//服务地区名称
}
else{
rarr.serviceArea = appconfig.pdict.registeredAreaDict[rarr.serviceCode];//服务地区名称
}
rarr.contactsName = rs.delivery_info.contactsName;//联系人姓名
rarr.contactsPhone = rs.delivery_info.contactsPhone;//联系人电话
rarr.servicerCode = rs.facilitator_id;//服务商编码
rarr.servicerName = rs.facilitator_name;//服务商名称
rarr.clerkName = rs.salesman_name;//业务员名称
rarr.clerkPhone = rs.salesman_phone;//业务员电话
rarr.payAmount = rs.selling_price;//交付单金额
rarr.deliverStatus = rs.delivery_status;//交付单状态
rarr.statusReason = rs.close_reason;//状态原因
rarr.createdTime = this.timeFormat(rs.created_at);//交付单创建时间
rarr.statusTime = this.timeFormat(rs.updated_at);//当前状态时间
//其他详细信息
var baseInfo = {};
if (rarr.businessName == "公司注册" || rarr.businessName == "园区注册"){
baseInfo.isWhether = rs.delivery_info.isWhether;
if (robj.baseInfo.isWhether == "是"){//如果有刻章需求或者是虚拟地址
baseInfo.relatedProducts = '有';
}
else{
baseInfo.relatedProducts = '无';
}
if (rarr.businessName == "公司注册"){
baseInfo.isVirtual = rs.delivery_info.isVirtual;
if (baseInfo.isVirtual == "是"){
baseInfo.relatedProducts = '有';
}
}
baseInfo.officialSeal = rs.delivery_info.officialSeal;
baseInfo.businessLicense = rs.delivery_info.businessLicense;
}
if (rarr.businessName == "税控申请" || rarr.businessName == "代理记账"){
baseInfo.taxpayerType = rs.delivery_info.taxpayerType;
if (rarr.businessName == "代理记账"){
baseInfo.subjectType = rs.delivery_info.subjectType;
}
}
if (rarr.businessName == "刻章服务"){
baseInfo.whetherType = rs.delivery_info.whetherType;
}
if (rarr.businessName == "注册地址" || rarr.businessName == "代理记账"){
baseInfo.buyTime = rs.delivery_info.buyTime;
baseInfo.buyDuration = rs.delivery_info.buyDuration;
baseInfo.isRenew = rs.delivery_info.isRenew;
}
rarr.baseInfo = baseInfo;
var companyInfo = {};
var materialInfo = await this.materialService.findInfoByDeliverId(rarr.id);
if (materialInfo){
companyInfo.companyName = materialInfo.company_info.companyName;
companyInfo.fullAddress = materialInfo.company_info.fullAddress;
companyInfo.operatingPeriod = materialInfo.company_info.operatingPeriod;
companyInfo.businessScope = materialInfo.company_info.businessScope;
if (rarr.businessName == "园区注册"){
companyInfo.individualType = materialInfo.company_info.individualType;
companyInfo.individualName = appconfig.pdict.registeredTypeDict[companyInfo.individualType];
}
if (rarr.businessName == "公司注册" || rarr.businessName == "园区注册"){
companyInfo.spareName = Arrays.asList(materialInfo.company_info.spareName.split(","));
companyInfo.taxpayerType = materialInfo.company_info.taxpayerType;
if (rarr.businessName == "公司注册"){
companyInfo.companyProperties = materialInfo.company_info.companyProperties;
}
companyInfo.addressType = materialInfo.company_info.addressType;
companyInfo.engagedIndustry = materialInfo.company_info.engagedIndustry;
}
if (rarr.businessName != "公司注册" && rarr.businessName != "园区注册" ){
companyInfo.registeredCapital = materialInfo.company_info.registeredCapital;
companyInfo.creditCode = materialInfo.company_info.creditCode;
companyInfo.companyType = materialInfo.company_info.companyType;
companyInfo.establishedTime = materialInfo.company_info.establishedTime;
companyInfo.shareholderName = materialInfo.company_info.shareholderName;
}
rarr.companyInfo = companyInfo;
if (rarr.businessName == "公司注册" || rarr.businessName == "园区注册"){
var registeredInfo = {};
registeredInfo.registeredCapital = materialInfo.registered_info.registeredCapital;
registeredInfo.reserveProportion = materialInfo.registered_info.reserveProportion;
if (rarr.businessName == "公司注册" || companyInfo.individualName == "个人独资" ){
registeredInfo.registeredDate = materialInfo.registered_info.registeredDate;
}
rarr.registeredInfo = registeredInfo;
}
if (rarr.businessName == "公司注册" || companyInfo.individualName == "个人独资" ){
var contributionInfo = [];
var tempList = materialInfo.contribution_info.contributionInfo;//数据格式:{"contributionInfo":[{},{}]}
tempList.forEach(element => {
contributionInfo.push(element);
});
rarr.contributionInfo = contributionInfo;
}
if (rarr.businessName == "公司注册"){
var positionInfo = [];
var tempList = materialInfo.position_info.positionInfo;//数据格式:{"positionInfo":[{},{}]}
tempList.forEach(element => {
positionInfo.push(element);
});
rarr.positionInfo = positionInfo;
}
if (companyInfo.individualName == "个体商户")
{
rarr.managerInfo = materialInfo.position_info;
}
if (rarr.businessName == "公司注册" || rarr.businessName == "园区注册"){
var regInfo = {};
if (companyInfo.individualName == "个体商户"){
regInfo.managerCertificate = materialInfo.file_info.managerCertificate;
}
else{
regInfo.legalpersonCertificate = materialInfo.file_info.legalpersonCertificate;
regInfo.cfoCertificate = materialInfo.file_info.cfoCertificate;
if (rarr.businessName == "公司注册"){
regInfo.titleCertificate = materialInfo.file_info.titleCertificate;
regInfo.naturalpersonCertificate = materialInfo.file_info.naturalpersonCertificate;
regInfo.socialCertificate = materialInfo.file_info.socialCertificate;
regInfo.directorCertificate = materialInfo.file_info.directorCertificate;
regInfo.managerCertificate = materialInfo.file_info.managerCertificate;
regInfo.supervisorCertificate = materialInfo.file_info.supervisorCertificate;
}
}
rarr.regInfo = regInfo;
rarr.expressInfo = materialInfo.express_info;
}
}
rarr.deliveryInfo = rs.delivery_info;//交付单详情
rarr.contactsInfo.contactsName = rs.delivery_info.contactsName;//联系人信息
rarr.contactsInfo.contactsPhone = rs.delivery_info.contactsPhone;//联系电话信息
rarr.companyInfo = ms.company_info;//公司详情
rarr.registeredInfo = ms.registered_info;//注册信息
rarr.contributionInfo = ms.contribution_info;//出资比例信息
rarr.positionInfo = ms.position_info;//任职信息;公司注册和个人独资时取该值
rarr.managerInfo = ms.position_info;//经营者信息,个体工商户的经营者信息取该值
rarr.regInfo = ms.file_info;//注册文件信息
rarr.expressInfo = ms.express_info;//邮寄信息
}
return system.getResult(rarr);
}
......@@ -248,12 +126,78 @@ class DeliverybillCtl extends CtlBase {
}
}
/*根据交付单编号更新交付单详情*/
async updateInfoByDeliverCode(pobj,qobj,req){
if (pobj.deliverNumber && pobj.deliverNumber != 'undefined'){
try{
var rs = await this.service.findInfoByDeliverCode(pobj)//先得到交付单详情
//判断工商扫描件和营业执照扫描件是否存在,若存在更新交付单的详情
if ((pobj.baseInfo.officialSeal && pobj.baseInfo.officialSeal != 'undefined') || (pobj.baseInfo.businessLicense && pobj.baseInfo.businessLicense != 'undefined')){
var deliveryInfo = rs.delivery_info;
if (pobj.baseInfo.officialSeal && pobj.baseInfo.officialSeal != 'undefined'){
deliveryInfo.officialSeal = pobj.baseInfo.officialSeal;
}
if (pobj.baseInfo.businessLicense && pobj.baseInfo.businessLicense != 'undefined'){
deliveryInfo.businessLicense = pobj.baseInfo.businessLicense;
}
//更新详情
var uarr = {
"deliverNumber":pobj.deliverNumber,
"deliveryInfo":deliveryInfo
};
await this.service.updateInfoByDeliverCode(uarr);
}
//更新材料信息
await this.materialService.updateInfoByDeliverNumber(pobj);
var statusInfo = {
"deliverNumber":pobj.deliverNumber,
"deliverStatus":"collecting"//状态为收集工商注册材料
};
//更新状态
await this.service.updateStatusByDeliverCode(statusInfo);
//传给庄冰
pobj.baseInfo = deliveryInfo;
var rc = system.getObject("util.execClient");
var requrl = this.receiveUrl;
var params = {
"actionType":"updateOrderStatus",
"actionBody":{
"orderNum": rs.demand_code,//订单编码
"status":appconfig.pdict.ddyDict["collecting"],
"deliverContent":pobj;
}
}
var rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
if (j.status == 1){
return system.getResult("操作成功!");
}
else{
return system.getResultError("更新方案状态出错!");
}
}
catch(error){
return system.getResultError(error);
}
}
else{
return system.getResultError("参数错误!");
}
}
/*根据插入交付单信息*/
async insertInfo(pobj,qobj,req){
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.schemeNumber && pobj.schemeNumber != 'undefined'){
/*根据商机编号插入交付单信息*/
async insertInfo(pobj,qobj,req){//队列的时候用
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.schemeNumber && pobj.schemeNumber != 'undefined'
&& pobj.deliverNumber && pobj.deliverNumber != 'undefined'){
try{
//更新状态给庄冰
var res = await this.service.insertInfo(pobj);
return system.getResult("插入成功!");
}
......
......@@ -35,10 +35,12 @@ class DeliverybillDao extends Dao {
return await this.updateByWhere(setobj,whereobj,t);
}
// /*根据交付单更新交付材料信息*/
// async UpdateInfoByDeliverCode(qobj,t){
// // var
// }
/*根据交付单更新交付材料信息*/
async UpdateInfoByDeliverCode(qobj,t){//公司注册、云上园区注册时填写交付材料
var whereobj = {"delivery_code":qobj.deliverNumber};
var setobj = {"delivery_info":qobj.deliveryInfo};
return await this.updateByWhere(setobj,whereobj,t);
}
/*插入交付单信息*/
async insertInfo(qobj,t){//到时候看交付单信息后再确定
......
......@@ -5,149 +5,63 @@ class MaterialDao extends Dao {
super(Dao.getModelName(MaterialDao));
}
/*根据交付单id获取注册材料信息详情*/
async findInfoByDeliverId(qobj){
var qcwhere = {"delivery_id":qobj.deliverId};
/*根据交付单编号获取注册材料信息详情*/
async findInfoByDeliverNumber(qobj){
var qcwhere = {"delivery_code":qobj.deliverNumber};
return await this.findOne(qcwhere);
}
/*根据交付单id更新交付单编号*/
async updateInfoByDeliverId(qobj,t){
var setobj = {"delivery_code":qobj.deliverNumber};
var whereobj = {"delivery_id":qobj.deliverId};
return await this.updateByWhere(setobj,whereobj,t);
}
/*插入注册材料信息*/
async insertInfo(qobj,t){
var obj = {
"delivery_id":qobj.deliverId
};
if (qobj.deliverNumber && qobj.deliverNumber != 'undefined'){
obj["delivery_code"] = qobj.deliverNumber;
}
if (qobj.companyName && qobj.companyName != 'undefined'){
obj.company_info.companyName = qobj.companyName;
}
if (qobj.spareName && qobj.spareName != 'undefined'){
obj.company_info.spareName = qobj.spareName;
}
if (qobj.taxpayerType && qobj.taxpayerType != 'undefined'){
obj.company_info.taxpayerType = qobj.taxpayerType;
}
if (qobj.companyProperties && qobj.companyProperties != 'undefined'){
obj.company_info.companyProperties = qobj.companyProperties;
}
if (qobj.addressType && qobj.addressType != 'undefined'){
obj.company_info.addressType = pobj.company_info.addressType;
/*根据交付单编号更新交材料详情*/
async updateInfoByDeliverNumber(qobj,t){
var whereobj = {"delivery_code":qobj.deliverNumber};
var setobj = {};
if (qobj.companyInfo && qobj.company_info != 'undefined'){
setobj.company_info = qobj.companyInfo;
}
if (qobj.fullAddress && qobj.fullAddress != 'undefined'){
obj.company_info.fullAddress = qobj.fullAddress;
if (qobj.registeredInfo && qobj.registeredInfo != 'undefined'){
setobj.registered_info = qobj.registeredInfo;
}
if (pobj.engagedIndustry && pobj.engagedIndustry != 'undefined'){
obj.company_info.engagedIndustry = qobj.engagedIndustry;
if (qobj.contributionInfo && qobj.contributionInfo != 'undefined'){
setobj.contribution_info = qobj.contributionInfo;
}
if (pobj.businessScope && pobj.businessScope != 'undefined'){
obj.company_info.businessScope = pobj.businessScope;
if (qobj.positionInfo && qobj.positionInfo != 'undefined'){
setobj.position_info = qobj.positionInfo;
}
if (pobj.operatingPeriod && pobj.operatingPeriod != 'undefined'){
obj.company_info.operatingPeriod = pobj.operatingPeriod;
if (qobj.managerInfo && qobj.managerInfo != 'undefined'){
setobj.position_info = setobj.position_info;
}
if (pobj.individualType && pobj.individualType != 'undefined'){
obj.company_info.individualType = pobj.individualType;
if (qobj.regInfo && qobj.regInfo != 'undefined'){
setobj.file_info = qobj.regInfo;
}
if (pobj.registeredCapital && pobj.registeredCapital != 'undefined'){
obj.company_info.registeredCapital = pobj.registeredCapital;
if (qobj.expressInfo && qobj.expressInfo != 'undefined'){
setobj.express_info = qobj.expressInfo;
}
if (pobj.creditCode && pobj.creditCode != 'undefined'){
obj.company_info.creditCode = pobj.creditCode;
}
if (pobj.companyType && pobj.companyType != 'undefined'){
obj.company_info.companyType = pobj.companyType;
}
if (pobj.establishedTime && pobj.establishedTime != 'undefined'){
obj.company_info.establishedTime = pobj.establishedTime;
}
if (pobj.shareholderName && pobj.shareholderName != 'undefined'){
obj.company_info.shareholderName = pobj.shareholderName;
}
if (pobj.registeredCapital && pobj.registeredCapital != 'undefined'){
obj.registered_info.registeredCapital = pobj.registeredCapital;
}
if (pobj.registeredDate && pobj.registeredDate != 'undefined'){
obj.registered_info.registeredDate = pobj.registeredDate;
return await this.updateByWhere(setobj,whereobj,t);
}
/*插入注册材料信息*/
async insertInfo(qobj,t){//公司注册,云上园区注册时的信息
var obj = {
"delivery_code":qobj.deliverNumber
};
if (qobj.deliverId && qobj.deliverId != 'undefined'){
obj["delivery_id"] = qobj.deliverId;
}
if (pobj.reserveProportion && pobj.reserveProportion != 'undefined'){
obj.registered_info.reserveProportion = pobj.reserveProportion;
if (qobj.companyInfo && qobj.companyInfo != 'undefined'){
obj.company_info = qobj.companyInfo;
}
if (pobj.contributionInfo && pobj.contributionInfo != 'undefined'){
obj.contribution_info.contributionInfo = pobj.contributionInfo;
if (pobj.registeredInfo && pobj.registeredInfo != 'undefined'){
obj.registered_info = pobj.registeredInfo;
}
if (pobj.positionInfo && pobj.positionInfo != 'undefined'){
obj.position_info.positionInfo = pobj.positionInfo;
}
if (pobj.managerName && pobj.managerName != 'undefined'){
obj.position_info.managerName = pobj.managerName;
}
if (pobj.managerName && pobj.managerName != 'undefined'){
obj.position_info.managerName = pobj.managerName;
}
if (pobj.IdentificationNumber && pobj.IdentificationNumber != 'undefined'){
obj.position_info.IdentificationNumber = pobj.IdentificationNumber;
}
if (pobj.phoneNumber && pobj.phoneNumber != 'undefined'){
obj.position_info.phoneNumber = pobj.phoneNumber;
}
if (pobj.contactAddress && pobj.contactAddress != 'undefined'){
obj.position_info.contactAddress = pobj.contactAddress;
}
if (pobj.legalpersonCertificate && pobj.legalpersonCertificate != 'undefined'){
obj.file_info.legalpersonCertificate = pobj.legalpersonCertificate;
}
if (pobj.cfoCertificate && pobj.cfoCertificate != 'undefined'){
obj.file_info.cfoCertificate = pobj.cfoCertificate;
}
if (pobj.titleCertificate && pobj.titleCertificate != 'undefined'){
obj.file_info.titleCertificate = pobj.titleCertificate;
}
if (pobj.naturalpersonCertificate && pobj.naturalpersonCertificate != 'undefined'){
obj.file_info.naturalpersonCertificate = obj.naturalpersonCertificate;
}
if (pobj.socialCertificate && pobj.socialCertificate != 'undefined'){
obj.file_info.socialCertificate = pobj.socialCertificate;
}
if (pobj.directorCertificate && pobj.directorCertificate != 'undefined'){
obj.file_info.directorCertificate = pobj.directorCertificate;
}
if (pobj.managerCertificate && pobj.managerCertificate != 'undefined'){
obj.file_info.managerCertificate = pobj.managerCertificate;
}
if (pobj.supervisorCertificate && pobj.supervisorCertificate != 'undefined'){
obj.file_info.supervisorCertificate = pobj.supervisorCertificate;
}
if (pobj.managerCertificate && pobj.managerCertificate != 'undefined'){
obj.file_info.managerCertificate = pobj.managerCertificate;
}
if (pobj.trackingNumber && pobj.trackingNumber != 'undefined'){
obj.express_info.trackingNumber = pobj.trackingNumber;
}
if (pobj.logisticsCompany && pobj.logisticsCompany != 'undefined'){
obj.express_info.logisticsCompany = pobj.logisticsCompany;
}
if (pobj.addresseeName && pobj.addresseeName != 'undefined'){
obj.express_info.addresseeName = pobj.addresseeName;
}
if (pobj.addresseePhone && pobj.addresseePhone != 'undefined'){
obj.express_info.addresseePhone = pobj.addresseePhone;
}
if (pobj.addresseeEmail && pobj.addresseeEmail != 'undefined'){
obj.express_info.addresseeEmail = pobj.addresseeEmail;
obj.position_info = pobj.positionInfo;
}
if (pobj.addresseeAddress && pobj.addresseeAddress != 'undefined'){
obj.express_info.addresseeAddress = pobj.addresseeAddress;
if (pobj.regInfo && pobj.regInfo != 'undefined'){
obj.file_info = pobj.regInfo;
}
if (pobj.expressStatus && pobj.expressStatus != 'undefined'){
obj.express_info.expressStatus = pobj.expressStatus;
if (pobj.expressInfo && pobj.expressInfo != 'undefined'){
obj.express_info = pobj.expressInfo;
}
return await this.create(obj,t);
}
......
......@@ -45,7 +45,7 @@ module.exports = {
"engraving":"刻章环节",//5个工作日内,只有选择了刻章服务时才有该状态
"posting":"证件邮寄环节",//3个工作日内,公司注册、云上园区
"paid":"已付款",//增值服务
"inservice":"服务中",//增值服务
"inservice":"已交付",//增值服务
"completed":"已完成",//税务报道、税控申请、银行开户、工商年报、工商变更、社保开户、刻章服务
"signed":"已签收",//公司注册、云上园区
"expired":"已到期",//代理记账、注册地址
......@@ -73,13 +73,18 @@ module.exports = {
"diliverSataus3":{// 税务报道、税控申请、银行开户、工商年报、工商变更、社保开户、刻章服务交付状态
"paid":"已付款",
"received":"已接单",
"inservice":"服务中",
"inservice":"已交付",
"completed":"已完成"
},
"payStatus":{//交付状态
"已交付":"已交付",
"待交付":"待交付",
"已关闭":"已关闭"
},
"diliverSataus4": {//代理记账、注册地址交付状态
"paid":"已付款",
"received":"已接单",
"inservice":"服务中",
"inservice":"已交付",
"expired":"已到期"
},
"registeredAreaDict": {//注册地区
......@@ -179,6 +184,21 @@ module.exports = {
"icCheckCase":"/ic/gsnj/",
"icChangeCase":"/ic/gschangs/",
"ssOpenCase":"/ic/sbopen/"
},
"ddyDict":{//和庄冰的交付单对应关系
"paid":1,
"received":2,
"inservice":3,
"collecting":10,
"uploading":11,
"checking":12,
"auditing":13,
"engraving":14,
"posting":15,
"signed":16,
"completed":17,
"expired":18,
"closed":19
}
}
}
......
......@@ -24,9 +24,17 @@ class DeliverybillService extends ServiceBase {
return await self.dao.updateStatusByDeliverCode(qobj,t);
});
}
/*更新交付单信息 */
async UpdateInfoByDeliverCode(qobj){
var self=this;
return self.db.transaction(async function (t) {
return await self.dao.UpdateInfoByDeliverCode(qobj,t);
});
}
/*插入交付单信息*/
async insertInfo(qobj){
async insertInfo(qobj){//从队列取数据的时候用
var self=this;
return self.db.transaction(async function (t) {
return await self.dao.insertInfo(qobj,t);
......
......@@ -12,16 +12,16 @@ class MaterialService extends ServiceBase {
// return apps;
// }
/*根据交付单id获取注册材料信息详情*/
async findInfoByDeliverId(qobj){
return await this.dao.findInfoByDeliverId(qobj);
/*根据交付单编号获取注册材料信息详情*/
async findInfoByDeliverNumber(qobj){
return await this.dao.findInfoByDeliverNumber(qobj);
}
/* 根据交付单id更新交付单编号信息 */
async updateInfoByDeliverId(qobj){
/* 根据交付单编号更新交付单编号信息 */
async updateInfoByDeliverNumber(qobj){
var self=this;
return self.db.transaction(async function (t) {
return await self.dao.updateInfoByDeliverId(qobj,t);
return await self.dao.updateInfoByNumber(qobj,t);
});
}
......
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