Commit 2089a4e7 by Sxy

fix: 代码规范

parent f6936e38
...@@ -128,8 +128,8 @@ class UserDao extends Dao { ...@@ -128,8 +128,8 @@ class UserDao extends Dao {
} }
// 修改用户(user表)公司的唯一码 // 修改用户(user表)公司的唯一码
async putUserCompanyOnlyCode(userId, company_only_code, result) { async putUserCompanyOnlyCode(userId, companyOnlyCode, result) {
const customerObj = { companyOnlyCode: company_only_code }; const customerObj = { companyOnlyCode };
const putSqlWhere = { where: { id: userId } }; const putSqlWhere = { where: { id: userId } };
this.updateByWhere(customerObj, putSqlWhere); this.updateByWhere(customerObj, putSqlWhere);
return result; return result;
......
## 一 、交付单相关接口
## 一 、交付单相关接口
#### 1. 交付单处理列表、交付单记录列表
##### URL: /web/bizchance/deliverybillCtl/findAndCountAll
##### REQUEST
```js
{
"search": {
"companyName":'', // 企业名称
"deliveryNumber" :'', // 交付单编号
"contactsName" :'', // 联系人
"contactsPhone" :'', // 联系电话
"deliveryStatus":'' , //交付单状态 received | waituserconfirm | inservice | closed | success
"setupStatus":'' , //建账状态 notsetup | setup
"owner":''//所属人
},
"pageInfo": {
"pageSize": 10,// 每页条数
"pageNo": 1// 第几页
}
}
```
##### RESPONSE
```json
{
"status": 0, //0为请求成功
"msg": "SUCCESS",
"data": {
"results": {
"count": 28,//总条数
"rows": [
{
deliveryId: "1",// id
deliveryNumber: "011110001",// 交付单编号
companyName: "汉唐",// 企业名称
taxpayerType: 1,//纳税人类型 1 一般;2 小规模
areaType: "city",//区域类型 city-城市
area: "30000",// 服务 地区 编码
companyBizType: 1,// 公司类型 1-商贸型;2-服务型;3-特殊行业;4-其他
contactsName: "zhangsan", // 联系人
contactsPhone: "1111111111",// 联系电话
owner: "李四",//所属人
deliveryStatus: "received",// 交付单状态: received 待处理 | waituserconfirm 待用户确认 | inservice 服务中 | closed 已关闭 | success 已完成
setupStatus: "notsetup",//建账状态: notsetup 未建账 | setup 已建账
createdAt: "2020-06-01",// 创建时间
updatedAt: "2020-06-01",//更新时间,
setupAt:"建账时间" //建账时间
}
]
}
},
"bizmsg": "empty",
"requestId": "8800bea986ff4b2ca77824275a4684a8"
}
```
#### 2. 处理
##### URL: /web/bizchance/deliverybillCtl/updateOrderStatus
##### REQUEST
| 参数名 | 必须 | 说明 |
| ---------- | ---- | ------------------------------------ |
| deliverId | Y | 交付单id |
| orderStaus | Y | 是否成单 ( Boolen true \| false) |
| setupAt | N | 建账时间 orderStaus 为 true 时必传 |
| note | N | 备注 orderStaus 为 false 时必传 |
##### RESPONSE
```json
{
"status": 0, // 0为请求成功
"msg": "SUCCESS",
"data":"SUCCESS",
"bizmsg": "empty",
"requestId": "8800bea986ff4b2ca77824275a4684a8"
}
```
#### 3. 建账
##### URL: /web/bizchance/deliverybillCtl/setupBill
##### REQUEST
| 参数名 | 必须 | 说明 |
| -------------- | ---- | --------------------- |
| deliverId | Y | 交付单id |
| contactsName | Y | 客户名称 |
| time | Y | 日期 |
| accountingType | Y | 会计制度 |
| taxpayerType | Y | 纳税人性质 |
| supplier | Y | 供应商 (传供应商id) |
##### RESPONSE
```json
{
"status": 0, // 0为请求成功
"msg": "SUCCESS",
"data":"SUCCESS",
"bizmsg": "empty",
"requestId": "8800bea986ff4b2ca77824275a4684a8"
}
```
#### 4. 详情
##### URL: /web/bizchance/deliverybillCtl/deliverInfo
##### REQUEST
| 参数名 | 必须 | 说明 |
| --------- | ---- | -------- |
| deliverId | Y | 交付单id |
##### RESPONSE
```json
{
"status": 0, // 0为请求成功
"msg": "SUCCESS",
"data":{
"deliverData":{
deliveryId: "1",// id
deliveryNumber: "011110001",// 交付单编号
companyName: "汉唐",// 企业名称
uscc:"22232434",//统一信用代码
taxpayerType: 1,//纳税人类型 1 一般;2 小规模
areaType: "city",//区域类型 city-城市
area: "30000", // 服务 地区 编码
companyBizType: 1,// 公司类型 1-商贸型;2-服务型;3-特殊行业;4-其他
accountingType:"会计准侧"//会计准侧
contactsName: "zhangsan",// 联系人
contactsPhone: "1111111111",// 联系电话
owner: "李四",//所属人
deliveryStatus: "received", // 交付单状态: received 待处理 | waituserconfirm 待用户确认 | inservice 服务中 | closed 已关闭 | success 已完成
setupStatus: "notsetup",//建账状态: notsetup 未建账 | setup 已建账
createdAt: "2020-06-01",// 创建时间
updatedAt: "2020-06-01", //更新时间
},
"schemeData":{
demandCode: "34343434",// 需求编号
schemeCode: "00000000", //方案编号
companyType: 1, //公司类型
area: "343435",//服务地区
buyDuration: 1, //购买时长
buyNumber: 3, //购买数量
totalCost: 3000000,//总计费用
note: "xxxxxx"//备注
}
},
"bizmsg": "empty",
"requestId": "8800bea986ff4b2ca77824275a4684a8"
}
```
#### 5. 供应商接口
##### URL: /web/bizchance/deliverybillCtl/getChannelCompany
##### REQUEST
| 参数名 | 必须 | 说明 |
| ------ | ---- | ---- |
| | | |
##### RESPONSE
```json
{
"status": 0,
"msg": "操作成功",
"data": [
{
"id": 148,
"name": "腾讯租户1"
}
],
"bizmsg": "empty",
"requestId": "63e39e34385a4b769653e59076d2d97b"
}
```
## 一 、分配相关接口
## 一 、分配相关接口
#### 1. 获取组织结构树
> 注: 请求地址 为 中台地址
##### URL: /web/common/companyCtl/getOrgs
##### REQUEST
| 参数名 | 必须 | 说明 |
| ------ | ---- | ---- |
| | | |
##### RESPONSE
```json
{
"status": 0,
"msg": "操作成功",
"data": {
"orgJson": [
{
"title": "公司宝",
"code": "root10",
"expand": true,
"orgpath": "root10",
"children": [
{
"title": "销售一组",
"code": "ic",
"expand": true,
"orgpath": "root10/ic",
"children": [
{
"title": "销售一一",
"code": "2",
"expand": true,
"orgpath": "root10/ic/2",
"children": [],
"nodeKey": 2,
"isPosition": true, // 是否是岗位
"seq": 0,
"titlepath": "公司宝/销售一组/销售一一",
"level": 3,
"roles": [
4,
5
],
"isMain": true,
"orgtag": "ic"
}
],
"nodeKey": 1,
"isPosition": true,
"seq": 0,
"titlepath": "公司宝/销售一组",
"level": 2,
"roles": [
4,
5
]
},
{
"title": "交付组",
"code": "dlivergroup",
"expand": true,
"orgpath": "root10/dlivergroup",
"children": [
{
"isPosition": true,
"isMain": false, // 是否是负责人
"orgtag": "",
"roles": [
5
],
"seq": 0,
"code": "dgroupmembers",
"title": "交付员",
"nodeKey": 4,
"orgpath": "root10/dlivergroup/dgroupmembers",
"titlepath": "公司宝/交付组/交付员",
"level": 3,
"expand": true
}
],
"nodeKey": 3,
"isPosition": false,
"seq": 0,
"titlepath": "公司宝/交付组",
"level": 2
},
{
"isPosition": false,
"isMain": false,
"orgtag": "",
"roles": [],
"seq": 0,
"code": "bizgroup01",
"title": "业务组",
"nodeKey": 5,
"orgpath": "root10/bizgroup01",
"titlepath": "公司宝/业务组",
"level": 2,
"expand": true,
"children": [
{
"isPosition": true,
"isMain": false,
"orgtag": "",
"roles": [
19
],
"seq": 0,
"code": "g1members",
"title": "业务员",
"nodeKey": 6,
"orgpath": "root10/bizgroup01/g1members",
"titlepath": "公司宝/业务组/业务员",
"level": 3,
"expand": true,
"children": []
}
]
}
],
"nodeKey": 0,
"titlepath": "公司宝",
"level": 1
}
]
},
"bizmsg": "empty",
"requestId": "38c2877f63ac49bf8c04dfed24b623a2"
}
```
#### 2. 查询组织结构下的人员
> 注: 请求地址 为 中台地址
##### URL: /web/auth/userCtl/findAndCountAll
##### REQUEST
```js
{
"search": {
"opath": "code码" // 传组织结构下的code码
},
"pageInfo": {
"pageSize": 10,
"pageNo": 1 // ( -1 的话 查询全部不分页 )
}
}
```
##### RESPONSE
```json
{
"status": 0,
"msg": "操作成功",
"data": {
"results": {
"count": 2,
"rows": [
{
"mobile": "111",
"id": 75,
"userName": "test",
"nickName": "test_sxy",
"sex": null,
"mail": "111@qq.com",
"headUrl": "",
"center_id": "5b2ace4a-c32a-438b-bd1e-d32083322a3f",
"isEnabled": true,
"opath": "root10/ic/2/test",
"ptags": "ic",
"skilltags": "公司注册,云上园区注册",
"regiontags": "",
"openid": null,
"unid": null,
"isDelivery": true,
"isSalesman": true,
"isAllArea": true,
"created_at": "2020-08-18T02:22:05.000Z",
"updated_at": "2020-08-18T02:22:05.000Z",
"deleted_at": null,
"version": 1,
"app_id": 1,
"company_id": 10
}
]
}
},
"bizmsg": "empty",
"requestId": "cac2a1a4037b4308ab8787bedf01f405"
}
```
#### 3. 分配
##### URL: /web/bizchance/deliverybillCtl/distributionPerson
> 注: 请求地址 为 子系统地址
##### REQUEST
| 参数名 | 必须 | 说明 |
| -------- | ---- | ------------------------------------------------------- |
| numbers | Y | 数组 交付单编号 或者 需求单编号 |
| userId | Y | 所分配人的id |
| opCode | Y | 所分配人的opath |
| nickName | N | 所分配人的 昵称 |
| type | Y | BIZ (分配需求时 ) \| DELIVERY (分配交付单时) |
| phone | N | 手机号 |
##### RESPONSE
```json
{
"status": 0, // 0为请求成功
"msg": "SUCCESS",
"data":"SUCCESS",
"bizmsg": "empty",
"requestId": "8800bea986ff4b2ca77824275a4684a8"
}
```
## 一 、产品价格及地区接口
## 一 、产品价格及地区接口
#### 1、价格及地区
##### URL: /api/common/product/findProductInfoForFt
> 注: 请求地址为中台地址
##### REQUEST
| 参数名 | 必须 | 说明 |
| ----------- | ---- | ----------------------------------------- |
| productname | N | 产品类型 : 一般纳税人 \| 小规模纳税人 |
| region | N | 地区 : 北京市 \| 天津市 |
##### RESPONSE
```json
// productname 返回参数
{
"status": 0,
"msg": "操作成功",
"data": [
{
"area": "苏州市", // 地区
"areaCode": "320500", // 地区 code码
"type": "一般纳税人",
"price": "2200.00" //价格
},
{
"area": "杭州市",
"areaCode": "330100",
"type": "一般纳税人",
"price": "2500.00"
}
],
"bizmsg": "empty",
"requestId": "0dc238a1ce594c3f80e709a9d1efe832"
}
// productname、region 传值时
{
"status": 0,
"msg": "操作成功",
"data": {
"area": "苏州市",
"areaCode": "320500",
"type": "一般纳税人",
"price": "2200.00"
},
"bizmsg": "empty",
"requestId": "8a2ef34a6843446f89a3dafb968eb48c"
}
// 什么都不传时
{
"status": 0,
"msg": "操作成功",
"data": {
"一般纳税人": [
{
"area": "苏州市",
"areaCode": "320500",
"type": "一般纳税人",
"price": "2200.00"
},
{
"area": "杭州市",
"areaCode": "330100",
"type": "一般纳税人",
"price": "2500.00"
}
],
"小规模纳税人": [
{
"area": "保定市",
"areaCode": "130600",
"type": "小规模纳税人",
"price": "1500.00"
}
]
},
"bizmsg": "empty",
"requestId": "4899cbae53854a43b06151c0c605d4c3"
}
```
### 财税上线 sql
### 财税上线 sql
##### 操作库: ent_deliver
```sql
CREATE TABLE `fi_settlebill` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(255) NOT NULL DEFAULT '' COMMENT '结算单编码',
`created_at` datetime NOT NULL COMMENT '创建时间',
`updated_at` datetime NOT NULL COMMENT '更新时间',
`version` int(11) NOT NULL DEFAULT '0',
`settle_amount` double DEFAULT '0' COMMENT '结算金额',
`auditedStatus` tinyint(1) DEFAULT '0' COMMENT '结算状态',
`isPayedStatus` tinyint(1) DEFAULT '0' COMMENT '支付状态',
`creator_id` int(11) DEFAULT NULL COMMENT '创建人id',
`creator` varchar(255) DEFAULT NULL COMMENT '创建人',
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
`memo` varchar(512) DEFAULT NULL COMMENT '备注',
`auditor_id` int(11) DEFAULT NULL COMMENT '审核人id',
`auditor` varchar(255) DEFAULT NULL COMMENT '审核人',
`payer_id` int(11) DEFAULT NULL COMMENT '付款人id',
`payer` varchar(255) DEFAULT NULL COMMENT '付款人',
`facilitator_id` int(11) DEFAULT NULL COMMENT '服务商id',
`facilitator_name` varchar(255) DEFAULT NULL COMMENT '服务商',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COMMENT='公司主体表';
CREATE TABLE `fi_tax_company` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '财税-企业信息表',
`demand_code` varchar(255) DEFAULT NULL COMMENT '需求编号',
`company_name` varchar(255) DEFAULT NULL COMMENT '企业名称',
`legal_person` varchar(255) DEFAULT NULL COMMENT '法人姓名',
`tax_number` varchar(255) DEFAULT NULL COMMENT '税号',
`taxpayer_type` varchar(255) DEFAULT NULL COMMENT '纳税人类型',
`engaged_industry` varchar(255) DEFAULT NULL COMMENT '所属行业',
`region` varchar(255) DEFAULT NULL COMMENT '地区',
`address` varchar(255) DEFAULT NULL COMMENT '企业地址',
`created_at` datetime NOT NULL COMMENT '创建时间',
`updated_at` datetime NOT NULL COMMENT '更新时间,也是当前商机状态的时间',
PRIMARY KEY (`id`),
UNIQUE KEY `demand_code_UNIQUE` (`demand_code`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4;
CREATE TABLE `fi_tax_operation_record` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '财税-操作记录表',
`demand_code` varchar(255) DEFAULT NULL COMMENT '需求编号',
`operator` json DEFAULT NULL COMMENT '操作人',
`operation_type` varchar(255) DEFAULT NULL COMMENT '操作类型',
`operation_details` json DEFAULT NULL COMMENT '操作详细记录',
`order_type` varchar(255) DEFAULT NULL COMMENT '区分操作需求还是交付单',
`created_at` datetime NOT NULL COMMENT '创建时间',
`updated_at` datetime NOT NULL COMMENT '更新时间,也是当前商机状态的时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8mb4;
CREATE TABLE `fi_tax_push_queue` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`delivery_code` varchar(255) DEFAULT NULL COMMENT '交付单id(服务实例的id)',
`current_period` varchar(255) DEFAULT NULL COMMENT '当前账期',
`data_type` varchar(255) DEFAULT NULL COMMENT '数据类型:1:账套信息 2:报表信息 3:报税信息 4:邮寄信息',
`req_data` json DEFAULT NULL COMMENT '推送请求数据',
`res_data` json DEFAULT NULL COMMENT '推送返回数据',
`push_status` varchar(255) DEFAULT NULL COMMENT '推送状态',
`rys_check` varchar(255) DEFAULT NULL COMMENT '融易算是否确认,1:确认 0 未确认',
`check_date` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '融易算确认的时间',
`created_at` datetime NOT NULL COMMENT '创建时间',
`updated_at` datetime NOT NULL COMMENT '更新时间',
`version` int(11) NOT NULL COMMENT '版本号',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8mb4 COMMENT='财税项目推送日志记录表';
CREATE TABLE `fi_tax_scheme` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '财税-方案表',
`demand_code` varchar(255) DEFAULT NULL COMMENT '需求编号',
`solution_bizid` varchar(255) DEFAULT NULL COMMENT '方案编号',
`service_type` varchar(255) DEFAULT NULL COMMENT '服务类型',
`company_type` varchar(255) DEFAULT NULL COMMENT '公司类型',
`taxpayer_type` varchar(255) DEFAULT NULL COMMENT '纳税人类型',
`service_name` varchar(255) DEFAULT NULL COMMENT '服务地区',
`service_code` varchar(255) DEFAULT NULL COMMENT '服务地区编码',
`buy_duration` varchar(255) DEFAULT NULL COMMENT '购买时长',
`number` varchar(255) DEFAULT NULL COMMENT '数量',
`total_cost` varchar(255) DEFAULT NULL COMMENT '总计费用',
`remarks` varchar(255) DEFAULT NULL COMMENT '备注',
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`version` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `demand_code_UNIQUE` (`demand_code`) USING BTREE,
KEY `solution_bizid_UNIQUE` (`solution_bizid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=72 DEFAULT CHARSET=utf8mb4;
CREATE TABLE `salesman_his` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务员历史表',
`flow_type` varchar(255) NOT NULL COMMENT '流程类型(商机、方案、交付单)',
`flow_id` varchar(255) NOT NULL COMMENT '流程对应id(各种表里对应的id)',
`flow_code` varchar(255) NOT NULL COMMENT '类型的编号',
`salesman_info` json NOT NULL COMMENT '业务员信息',
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`version` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8mb4 COMMENT='业务员历史表';
ALTER TABLE `delivery_bill` add `biz_id` varchar(255) DEFAULT NULL COMMENT '融易算-服务实例id';
ALTER TABLE `bussiness_opportunity` add `biz_id` varchar(255) DEFAULT NULL COMMENT '融易算-服务实例id';
ALTER TABLE `delivery_bill` ADD COLUMN company_name VARCHAR (255) GENERATED ALWAYS AS (`delivery_info` ->> '$.companyName' ) VIRTUAL;
CREATE INDEX company_name_virtual_index ON delivery_bill(company_name);
ALTER TABLE `delivery_bill` ADD COLUMN `v_setup_status` varchar(255) GENERATED ALWAYS AS (`delivery_info` ->> '$.setupStatus') VIRTUAL;
CREATE INDEX v_setup_status_virtual_index ON delivery_bill(v_setup_status);
ALTER TABLE `delivery_bill` ADD COLUMN `v_creditCode` varchar(255) GENERATED ALWAYS AS (`delivery_info` ->> '$.creditCode') VIRTUAL;
CREATE INDEX v_creditCode_virtual_index ON delivery_bill(v_creditCode);
ALTER TABLE `delivery_bill` ADD COLUMN `v_ftClientId` varchar(255) GENERATED ALWAYS AS (`delivery_info` ->> '$.ftClientId') VIRTUAL;
CREATE INDEX v_ftClientId_virtual_index ON delivery_bill(v_ftClientId);
```
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