Commit bdf68ce3 by 王昆

gsb

parent 7808044c
......@@ -7,6 +7,17 @@ class CtlBase {
this.cacheManager = system.getObject("db.common.cacheManager");
this.md5 = require("MD5");
}
async getDeliver(req) {
let jo = await redisClient.get(req.sid + "_deliver");
if (!jo) {
return null;
}
try {
return JSON.parse(jo);
} catch (e) {
return null;
}
}
encryptPasswd(passwd) {
if (!passwd) {
throw new Error("请输入密码");
......
const system = require("../system");
const settings = require("../../config/settings");
const redisClient = system.getObject("util.redisClient");
class CtlBase {
constructor() {
this.restClient = system.getObject("util.restClient");
......@@ -13,6 +14,17 @@ class CtlBase {
return system.getResultFail(-200, "Ctl出现异常,请联系管理员");
}
}
async getDeliver(req) {
let jo = await redisClient.get(req.sid + "_deliver");
if (!jo) {
return null;
}
try {
return JSON.parse(jo);
} catch (e) {
return null;
}
}
encryptPasswd(passwd) {
if (!passwd) {
throw new Error("请输入密码");
......
......@@ -114,5 +114,49 @@ class DeliverCtl extends CtlBase {
}
}
async provinceList(pobj, pobj2, req) {
try {
return system.getResultSuccess([
{"id": 1100, "name":"北京市"},
{"id": 1200, "name":"天津市"},
{"id": 1300, "name":"河北省"},
{"id": 1400, "name":"山西省"},
{"id": 1500, "name":"内蒙古自治区"},
{"id": 2100, "name":"辽宁省"},
{"id": 2200, "name":"吉林省"},
{"id": 2300, "name":"黑龙江省"},
{"id": 3100, "name":"上海市"},
{"id": 3200, "name":"江苏省"},
{"id": 3300, "name":"浙江省"},
{"id": 3400, "name":"安徽省"},
{"id": 3500, "name":"福建省"},
{"id": 3600, "name":"江西省"},
{"id": 3700, "name":"山东省"},
{"id": 4100, "name":"河南省"},
{"id": 4200, "name":"湖北省"},
{"id": 4300, "name":"湖南省"},
{"id": 4400, "name":"广东省"},
{"id": 4500, "name":"广西壮族自治区"},
{"id": 5000, "name":"重庆市"},
{"id": 5100, "name":"四川省"},
{"id": 5200, "name":"贵州省"},
{"id": 5300, "name":"云南省"},
{"id": 5400, "name":"西藏自治区"},
{"id": 6100, "name":"陕西省"},
{"id": 6200, "name":"甘肃省"},
{"id": 6300, "name":"青海省"},
{"id": 6400, "name":"宁夏回族自治区"},
{"id": 6500, "name":"新疆维吾尔自治区"},
{"id": 7100, "name":"台湾省"},
{"id": 8100, "name":"香港特别行政区"},
{"id": 8200, "name":"澳门特别行政区"},
]);
} catch (e) {
console.log(e);
return system.getResultFail(500, "接口错误");
}
}
}
module.exports = DeliverCtl;
\ No newline at end of file
......@@ -3,8 +3,17 @@ const CtlBase = require("../../ctlms.base");
class InvoiceCtl extends CtlBase {
constructor() {
super();
this.invoiceSve = system.getObject("service.invoice.invoiceSve");
this.deliverSve = system.getObject("service.common.deliverSve");
this.invoiceSve = system.getObject("service.invoice.invoiceSve");
this.pageType = {
"0": ["2020", "2030"], // 我的业务发票
"1": ["2010"], // 发票办理
};
}
getPageStatus(type) {
type = this.trim(type || "0");
return this.pageType[type];
}
/**
......@@ -34,15 +43,34 @@ class InvoiceCtl extends CtlBase {
}
}
setRoleAuth(pobj, loginUser) {
if (loginUser.isManager) {
// 暂时先什么都不做
} else
if (loginUser.isMain) {
if (!loginUser.org_path) {
return system.getResultSuccess({count: 0, rows: []});
}
pobj.operator_path_like = loginUser.org_path + "%";
} else {
pobj.operator_id = loginUser.id || 0;
}
}
/**
* 发票申请列表-业务员
* @param {*} pobj
*/
async myInvoicePage(pobj, pobj2, req) {
try {
pobj.operator_id = req.loginUser.id;
pobj.assigned = true;
// 获取页面类型状态
pobj.statuses = this.getPageStatus(pobj.pageType);
// 设置角色参数
this.setRoleAuth(pobj, req.loginUser);
this.doTimeCondition(pobj, ["createTimeBegin", "createTimeEnd"]);
return await this.invoiceSve.invoicePage(pobj);
return await this.invoiceSve.invoicePage(pobj);
} catch (error) {
console.log(error);
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
......@@ -53,15 +81,8 @@ class InvoiceCtl extends CtlBase {
* 进度处理
* @param {*} pobj
*/
async handleStatus(pobj, pobj2, req) {
async handleStatus(pobj) {
try {
if(pobj.status=="1030" || pobj.operator_id){
let user = await this.deliverSve.deliverUserById({id: pobj.operator_id});
if (!user || user.status != 0 || !user.data) {
return system.getResult(null, `业务员【${pobj.operator_id}】不存在`);
}
pobj.operator_path = user.data.org_path;
}
return await this.invoiceSve.handleStatus(pobj);
} catch (error) {
console.log(error);
......@@ -82,6 +103,102 @@ class InvoiceCtl extends CtlBase {
}
}
/**
* 发票申请
* @param {*} pobj
*/
async invoiceApply(pobj, pobj2, req) {
if(!pobj.deliver_id){
return system.getResult(null,`请重新登录`);
}
try {
pobj.invoice_amount = system.y2f(pobj.invoice_amount);
pobj.additional_tax = system.y2f(pobj.additional_tax);
pobj.value_added_tax = system.y2f(pobj.value_added_tax);
pobj.personal_invoice_tax = system.y2f(pobj.personal_invoice_tax);
// pobj.invoice_content = system.y2f(pobj.invoice_content);
return await this.invoiceSve.invoiceApply(pobj);
} catch (error) {
console.log(error);
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
}
}
/************************一下是阿里接口*************************************/
/**
*发票开具
* @returns {Promise<void>}
*/
async deliveryAcceptance(pobj, pobj2, req){
try {
let rs = await this.invoiceSve.handleStatus(pobj);
if (rs && rs.status === 0) {
// this.记账
this.jizhang(pobj, pobj2, req);
}
return rs;
} catch (error) {
console.log(error);
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
}
}
async jizhang(pobj, pobj2, req) {
return await this.invoiceSve.uploadDetail(pobj.invoice_id);
}
/**
* 客户交付
* @param pobj
* @param pobj2
* @param req
* @returns {Promise<void>}
*/
async deliveryCustomer(pobj, pobj2, req){
if(!pobj.invoice_id){
return system.getResult(null, `参数错误 发票ID 不能为空`);
}
if(!pobj.deliver_mail_no){
return system.getResult(null, `参数错误 快递单不能为空`);
}
try {
return await this.invoiceSve.handleStatus(pobj);
} catch (error) {
console.log(error);
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
}
}
/**
* 分配业务员
* @param pobj
* @param pobj2
* @param req
* @returns {Promise<void>}
*/
async deliverAssignSalesman(pobj, pobj2, req) {
if (!pobj.invoice_id) {
return system.getResult(null, `参数错误 发票ID不能为空`);
}
if (!pobj.status) {
return system.getResult(null, `参数错误 订单状态不能为空`);
}
if (!pobj.operator_id) {
return system.getResult(null, `参数错误 业务员ID不能为空`);
}
let user = await this.deliverSve.deliverUserById({id: pobj.operator_id});
if (!user || user.status != 0 || !user.data) {
return system.getResult(null, `业务员【${pobj.operator_id}】不存在`);
}
pobj.operator_path = user.data.org_path;
try {
return await this.invoiceSve.handleStatus(pobj);
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
......
var system = require("../../../system")
const system = require("../../../system")
const settings = require("../../../../config/settings")
const CtlBase = require("../../ctlms.base");
const moment = require("moment");
class OrderCtl extends CtlBase {
constructor() {
super();
this.orderSve = system.getObject("service.order.orderSve");
this.deliverSve = system.getObject("service.common.deliverSve");
this.businessmenSve = system.getObject("service.business.businessmenSve");
}
async processList(pobj, pobj2, req) {
......@@ -85,13 +90,12 @@ class OrderCtl extends CtlBase {
}
}
/**
* 分配业务员
* @param {*} pobj
* @param {*} pobj2
* @param {*} req
* @param {*} pobj
* @param {*} pobj2
* @param {*} req
*/
async deliverAssignSalesman(pobj, pobj2, req) {
if (!pobj.id) {
......@@ -103,7 +107,11 @@ class OrderCtl extends CtlBase {
if (!pobj.operator_id) {
return system.getResult(null, `参数错误 业务员ID不能为空`);
}
let user = await this.deliverSve.deliverUserById({id: pobj.operator_id});
if (!user || user.status != 0 || !user.data) {
return system.getResult(null, `业务员【${pobj.operator_id}】不存在`);
}
pobj.operator_path = user.data.org_path;
try {
return await this.orderSve.handleStatus(pobj);
} catch (error) {
......@@ -163,9 +171,15 @@ class OrderCtl extends CtlBase {
* @param {*} req
*/
async businessRegisterComplete(pobj, pobj2, req) {
let deliver = await this.getDeliver(req);
if (!deliver) {
return system.getResult(null, `登录信息错误,请重新登录`);
}
if (!pobj.id) {
return system.getResult(null, `参数错误 订单ID不能为空`);
}
if (!pobj.status) {
return system.getResult(null, `参数错误 状态码不能为空`);
}
......@@ -192,8 +206,11 @@ class OrderCtl extends CtlBase {
// return system.getResult(null, `参数错误 工商官方文件不能为空`);
// }
pobj.bd_id = req.loginUser.id;
pobj.bd_path = req.loginUser.orgpath;
if(!pobj.deliver_id){
return system.getResult(null,`请重新登录`);
}
pobj.deliver_id = pobj.deliver_id;
pobj.company_id = deliver.nt_company_id;
try {
return await this.orderSve.handleStatus(pobj);
......@@ -495,5 +512,273 @@ class OrderCtl extends CtlBase {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/***************************************************一下是阿里改版的接口*****************************************************************/
/**
* 新增订单
* @returns {Promise<void>}
* @params product_id 产品ID
* @params source_id 来源ID
* @params source_no 来源订单号
* @params desc 订单信息
* @params contact_mobile 联系电话
* @params customer_name 客户名称
*
* deliver_id:""
product_id:"10020000",
product_items: ["10020200","10020300","10020400","10020500","10020600",10020700],
customer_name: "",
contact_mobile:"",
*/
async addSourceOrder(pobj, pobj2, req) {
if (!pobj.product_id) {
return system.getResult(null, `参数错误 产品ID不能为空`);
}
if (!pobj.contact_mobile) {
return system.getResult(null, `参数错误 联系电话不能为空`);
}
if (!pobj.customer_name) {
return system.getResult(null, `参数错误 客户名称不能为空`);
}
if(!pobj.chooseItems){
pobj.chooseItems = ["10020200","10020300","10020400","10020500","10020600","10020700"];
}
if(!pobj.chooseItems.includes("10020200")){
pobj.chooseItems.push("10020200");
}
pobj.service_items = pobj.chooseItems;
pobj.source_id = pobj.source_id || '1003';
pobj.notes = pobj.desc || "工商注册,刻章,银行卡户,税务报到,建账";
if(!pobj.deliverId){
return system.getResult(null,`请重新登录`);
}
pobj.deliver_id = pobj.deliverId;
pobj.deliver_name = pobj.deliverName || "";
pobj.delier_user_id = pobj.delier_user_id || "";
pobj.deliver_user_path = pobj.deliver_user_path || "";
try {
return await this.orderSve.addSourceOrder(pobj);
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* ali完善订单
* @param pobj
* @param pobj2
* @param req
* @returns {Promise<void>}
*/
async aliPerfectInformation(pobj, pobj2, req){
if(!pobj.id){
return system.getResult(null,`订单【${pobj.id}】不存在`)
}
if(!pobj.status){
return system.getResult(null,`订单状态不能为空`)
}
try {
return await this.orderSve.handleStatus(pobj);
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* ali建账
* @param pobj
* @param pobj2
* @param req
* @returns {Promise<void>}
*/
async accountCreation (pobj, pobj2, req){
let deliver = await this.getDeliver(req);
if (!deliver) {
return system.getResult(null, `登录信息错误,请重新登录`);
}
if(!pobj.id){
return system.getResult(null,`订单【${pobj.id}】不存在`)
}
if(!pobj.status){
return system.getResult(null,`订单状态不能为空`)
}
if(!pobj.province){
return system.getResult(null,`省份不能为空`)
}
try {
let rs = await this.orderSve.handleStatus(pobj);
if (rs && rs.status === 0) {
this.createAccount(pobj, deliver, req.loginUser);
}
return rs;
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* @params 建仗
*/
async createAccount(params, deliver, loginUser) {
try {
// 查个体户
let businessmen = await this.businessmenSve.byOrderId({order_id: params.id});
businessmen = businessmen.data;
let companyId = businessmen.company_id || loginUser.deliver.nt_company_id;
let user = await this.deliverSve.deliverUserInfo({id: deliver.admin_id}) || {};
user = (user.data || {}).user || {};
let data = {
customerName: businessmen.name,
initPeriod: Number(moment().format("YYYYMM")),
// initPeriod: moment().format("YYYYMM"),
accountStandard: 1,
valueAddedTax: 2,
bankStatus: businessmen.is_bank ? 1 : 0,
accountant: user.nt_user_id,
province: businessmen.province,
companyId: companyId,
}
let url = settings.ntapi().createCustomer;
let res = await this.orderSve.callApi(url, data, "建账");
console.log(res);
if (!res || !res.data) {
return system.getResult(null, "建账失败");
}
if (res.data) {
await this.orderSve.callms("order", "createAccount", {
id: businessmen.id,
province: params.province,
customer_id: res.data
});
}
return system.getResultSuccess();
} catch (error) {
console.log(error.stack);
return system.getResult(error);
}
}
/**
* ali客户交付
* @param {*} params
*/
async orderComplete(pobj, pobj2, req) {
if (!pobj.id) {
return system.getResult(null, `参数错误 订单ID不能为空`);
}
if (!pobj.status) {
return system.getResult(null, `参数错误 订单状态不能为空`);
}
if (!pobj.guest_mail_no) {
return system.getResult(null, `参数错误 客户快递单号不能为空`);
}
if (!pobj.guest_mail_img) {
return system.getResult(null, `参数错误 交付商交付快递单号图片不能为空`);
}
try {
return await this.orderSve.handleStatus(pobj);
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* 阿里 全部订单
* @returns {Promise<void>}
*/
async aliOrderPageAll(pobj, pobj2, req){
let statusMap = {
"1":"2010", //待完善
"2":"2020",//工商注册g
"3":"2030",//刻章办理
"4":"2040",//银行开户
"5":"2050",//税务报道
"6":"2060",//核定税种
"7":"2070",//建帐
"8":"2080",//客户交付
"9":"2090"//订单完成
};
var condition = {
currentPage: Number(pobj.currentPage || 1),
pageSize: Number(pobj.pageSize || 10),
deliver_id: pobj.deliver_id,
}
if(pobj.createdBegin){
condition.createdBegin = this.trim(pobj.createdBegin);
}
if(pobj.createdEnd){
condition.createdEnd = this.trim(pobj.createdEnd);
}
if(pobj.status){
condition.status = statusMap[pobj.status];
}
if(pobj.order_id){
condition.id = this.trim(pobj.order_id);
}
this.doTimeCondition(condition, ["createdBegin", "createdEnd"]);
return await this.orderSve.aliOrderPageAll(condition);
}
/**
* 阿里 我的业务订单
* @returns {Promise<void>}
*/
async aliOrderPage(pobj, pobj2, req){
//1.2010~2090状态
let statusMap = {
"1":"2010", //待完善
"2":"2020",//工商注册g
"3":"2030",//刻章办理
"4":"2040",//银行开户
"5":"2050",//税务报道
"6":"2060",//核定税种
"7":"2070",//建帐
"8":"2080",//客户交付
"9":"2090"//订单完成
};
// if(!statusMap[pobj.status]){
// return system.getResult(null, `订单状态错误`);
// }
var condition = {
currentPage: Number(pobj.currentPage || 1),
pageSize: Number(pobj.pageSize || 10),
deliver_id: pobj.deliver_id,
status:statusMap[pobj.status],
// status:pobj.status,
isMain:pobj.isMain,
isManager:pobj.isManager,
deliver_user_id:pobj.deliver_user_id,
deliver_user_path:pobj.deliver_user_path
}
if(pobj.createdBegin){
condition.createdBegin = this.trim(pobj.createdBegin);
}
if(pobj.createdEnd){
condition.createdEnd = this.trim(pobj.createdEnd);
}
if(pobj.order_id){
condition.id = this.trim(pobj.order_id);
}
if(pobj.statusArray){
let statusArray = [];
for (let item of pobj.statusArray) {
statusArray.push(statusMap[item]);
}
condition.statusArray = statusArray;
}
this.doTimeCondition(condition, ["createdBegin", "createdEnd"]);
return await this.orderSve.aliOrderPage(condition);
}
}
module.exports = OrderCtl;
\ No newline at end of file
......@@ -48,11 +48,12 @@ class UserCtl extends CtlBase {
let loginBaseUrl = system.base64_encode(loginUrl);
let test = system.base64_decode(loginBaseUrl);
console.log(test);
let subsid = "sub_" + loginKey.xggadminsid.replace("jfs_", "");
let rs = {
key: loginKey.xggadminsid,
taxLoginUrl: ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${loginKey.subsid}&target=tax&baseurl=${loginBaseUrl}`,
finLoginUrl: ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${loginKey.subsid}&baseurl=${loginBaseUrl}`,
taxLoginUrl: ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${subsid}&target=tax&baseurl=${loginBaseUrl}`,
finLoginUrl: ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${subsid}&baseurl=${loginBaseUrl}`,
loginname: loginUser.ucname,
auth: loginUser.auth,
isManager: loginUser.isManager,
......@@ -67,19 +68,35 @@ class UserCtl extends CtlBase {
}
}
async ngaLogin(params, pobj2, req, res) {
// 登录用户
let loginUser = req.loginUser;
// 登录地址加密
let ntapi = settings.ntapi();
let loginUrl = settings.protocalPrefix + req.headers['host'] + "/#/logins";
console.log(loginUrl, "---------------loginUrl--------------");
let loginBaseUrl = system.base64_encode(loginUrl);
let url;
// 登录用户key
let subsid = "sub_" + req.sid.replace("jfs_", "");
await this.redisClientTax.setWithEx(subsid, (loginUser.nt_user_id || "").toString(), 60 * 60 * 5);
if (params.type == "tax") {
url = ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${subsid}&target=tax&baseurl=${loginBaseUrl}`;
} else {
url = ntapi.finLoginUrl + `?username=${loginUser.ucname}&cookieId=${subsid}&baseurl=${loginBaseUrl}`;
}
return system.getResult(url);
}
async setLogin(user) {
user.loginsid = "jfs_" + uuidv4();
user.subsid = "sub_" + uuidv4();
// if(settings.env == 'dev') {
// user.loginsid = "jfs_" + "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
// user.subsid = "sub_" + "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
// }
// xggadminsid = "jfs_" + "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
await this.redisClient.setWithEx(user.loginsid, JSON.stringify(user), 60 * 60 * 5);
await this.redisClientTax.setWithEx(user.subsid, (user.nt_user_id || "").toString(), 60 * 60 * 5);
await this.redisClient.setWithEx(user.loginsid + "_deliver", JSON.stringify(user.deliver), 60 * 60 * 5);
return {
xggadminsid: user.loginsid,
subsid: user.subsid,
xggadminsid: user.loginsid
};
}
......@@ -115,10 +132,13 @@ class UserCtl extends CtlBase {
"name": "订单中心",
"icon": "iconfont icon-gth-gsdingdanzhongxin",
"team": [
{
"name": "订单管理",
"path": "/trading/ordersAll"
},
{"name": "全部订单", "path": "/trading/ordersAll"},
{"name": "工商注册", "path": "/trading/glyRegister"},
{"name": "刻章办理", "path": "/trading/glyHandle"},
{"name": "银行开户", "path": "/trading/glyBank"},
{"name": "税务报道", "path": "/trading/glyReport"},
{"name": "代理记账", "path": "/trading/glyAccount"},
{"name": "我的业务订单", "path": "/trading/glyorderInformation"},
]
},
{
......@@ -131,16 +151,6 @@ class UserCtl extends CtlBase {
},
]
},
// {
// "name": "用户中心",
// "icon": "iconfont icon-gth-gsgetihuzhongxin",
// "team": [
// {
// "name": "用户管理",
// "path": "/user/userCenter"
// }
// ]
// }
];
} else {
return [
......@@ -158,10 +168,12 @@ class UserCtl extends CtlBase {
"name": "订单中心",
"icon": "iconfont icon-gth-gsdingdanzhongxin",
"team": [
{
"name": "我的业务订单",
"path": "/trading/orderInformation"
}
{"name": "工商注册", "path": "/trading/glyRegister"},
{"name": "刻章办理", "path": "/trading/glyHandle"},
{"name": "银行开户", "path": "/trading/glyBank"},
{"name": "税务报道", "path": "/trading/glyReport"},
{"name": "代理记账", "path": "/trading/glyAccount"},
{"name": "我的业务订单", "path": "/trading/glyorderInformation"},
]
},
{
......@@ -194,7 +206,8 @@ class UserCtl extends CtlBase {
icon: "iconfont icon-gth-gsfapiaozhongxin",
team: [
{name: "发票申请", path: "/trading/invoiceApplyFor"},
{name: "发票管理", path: "/trading/invoiceManagement"},
{name: "发票办理", path: "/trading/invoiceManagement"},
{name: "我的发票业务", path: "/trading/invoiceApplyMy"},
]
}
];
......@@ -209,8 +222,8 @@ class UserCtl extends CtlBase {
name: "发票中心",
icon: "iconfont icon-gth-gsfapiaozhongxin",
team: [
{name: "我的业务发票", path: "/trading/invoiceApplyMy"},
{name: "我的全部发票", path: "/trading/invoicesAllMy"},
{name: "发票办理", path: "/trading/invoiceManagement"},
{name: "我的发票业务", path: "/trading/invoiceApplyMy"},
]
}
];
......
......@@ -7,6 +7,12 @@ class BusinessmenService extends ServiceBase {
super();
}
async byOrderId(params) {
let rs = await this.callms("order", "businessmenByOrderId", params);
this.transField([rs.data]);
return rs;
}
async allPage(params) {
let rs = await this.callms("order", "businessmenPage", params);
if (rs.status != 0 || !rs.data || !rs.data.rows) {
......
......@@ -60,7 +60,12 @@ class DeliverService extends ServiceBase {
this.synSave(rs.data.id, params.password);
}
return rs;
}
}
async deliverUserInfo(params) {
let rs = await this.callms("common", "deliverUserInfo", params);
return rs;
}
async synSave(id, password) {
let rs = await this.callms("common", "deliverUserInfo", {id: id});
......
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
const settings = require("../../../../config/settings")
const moment = require("moment")
class InvoiceService extends ServiceBase {
constructor() {
super();
......@@ -37,5 +38,184 @@ class InvoiceService extends ServiceBase {
return rs;
}
/**
* fn:为了对接财务宝 格式化发票类型
*
* @param {*} invoice_type
*/
formatInvoiceType(invoicesummaryinfo) {
let _billType = null;
if (!invoicesummaryinfo.invoice_type) {
return system.getResult(null, `系统错误 发票类型错误`);
}
if (invoicesummaryinfo['invoice_type'] == '10') {
_billType = `1`;
} else if (invoicesummaryinfo['invoice_type'] == '20') {
_billType = `2`;
} else if (invoicesummaryinfo['invoice_type'] == '30') {
_billType = `0`;
} else {
return system.getResult(null, `系统错误 发票类型错误`);
}
return _billType;
}
/**
* fn:为了对接财务宝 格式化发票联次
*
* @param {*} invoice_type
*/
formatInvoiceJoin(invoicesummaryinfo) {
let invoiceOrder = null;
if (!invoicesummaryinfo.invoice_join) {
return system.getResult(null, `系统错误 发票联次错误`);
}
if (invoicesummaryinfo['invoice_join'] == '10') {
invoiceOrder = `3`;
} else if (invoicesummaryinfo['invoice_join'] == '20') {
invoiceOrder = `0`;
} else if (invoicesummaryinfo['invoice_join'] == '30') {
invoiceOrder = `1`;
} else if (invoicesummaryinfo['invoice_join'] == '40') {
invoiceOrder = `2`;
} else {
return system.getResult(null, `系统错误 发票类型错误`);
}
return invoiceOrder;
}
/**
* fn:为了对接财务宝 格式化发票摘要
* @param {*} invoicesummaryinfo
*/
formatSummary(invoicesummaryinfo) {
if (!invoicesummaryinfo.summary) {
return system.getResult("系统错误 发票摘要信息错误");
}
let _res = [];
for (let item of invoicesummaryinfo.summary) {
// item = JSON.parse(item);
let temp = {
abstractMsg: item.summaryInfo,
attr: {
"standard": item.category,
"unit": item.unit,
"number": item.number,
"unit_price": item.unitPrice
},
amount: item.amount,
tax: item.taxAmount,
totalPrice: Number(item.amount) + Number(item.taxAmount),
taxrate: item.taxRate,
abstractType: item.summaryType
};
_res.push(temp);
}
return _res;
}
/**
* fn:提交发票道财税系统
* @param {*} invoice_id
*/
async uploadDetail(invoice_id) {
let invoice = await this.callms("invoice", "invoice", {
id: invoice_id
});
if (!invoice || !invoice.data) {
return system.getResult(`发票不存在`);
}
//获取个体户信息 拿到customer 在order服务下 参数:通过merchant_credit_code或者是merchant_id (购买方商户)
if (!invoice.data.invoicesummaryinfo || !invoice.data.invoicesummaryinfo.businessmen_credit_code) {
return system.getResult(`发票信息错误`);
}
let businessmen = await this.callms("order", "queryObusinessmenByCreditCode", {
credit_code: invoice.data.invoicesummaryinfo.businessmen_credit_code
});
//获取交付商信息 拿到companyID 在common服务下 参数:通过deliver_id
if (!invoice.data.deliver_id) {
return system.getResult(`交付商不存在`);
}
var deliver = await this.callms("common", "deliverInfo", {
id: invoice.data.deliver_id
});
if (!deliver.data) {
return system.getResult(null, `交付商不存在`);
}
if (!deliver.data.nt_company_id) {
return system.getResult(null, `个体户还未建账,请先建账`);
}
let _params = await this.buildParams(businessmen.data, invoice.data, deliver.data) || {};
try {
if (!_params) {
console.log("推送失败,参数错误");
return system.getResult("推送失败,参数错误");
}
let url = settings.ntapi().uploadDetail;
let res = await this.callApi(url, _params, "提交发票");
console.log(res);
if (!res || res.code != '000000') {
return system.getResult(null, "提交发票失败");
}
//更新发票建账
await this.callms("invoice", "uploadDetail", {
id: invoice_id
});
return system.getResultSuccess();
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 推送失败`);
}
}
// http://nga-api.gongsibao.com/nga-api/uploadDetail
/**
* 推送票据
*/
async buildParams(businessmen, invoice, deliver) {
try {
let _invoicesummaryinfo = invoice.invoicesummaryinfo || null;
if (!_invoicesummaryinfo) {
return system.getResult(null, `系统错误 发票信息错误`);
}
let params = {
companyId: deliver.nt_company_id, //公司ID
customerId: businessmen.customer_id, //客户ID
uploadPeriod: moment(businessmen.create_account_time).format('YYYYMM'), //上传账期
imageName: invoice['invoice_img'].slice(invoice['invoice_img'].lastIndexOf("/") + 1) || "", //图片名称
imageBasename: invoice['invoice_img'] || "", //图片url
billType: this.formatInvoiceType(_invoicesummaryinfo), //发票类型
isDaikai: `1`, //是否代开 1:yes 0:no
signDate: moment(_invoicesummaryinfo.invoice_time).format("YYYY-MM-DD"), //开票时间
invoiceCode: _invoicesummaryinfo.invoice_no, //发票代码
invoiceNumber: _invoicesummaryinfo.invoice_number, //发票号码
invoiceOrder: this.formatInvoiceJoin(_invoicesummaryinfo), //发票联次
payName: _invoicesummaryinfo.merchant_name,
receiveName: _invoicesummaryinfo.businessmen_name,
payBank: _invoicesummaryinfo.merchant_bank,
payAccount: _invoicesummaryinfo.merchant_account,
payTel: _invoicesummaryinfo.merchant_mobile,
payAddress: _invoicesummaryinfo.merchant_addr,
payAccountAame: "", //xxxx
payerTaxIdentificationNumber: _invoicesummaryinfo.merchant_credit_code,
receiveBank: _invoicesummaryinfo.businessmen_bank,
receiveAccount: _invoicesummaryinfo.businessmen_account,
receiveTel: _invoicesummaryinfo.businessmen_mobile,
receiveAddress: _invoicesummaryinfo.businessmen_addr,
receiveTaxIdentificationNumber: _invoicesummaryinfo.businessmen_credit_code,
// province: PROVINCE_CODE_MAP[_invoicesummaryinfo.province],
province: _invoicesummaryinfo.province,
receiveAccountName: "", //xxxx
sourceClient: "0", //票据来源
createDate: moment(_invoicesummaryinfo.created_at).format("YYYY-MM-DD HH:ss:mm"), //创建时间
// createDate:new Date(_invoicesummaryinfo.created_at), //创建时间
list: this.formatSummary(_invoicesummaryinfo)
}
return params;
} catch (error) {
console.log(error);
return {};
}
}
}
module.exports = InvoiceService;
\ No newline at end of file
......@@ -34,6 +34,11 @@ class OrderService extends ServiceBase {
return rs;
}
async orderAndDeliver(params) {
var rs = await this.callms("order", "orderAndDeliver", params);
return rs;
}
async orderInfoAll(params) {
let rs = await this.callms("order", "orderInfoAll", params);
// await this.setUcUser([rs.data.order]);
......@@ -61,6 +66,24 @@ class OrderService extends ServiceBase {
}
}
}
async setDeliverOperatorUser(rows) {
if (!rows || rows.length == 0) {
return;
}
let ids = [];
for (let row of rows) {
if (row.odeliver && row.odeliver.operator_id) {
ids.push(row.odeliver.operator_id);
}
}
let map = await this.deliverSve.mayByIds(ids);
for (let row of rows) {
let user = map[row.odeliver.operator_id] || {};
row.odeliver.operator_name = user.real_name || "";
}
}
async setUcUser(rows) {
if (!rows || rows.length == 0) {
......@@ -121,5 +144,46 @@ class OrderService extends ServiceBase {
var rs = await this.callms("order", "updateOBusinessmenProinvce", params);
return rs;
}
/*********************************************以下是阿里的接口****************************************************************/
/**
* 添加订单
* @param params
* @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}|{msg: string, data, bizmsg: *|string, status: number}|*|undefined>}
*/
async addSourceOrder(params) {
try {
return await this.callms("order", "addSourceOrder", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async aliOrderPageAll(params){
try {
let rs = await this.callms("order", "aliOrderPageAll", params);
if (rs.status === 0 && rs.data) {
await this.setDeliverOperatorUser(rs.data.rows);
}
return rs;
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async aliOrderPage(params){
try {
let rs = await this.callms("order", "aliOrderPage", params);
if (rs.status === 0 && rs.data) {
await this.setDeliverOperatorUser(rs.data.rows);
}
return rs;
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = OrderService;
\ No newline at end of file
......@@ -132,7 +132,7 @@ class UserService extends ServiceBase {
async salesmanList(params) {
try {
let rs = await this.callms("common", "deliverUsers", params);
let rs = await this.callms("common", "deliverUserAll", params);
return rs;
} catch (error) {
console.log(error);
......
......@@ -193,18 +193,17 @@ class System {
// merchant: "http://127.0.0.1:3101" + path,
// 订单服务
order: domain2+ ":3103" + path,
// order: domain + ":3103" + path,
order: domain2 + ":3103"+ path,
// 发票服务
invoice: domain2 + ":3105" + path,
// invoice: "http://127.0.0.1:3105" + path,
// 发票服务
uc: domain2 + ":3106" + path,
// uc: "http://127.0.0.1:3106" + path,
}
} else {
var odomain = "http://123.57.217.203"
return {
common: "xggsvecommon-service" + path,
merchant: "xggsvemerchant-service" + path,
......
......@@ -16,13 +16,13 @@ module.exports = function (app) {
jsonUser = JSON.parse(jsonUser);
}
}
req.sid = xggadminsid || "";
if (req.url.indexOf("auth/userCtl/login") > 0 ||
req.url.indexOf("uc/userCtl/login") > 0 ||
req.url.indexOf("auth/userCtl/smsCode") > 0 ||
req.url.indexOf("common/metaCtl/getApiDoc") > 0 ||
req.url.indexOf("common/captchaCtl/captcha") > 0 ||
req.url.indexOf("invoice/invoiceCtl/jizhang") > 0 ||
req.url.indexOf("getRsConfig") > 0) {
if (jsonUser) {
req.loginUser = jsonUser;
......@@ -104,6 +104,11 @@ module.exports = function (app) {
req.body.saas_id = req.loginUser.saas_id;
req.body.deliverId = req.loginUser.deliver_id || "";
req.body.deliver_id = req.loginUser.deliver_id || "";
req.body.deliverName = req.loginUser.deliver.name ||"";
req.body.deliver_user_id = req.loginUser.id || "";
req.body.deliver_user_path = req.loginUser.org_path || "";
req.body.isManager = req.loginUser.isManager;
req.body.isAdmin = req.loginUser.isAdmin;
}
params.push(methodName);
......
......@@ -26,7 +26,7 @@ var settings = {
salt: "%iatpD1gcxz7iF#B",
defaultpwd: "987456",
basepath: path.normalize(path.join(__dirname, '../..')),
port: process.env.NODE_PORT || 3012,
port: process.env.NODE_PORT || 3112,
reqEsAddr: function () {
if (this.env == "dev") {
var localsettings = require("./localsettings");
......@@ -91,7 +91,7 @@ var settings = {
domain_page = "https://nt.gongsibao.com";
} else {
domain = "https://nga-api.gongsibao.com";
domain_page = "https://nga.gongsibao.com";
domain_page = "https://ali-saas.gongsibao.com";
}
return {
......@@ -127,10 +127,14 @@ var settings = {
redisTax: function () {
if (this.env == "dev") {
return {
host: "47.94.0.45",
// host: "47.94.0.45",
// port: "6379",
// password: "nga2020",
// db: "0",
host: "r-2zejem2xk438n71rny.redis.rds.aliyuncs.com",
port: "6379",
password: "nga2020",
db: "0",
password: "yo#@eXz9EMpa+5O",
db: "10",
};
} else {
return {
......
<a name="menu">目录</a>
1. [业务进度字典](#processList)
2. [发票申请页](#invoicePage)
1. [申请列表页](#myInvoicePage)
2. [发票申请](#invoicePage) -- 改
1. [发票办理](#myInvoicePage0) -- 改
1. [我的业务发票](#myInvoicePage1) -- 改
1. [分配业务员](#deliverAssignSalesman)
1. [开具发票](#invoiced)
1. [提交审核](#submitAudit)
1. [审核失败](#deliverReject)
1. [交付商交付](#delivered)
1. [查询详细信息](#invoice)
1. [发票开具](#deliveryAcceptance) -新加
1. [客户交付](#deliveryCustomer) -新加
## **<a name="processList"> 业务进度字典 </a>**
[返回到目录](#menu)
##### URL
......@@ -42,7 +44,7 @@
```
## **<a name="invoicePage"> 发票申请 </a>**
## **<a name="invoicePage"> 发票申请 </a>**
[返回到目录](#menu)
##### URL
[/web/invoice/invoiceCtl/invoicePage]
......@@ -54,13 +56,61 @@
说明:
操作按钮显示
查看详情 全部转态都显示
业务分配 status = 1030
提交审核 status = 1050
业务交付 status = 1070
业务分配 status = 2000
{
"currentPage":1,
"pageSize": 2,
"apply_no":"", // 申请编号
"status":"", // 进度状态
"invoice_type":"", // 发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票
"createTimeBegin":"", // 申请时间-开始
"createTimeEnd":"" // 申请时间-结束
}
```
#### 返回结果
```javascript
{
"count": 5,
"rows": [
{
"id": "11855671564003193",
"channel_id": "1",
"product_id": "50010000",
"apply_no": "GONGSIBAO20200213", // 申请编号
"invoice_type": "10", // 发票类型
"invoice_amount": 5000, // 价税合计总额
"created_at": "2020-03-12 10:46:00", // 申请时间
"status": "2000", // 进度状态
"status_name": "交付商分配", // 进度状态名称
"merchant_name": "汉唐信通(北京)科技有限公司", // 发票抬头
"businessmen_name": "北京创知厚德科技有限公司", // 开票方
"deliver_name": "1", // 交付商名称
"oproduct": { // 产品
"name": "发票申请",
"desc": "发票申请,发票红冲",
}
},
],
"requestid": "dc53b7fb2151425e8366edfe317bb8b5"
}
```
## **<a name="myInvoicePage0"> 发票办理 </a>**
[返回到目录](#menu)
##### URL
[/web/invoice/invoiceCtl/myInvoicePage]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"currentPage":1,
"pageSize": 2,
"pageType": "0", -- // 发票办理 此处传0
"apply_no":"", // 申请编号
"status":"", // 进度状态
"invoice_type":"", // 发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票
......@@ -71,6 +121,7 @@
#### 返回结果
```javascript
一直显示发票开具按钮
{
"count": 5,
......@@ -85,13 +136,6 @@
"created_at": "2020-03-12 10:46:00", // 申请时间
"status": "1110", // 进度状态
"status_name": "业务完成", // 进度状态名称
"next_status": [ // 下一个进度
{
"next_status": "1010", // 状态码
"next_name": "待完善" // 状态名称
}
],
"merchant_name": "汉唐信通(北京)科技有限公司", // 发票抬头
"businessmen_name": "北京创知厚德科技有限公司", // 开票方
"invoice_deliver": { // 交付商对象
......@@ -109,24 +153,21 @@
```
## **<a name="myInvoicePage"> 申请列表页 </a>**
## **<a name="myInvoicePage1"> 我的业务发票 </a>**
[返回到目录](#menu)
##### URL
[/web/invoice/invoiceCtl/myInvoicePage]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
说明:
操作按钮显示
查看详情 全部转态都显示
新建进度 status = 1040 || 1080,显示当前status_name
按钮规则
status == 2020时,显示客户交付按钮
``` javascript
{
"currentPage":1,
"pageSize": 2,
"pageType": "1", -- // 我的业务发票
"apply_no":"", // 申请编号
"status":"", // 进度状态
"invoice_type":"", // 发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票
......@@ -151,13 +192,6 @@
"created_at": "2020-03-12 10:46:00", // 申请时间
"status": "1110", // 进度状态
"status_name": "业务完成", // 进度状态名称
"next_status": [ // 下一个进度
{
"next_status": "1010", // 状态码
"next_name": "待完善" // 状态名称
}
],
"merchant_name": "汉唐信通(北京)科技有限公司", // 发票抬头
"businessmen_name": "北京创知厚德科技有限公司", // 开票方
"invoice_deliver": { // 交付商对象
......@@ -174,7 +208,6 @@
```
## **<a name="invoice"> 查询详细信息 </a>**     
[返回到目录](#menu)     
##### URL
......@@ -334,7 +367,7 @@
{
"invoice_id":"11855671564003193", //发票ID
"operator_id": "001", //业务员ID
"status":"1040" //业务状态
"status":"2010" //业务状态 ali:2010
}
```
......@@ -513,4 +546,115 @@
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="deliveryAcceptance"> 发票开具 </a>**     
[返回到目录](#menu)     
##### URL
[/web/invoice/invoiceCtl/handleStatus]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求参数
#### 示例
#### 示例
```javascript
{
"invoice_id":"11855693476003245", //发票ID
"status": "2020", //业务状态
"province":"上海市", //省份
"invoice_type":"10", //发票类型
"invoice_join":"10", //发票联次
"invoice_no":"17485952652", //发票编号
"invoice_number":"NO 02995608", //发票号码
"invoice_time":"2020-03-10 00:00:00", //开票时间
"merchant_name":"汉唐信通(北京)科技有限公司", //销售方名称
"merchant_credit_code":"911101083066224948", //销售方统一社会信用代码
"merchant_addr":"北京市海淀区北清路164号17-27号院813号", //销售方地址
"merchant_mobile":"010-8492****", //销售方电话
"merchant_bank":"工商银行海淀区北清路支行", //销售方银行
"merchant_account":"gongsibao", //销售方账户
"businessmen_credit_code":"91110105MA00723E4F", //购买方统一社会信用代码
"businessmen_name":"北京创知厚德科技有限公司", //购买方名称
"businessmen_addr":"北京市朝阳区创远路36号院10号楼1层102", //购买方地址
"businessmen_mobile":"1331112****", //购买方电话
"businessmen_bank":"工商银行朝阳支行", //购买方银行
"businessmen_account":"chuangzhihoude", //购买方账户
"summary":[ //摘要
{
"summaryType":"企业管理服务",
"summaryInfo":"市场推广",
"category":"xxxxx",
"unit":"元(人民币)",
"number":"1000",
"unitPrice":"100",
"amount":"100000",
"taxRate":"3%",
"taxAmount":"3000"
}
]
}
```
#### 返回结果
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
#### 示例
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="deliveryCustomer"> 客户交付 </a>**     
[返回到目录](#menu)     
##### URL
[/web/invoice/invoiceCtl/handleStatus]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求参数
#### 示例
#### 示例
```javascript
{
"invoice_id": "11855693476003245",
"status": "2030",
"deliver_mail_no":"sf78946234" //快递单号
}
```
#### 返回结果
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
#### 示例
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
\ No newline at end of file
<a name="menu">目录</a>
1. [全部订单](#aliOrderPageAll)
1. [我的业务订单](#aliOrderPage)
1. [完善订单](#aliPerfectInformation)
## **<a name="handlePage"> 订单办理 </a>**
[返回到目录](#menu)
##### URL
[/web/order/orderCtl/handlePage]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"merchant_id": 110361384474, // 商户id
"orderNo": "", // 订单号
"channelOrderNo": "", // 渠道订单号
"createdBegin": "", //
"createdEnd": "",
"status": ""
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"count": 18,
"rows": [
{
"id": "12115022197000259", // 订单办理id
"order_id": "13180527760002418", // 订单号
"status": "1030", // 业务状态
"statusName": "待处理", // 业务状态名称
"nextStatus": "1030", // 下一业务状态
"nextStatusName": "待处理", // 下一业务状态名称
"deliver_id": "13120681466000118", // 交付商id
"deliverName": "杨庆菊交付商222", // 交付商名称
"deliverDivide": 2220000, // 交付商分成金额
"breakReason": null,
"created_at": "2019-10-23 10:47:33",
"auditRemark": null, // 审核备注
"content": null, // 交付内容
"addressee": null, // 收件人
"mobile": null, // 联系电话
"addr": null, // 邮寄地址
"auditResult": "", // 审核状态
"order": {
"id": "13180527760002418",
"legalName": "杨庆菊",
"legalMobile": "杨庆菊手机号",
"price": 3000
}
},
]
},
"requestid": "8470ee30a2f14b01987828d2c614684c"
}
```
## **<a name="deliverInfo"> 查看详情 </a>**
[返回到目录](#menu)
##### URL
[/web/order/orderCtl/deliverInfo]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"id": "13180527789003380", // 订单号
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"id": "13180527789003380", // 订单号\订单号
"merchant_id": "11064622752480048", // 商户id
"channelOrderNo": "xxxxxxxxx111", // 渠道订单号
"price": 300000, // 订单价格(分)
"legalName": "杨庆菊", // 法人姓名
"legalMobile": "杨庆菊手机号", // 法人手机号
"legalImg": "法人照片", // 法人照片
"idcard": "123身份证", // 身份证号码
"idcardFront": "在正面", // 身份证正面图
"idcardBack": "反面", // 身份证反面图
"bankNo": "2222", // 银行卡号
"bank": "开户行", // 开户行
"bankImg": "这是银行卡照片", // 银行卡照片
"names": "名称1,名称2,名称3", // 2~3个注册名称,逗号分割
"domicile_id":"" // 注册地id
"domicileName":"" // 注册地名称
"businessScope_id": "12218127596000645", // 经营范围id
"businessType": "物流信息类", // 经营范围
"businessScope": "国内物流信息服务;装", // 经营范围详情
"capital": "到底是多少", // 注册资本
"statusName": "未付款", // 订单状态名称
"status": "1000", // 订单状态
"ostatusName": "待处理", // 业务进度状态名称
"ostatus": "1030", // 业务进度状态
"assignTime": null, // 分配时间
"assignUcname": "吴经理", // 分配人
"created_at": "2019-10-05 06:57:28", // 创建时间
"deliverType": "", // 交付类型 10交付商交付 20平台交付 30平台保存无需交付
"deliverTypeName": "", // 交付类型名称
"deliverNo": "", // 快递单号
"deliverImg": "", // 交接单
"deliver": { // 交付商
"statusName": "待处理" // 办理状态名称
"status": "1020", // 办理状态
"deliverName": "开封交付商", // 交付商名称
"deliverDivide": 3311, // 交付商分成比例
"auditRemark": null, // 审核备注
"content": null, // 交付内容
"addressee": null, // 收件人
"mobile": null, // 联系电话
"addr": null, // 邮寄地址
"auditResult": "", // 审核状态
},
"businessmen": {
"orderNo": "" // 订单号
"channelOrderNo": "" // 渠道订单号
"bstatus": "2020", // 业务状态
"bstatusName": "已完成", // 业务状态名称
"gstatus": "2020", // 客户看到的业务状态
"gstatusName": "已完成", // 客户看到的业务状态名号曾
"dstatus": "2020", // 交付商看到的状态
"dstatusName": "已完成" // 交付商看到的状态名称
"legalName": "" // 法人姓名
"legalMobile": "" // 法人电话
"name": "" // 个体工商户名称
"creditCode": "" // 统一社会信用代码
"businessPlace": "" // 经营场所
"businessScope": "" // 经营范围
"regDate": "" // 注册日期
"businessImg": "" // 执照照片
"gongzhang": "" // 公章
"caiwuzhang": "" // 财务章
"fapiaozhang": "" // 发票章
"hetongzhang": "" // 合同章
"farenzhang": "" // 法人章
"isBank": "" // 是否开户
"bankName": "" // 账户名称
"bankNo": "" // 账户号
"bank": "" // 开户行
"bankImg": "" // 账户信息
"caImg": "" // CA照片
"taxRegDay": "" // 税务登记日
"taxOrg": "" // 税务机构名称
"courierNo": "" // 快递单号
"courierImg": "" // 快递交接单图片
"addedValueRate": "" // 增值税率
"supertaxRate": "" // 附加税率
"commonTaxLadder": "" // 普票个税阶梯
"commonOtherLadder": "" // 普票增值税、附加税阶梯
"specialTaxLadder": "" // 专票个税阶梯
"specialOtherLadder": "" // 专票增值税、附加税阶梯
"contract": "" // 个体户合同
"contractStartData": "" // 合同开始时间
"contractEndData": "" // 合同结束时间
"notes": "" // 备注
"opNotes": "" // 操作备注
"created_at": "", // 创建时间
"taxUpType": "1", // 个税累计类型 1按月累计 2按年累计
"addValueUpType": "1", // 增值税累计类型 1按月 2按季度
"costRate": 11.22, // 核定成本费用率
"taxRate": 3.20, // 含税价百分比
"serviceRate": 1.25, // 服务费比例
"signNotes": null, // 签约备注
"signTime": null, // 签约时间
}
},
}
```
## **<a name="deliverEdit"> 编辑 </a>**
[返回到目录](#menu)
##### URL
[/web/order/orderCtl/deliverEdit]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
// 订单对象
"order": {
"id": "13180527789003380", // 订单id\订单号
"legalName": "杨庆菊", // 法人姓名
"idcard": "123身份证", // 身份证号码
"legalMobile": "杨庆菊手机号", // 法人手机号
"bankNo": "2222", // 银行卡号
"capital": "到底是多少", // 注册资本
"names": "山驴比1,山驴比2,山驴比3", // 2~3个个体工商户名称
"businessType": "太难了", // 经营范围
"businessScope": "太狠了", // 经营范围详情
"idcardFront": "在正面", // 身份证正面图
"idcardBack": "反面", // 身份证反面图
},
// 个体工商户信息
"businessmen": {
"id": "12795594625000138", // 个体户id
// 个体工商户执照信息
"name": "杨庆菊有限公司", // 个体户名称
"creditCode": "xxxxxx333333333", // 统一社会信用代码
"businessPlace": "来广营地铁站", // 经营场所
"legalName": "杨庆菊", // 法人姓名
"legalMobile": "杨庆菊手机号", // 法人手机号
"legalIdcard": "2222222222", // 法人身份证号
"regDate": "2019-01-22", // 注册日期
"businessScope": "1,2,3,4,5,", // 经营范围
"businessImg": "http:1.png", // 执照照片
// 个体工商户刻章信息
"gongzhang": "http://gongzhang.png", // 公章
"caiwuzhang": "http://caiwuzhang.png", // 财务章
"fapiaozhang": "http://fapiaozhang.png", // 发票章
"hetongzhang": "http://hetongzhang.png", // 合同章
"farenzhang": "http://farenzhang.png", // 法人章
// 个体户开户信息
"isBank": 1, // 是否开户 0否 1是
"bankName": "https://bankName", // 账户名称
"bankNo": "https://bankNo", // 帐号
"bank": "https://bank", // 开户行
"bankImg": "https://bankImg", // 账户图片
// 税务报道信息
"caImg": "12313212", // CA照片
"taxRegDay": "2019-01-01", // 税务登记日
"taxOrg": "12333", // 税务机构名称
// 邮寄信息
"courierNo": "111111111", // 快递单号
"courierImg": "快递交接图片", // 快递交接图片
}
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": null
}
```
## **<a name="deliverClose"> 订单关闭 </a>**
[返回到目录](#menu)
##### URL
[/web/order/orderCtl/deliverClose]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"id": "12115175152000322", // 订单办理id
"breakReason": "qiqibaba" // 关闭原因
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": null
}
```
## **<a name="deliverHandle"> 创建进度 </a>**
[返回到目录](#menu)
##### URL
[/web/order/orderCtl/deliverHandle]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
// ※※※ 当status == 1120 || status == 1140时,显示为提交审核按钮, 接口还用这个,只传id和status:1030
{
// 公共变量,所有情况都需要传
"id": "1", // 订单办理id
"status": "1010", // 订单状态
// 出执照
"name": "杨庆菊有限公司", // 个体工商户名称
"creditCode": "xxxxxx333333333", // 社会统一信用代码
"businessPlace": "来广营地铁站", // 经营场所
"businessScope": "1,2,3,4,5,", // 经营范围
"regDate": "2019-01-22", // 注册时间
"businessImg": "http:1.png" // 执照照片
"gongshangFile": "http://farenzhang.png" // 新增字段 ------- 办理执照官方文件
// 刻章办理
"gongzhang": "http://gongzhang.png", // 公章
"caiwuzhang": "http://caiwuzhang.png", // 财务章
"fapiaozhang": "http://fapiaozhang.png", // 发票章
"hetongzhang": "http://hetongzhang.png", // 合同章
"farenzhang": "http://farenzhang.png" // 法人章
"kezhangFile": "http://farenzhang.png" // 新增字段 ------- 刻章官方文件
// 银行开户
"isBank":"1", // 是否开户 0否 1是
"bankName":"https://bankName", // 账户名称
"bankNo":"https://bankNo", // 账户号
"bank":"https://bank", // 开户行
"bankImg":"https://bankImg", // 账户信息
"kaihuFile": "http://farenzhang.png" // 新增字段------- 银行开户官方文件
// 税务报到
"caImg": "12313212", // CA认证图
"taxRegDay": "2019-01-01", // 税务登记日
"taxOrg": "12333" // 税务机构名称
"shuiwuFile": "http://farenzhang.png" // 新增字段------- 税务报到官方文件
// 已邮寄
"courierNo": "111111111" // 快递单号
"courierImg": "快递交接图片" // courierImg
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": null
}
```
## **<a name="updateOBusinessmenProinvce"> 更新个体户 </a>**
[返回到目录](#menu)
##### URL
[/web/order/orderCtl/updateOBusinessmenProinvce]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"id": "1", // 个体户id 必填
"name": "1", // 个体户名字
"credit_code": "1", // 个体户社会信用代码
"legal_name": "1", // 法人名字
"reg_date": "1", // 注册时间
"business_place": "1", // 个体户经营地址
"business_scope": "1", // 个体户经营范围 Array 例如:[{...},{...}]
"business_img": "1", // 个体户营业执照
"business_gov_file": "1", // 个体户官方文件
"gongzhang": "1", // 个体户公章
"caiwuzhang": "1", // 个体户财务章
"fapiaozhang": "1", // 个体户发票章
"hetongzhang": "1", // 个体户合同章
"farenzhang": "1", // 个体户法人章
"zhang_gov_file": "1", // 个体户章官方文件
"is_bank": "1", // 是否开户 BOOLEAN true:已经开户 false:未开户
"bank_name": "1", // 账户名称
"bank_no": "1", // 银行账户
"bank": "1", // 银行名称
"bank_gov_file": "1", // 银行官方文件
"tax_reg_day": "1", // 税务报道时间
"tax_org": "1", // 税务登记机构
"tax_gov_file": "1", // 官方文件
"ca_img": "1", // 电子钥匙
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": null
}
```
\ No newline at end of file
<a name="menu">目录</a>
1. [登录](#login)
1. [财税登录](#ngaLogin)
1. [当前用户信息查询](#currentUser)
## **<a name="login"> 登录</a>**
......@@ -35,6 +36,33 @@
```
## **<a name="ngaLogin"> 财税登录</a>**
[返回到目录](#menu)
##### URL
[/web/uc/userCtl/ngaLogin]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
| 参数 | 必选 | 类型 | 说明|
| -------- | -------- | ------------|---------|
| **type** | 是 | String | 税务或者财务(tax, fin)|
```javascript
{
"type": "tax" // 登录类型 tax税务 fin财务
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": "https://nt.gongsibao.com/web/auth?..." // 登录地址,判断一下不为空的话,window.open这个
}
```
## **<a name="currentUser"> 当前用户信息查询</a>**
[返回到目录](#menu)
......
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