[关闭]
@Wahson 2020-03-16T00:37:15.000000Z 字数 10369 阅读 689

技术--工作周报(2020-03-15)

周报 Wanbo周报


上周回顾

下周计划

  • crm迁移 F_Crm_V1.0
    • 原子方法开发,模型见下文 曹佳林
    • 公司列表,新增公司、基础信息页面、用料管理、银行管理、地址管理页面开发 陈均活
    • 授信、三证模型确定 梁华生
  • 上周优化项测试上线 梁华生
  • 报价迁移测试 梁华生
  • 运营系统优化 F_Order_V1.11
    • 付款认领增加销售单号 陈均活
    • 发送司机信息,增加手动触发模式 陈均活
    • 批量查询物流指令 陈均活
    • 库存单资金占用统计,库存供应商额度占用统计 陈均活 梁华生

CRM 数据模型

  1. create table company
  2. (
  3. id bigint not null primary key,
  4. name varchar(100) not null comment '公司名称',
  5. address varchar(100) not null comment '联系地址',
  6. type smallint(2) default '1' not null comment '公司类型, 1: 采购商(purchaser); 2: 供应商(supplier)',
  7. -- 状态待定
  8. -- status smallint(2) default 10 not null comment '状态, 10:待审核(to_be_approve);20:审批通过(approved)',
  9. city_code char(6) not null comment '城市代码',
  10. city_name char(6) not null comment '城市名称',
  11. in_blacklist smallint(1) default '0' not null comment '是否在黑名单, 0: 否(no); 1: 是(yes)',
  12. is_deleted smallint(1) default '0' not null comment '是否已删除, 0: 否(no); 1: 是(yes)',
  13. property smallint(1) not null comment '企业性质(非工商标准),1:国有非上市企业(nonStateOwnedEnterprises);2:国有上市企业(stateOwnedEnterprises);3:民营非上市企业(privateNonListedCompany);4:民营上市企业(privateListedCompany);5:中外合资(非港澳台)企业(jointVentures);6:港澳台合资企业(hkMacaoAndTaiwanJointVenture)',
  14. business_property smallint(1) null comment '公司性质(工商标准), 1: 有限责任公司(limitedLiability); 2: 股份有限公司(colTd); 3: 个人独资企业(personalOwned); 4: 合伙企业(partnerShip)',
  15. registered_capital decimal(13, 2) default '0.00' not null comment '注册资金(单位万元)',
  16. paid_in_capital decimal(13, 2) default '0.00' not null comment '实收资本(单位万元)',
  17. employee_cnt int(3) default 0 not null comment '员工人数',
  18. main_business varchar(255) null comment '主营业务',
  19. found_date date not null comment '成立日期',
  20. business_term int(3) default 0 not null comment '营业期限,单位年',
  21. -- 审核通过的公司这两字段必须有值
  22. taxpayer_identity_no varchar(50) default null comment '纳税人识别号',
  23. business_license_attachment varchar(128) default null comment '营业执照附件',
  24. -- 领用人发生变化,都需要记录到公司领用记录表
  25. allocated_by bigint default null comment '领用人',
  26. allocated_at int default null comment '领用时间',
  27. created_at timestamp default current_timestamp() not null,
  28. created_by int default 0 not null,
  29. updated_at timestamp default current_timestamp() not null,
  30. updated_by int default 0 not null,
  31. remark varchar(64) null comment '备注',
  32. constraint name_UNIQUE
  33. unique (name)
  34. ) engine = innoDb charset = utf8mb4 comment '公司表';
  35. create table company_purchaser_property (
  36. company_id bigint not null comment '公司id' primary key,
  37. purchaser_type smallint default '1' not null comment '采购商类型,1:贸易商(trafficker); 2:次终端(second_terminal); 3:终端(terminal)',
  38. purchaser_maturity smallint(1) default '0' not null comment '采购商成熟度,0:线索客户(clue_customer);1:高意向客户(high_intention_customer);2:成交客户(deal_customer)',
  39. factory_type smallint(2) null comment '工厂类型, 1:改性厂(汽车、家电、功能改性)2:注塑厂(汽车/家电配件、工业零部件、物流周转用具、日用品、玩具)3:建材厂(管材、板材、型材、建筑装饰品及相关保护用品)4:日用五金家电厂
  40. 5:塑料纺织厂(编制袋、集装袋)6:化纤厂7:无纺布厂8:发泡厂9:中空制品厂10:普通吹膜厂11:CPP吹膜厂12:BOPP吹膜厂13:其他类型工厂',
  41. other_factory_type_remark varchar(255) default '' null comment '其他工厂类型备注',
  42. experience int(255) null comment '经营者经验,单位:年',
  43. -- sales_form smallint(2) null comment '产品销售形式,1:70%以上产成品出口外销(percent70); 2:50%-70%产成品出口外销(percent50Percent70); 3:30%-50%产成品出口外销(percent30Percent50)',
  44. factory_ownership smallint(1) null comment '厂房所有权,1:自购(buy);2:租用(rent)',
  45. device_ownership smallint(1) null comment '设备所有权,1:自购(buy);2:租用(rent)',
  46. real_estate_mortgage varchar(255) null comment '不动产抵押',
  47. payment_cycle int null comment '下游客户回款周期,单位:天',
  48. downstream_customer varchar(255) default null comment '主要下游客户',
  49. product_category varchar(255) default null comment '产品类别,如: 注塑制品,吹塑制品,',
  50. productions varchar(50) default null comment '生产产品, 如:购物袋',
  51. device_cnt int default '0' null comment '生产设备数量',
  52. device_total_value decimal(13,2) default null comment '生产设备价值,单位: 万元',
  53. device_work_rate decimal(13,2) default null comment '设备开工率',
  54. judicial_records varchar(255) default null comment '诉讼记录',
  55. competitor_name varchar(50) null comment '同行竞争对手名称',
  56. production_remark varchar(255) default null comment '生产信息备注',
  57. device_type varchar(255) default null comment '设备类型; 具体值 待定',
  58. factory_layout smallint(1) default null comment '工厂布局, 0: 集中(concentrate); 1: 分散(dispersion)',
  59. factory_district varchar(50) default null comment '工厂区域',
  60. factory_area varchar(255) default null comment '工厂面积',
  61. annual_trading_amount decimal(13,2) null comment '年交易额,单位:万元, 对应company表的 year_trade',
  62. annual_revenue decimal(13,2) default null comment '年营业收入',
  63. created_at timestamp default current_timestamp() not null,
  64. created_by int default 0 not null,
  65. updated_at timestamp default current_timestamp() not null,
  66. updated_by int default 0 not null,
  67. remark varchar(64) null comment '备注',
  68. constraint company foreign key (company_id) references company (id)
  69. ) engine = innoDb charset = utf8mb4 comment '采购商属性表';
  70. create table company_material_record
  71. (
  72. id bigint not null auto_increment primary key,
  73. company_id bigint not null comment '公司id',
  74. product_id int not null,
  75. category varchar(12) not null comment '产品分类',
  76. designation varchar(32) not null comment '产品牌号',
  77. manufacturer_id int not null comment '生产商ID',
  78. manufacturer_name varchar(32) not null comment '生产商名称',
  79. fare_increase decimal(13, 2) default '0.00' not null comment '加价幅度',
  80. is_master_material smallint(1) default '0' not null comment '是否主用料, 0: 否(no); 1: 是(yes)',
  81. is_deleted smallint(1) default '0' not null comment '是否已删除, 0: 否(no); 1: 是(yes)',
  82. research_monthly_quantity decimal(13, 2) default '0.00' not null comment '调查月用量',
  83. purchase_date varchar(64) default null comment '采购日期,1-31内,用,隔开',
  84. is_subscribe_offer tinyint(1) default '1' not null comment '是否订阅报价推送',
  85. created_at timestamp default current_timestamp() not null,
  86. created_by int default 0 not null,
  87. updated_at timestamp default current_timestamp() not null,
  88. updated_by int default 0 not null,
  89. remark varchar(255) null comment '备注',
  90. constraint mr_2_company foreign key (company_id) references company (id)
  91. ) engine = innoDb
  92. charset = utf8mb4 comment '公司用料记录';
  93. create table company_address
  94. (
  95. id bigint not null auto_increment primary key,
  96. company_id bigint not null comment '公司id',
  97. is_default smallint(1) default '0' not null comment '是否默认地址, 0: 否(no); 1: 是(yes)',
  98. is_deleted smallint(1) default '0' not null comment '是否已删除, 0: 否(no); 1: 是(yes)',
  99. name varchar(20) not null comment '联系人',
  100. phone varchar(20) not null comment '联系电话',
  101. province_code varchar(50) not null comment '省份',
  102. city_code char(6) not null comment '城市代码',
  103. area_code varchar(9) not null comment '地址编码',
  104. post_code varchar(10) null comment '邮编',
  105. address varchar(128) not null comment '收货地址',
  106. created_at timestamp default current_timestamp() not null,
  107. created_by int default 0 not null,
  108. updated_at timestamp default current_timestamp() not null,
  109. updated_by int default 0 not null,
  110. remark varchar(255) null comment '备注',
  111. constraint address_2_company foreign key (company_id) references company (id)
  112. ) engine = innoDb
  113. charset = utf8mb4 comment '公司收货地址';
  114. create table company_bank
  115. (
  116. id bigint not null auto_increment primary key,
  117. company_id bigint not null comment '公司id',
  118. is_deleted smallint(1) default '0' not null comment '是否已删除, 0: 否(no); 1: 是(yes)',
  119. bank_name varchar(64) not null comment '开户行',
  120. bank_account varchar(32) not null comment '银行账号',
  121. bank_account_name varchar(64) not null comment '银行户名',
  122. created_at timestamp default current_timestamp() not null,
  123. created_by int default 0 not null,
  124. updated_at timestamp default current_timestamp() not null,
  125. updated_by int default 0 not null,
  126. constraint bank_2_company foreign key (company_id) references company (id),
  127. remark varchar(255) null comment '备注'
  128. ) engine = innoDb
  129. charset = utf8mb4 comment '公司银行';
  130. create table company_allocate_record
  131. (
  132. id bigint not null auto_increment primary key ,
  133. company_id bigint not null comment '公司id',
  134. type smallint(2) not null default 1 comment '领用类型,1:领用(allocation);2:弃用(abandon)',
  135. allocated_by int default 0 not null comment '领用人, 弃用:当前领用人,领用:新领用人',
  136. created_at timestamp default current_timestamp() not null,
  137. created_by int default 0 not null,
  138. remark varchar(255) null comment '备注',
  139. constraint vr_2_company foreign key (company_id) references company (id)
  140. ) engine = innoDb
  141. charset = utf8mb4 comment '公司领用记录';
  142. -- 以上表 增、删、改原子方法
  143. -- 公司领用、弃用原子方法
  144. -- 公司id 通过取号服务获取
  145. -- listCompany 返回 TCompanyResp
  146. -- listMaterialRecordsByCompanyId
  147. -- listAddressByCompanyId
  148. -- listBankByCompanyId
  149. -- queryCompanyInvoice 返回 TCompanyResp
  150. -- queryCompanyCredit 返回 TCompanyResp
  151. -- queryCompanyPurchaserProperty 返回 TCompanyResp
  152. -- 统一返回体
  153. struct TCompanyResp {
  154. 1: TCompanyExt company,
  155. 2: list<TCompanyMaterialRecord> materialRecords
  156. 3: list<TCompanyAddress> addresses
  157. 4: list<TCompanyBank> banks,
  158. 5: optional TCompanyCredit credit,
  159. 6: optional TCompanyInvoice invoice,
  160. 7: optional TCompanyPurchaserProperty purchaserProperty
  161. }
  162. -- 以下待定
  163. create table company_credit
  164. (
  165. company_id bigint not null comment '公司id' primary key,
  166. status smallint(2) default 10 not null comment '状态, 10:待审核(to_be_approve);20:审批通过(approved)',
  167. created_at timestamp default current_timestamp() not null,
  168. created_by int default 0 not null,
  169. updated_at timestamp default current_timestamp() not null,
  170. updated_by int default 0 not null,
  171. remark varchar(255) null comment '备注',
  172. constraint credit_2_company foreign key (company_id) references company (id)
  173. ) engine = innoDb
  174. charset = utf8mb4 comment '公司授信';
  175. -- 待定, 报价数量基准 estimated_tonnage
  176. create table company_material_info
  177. (
  178. id bigint not null primary key,
  179. company_id bigint not null comment '公司id',
  180. created_at timestamp default current_timestamp() not null,
  181. created_by int default 0 not null,
  182. updated_at timestamp default current_timestamp() not null,
  183. updated_by int default 0 not null,
  184. remark varchar(255) null comment '备注',
  185. constraint mi_2_company foreign key (company_id) references company (id)
  186. ) engine = innoDb
  187. charset = utf8mb4 comment '公司用料信息';
  188. create table customer
  189. (
  190. id bigint not null primary key,
  191. company_id bigint not null comment '公司id',
  192. is_deleted smallint(1) default '0' not null comment '是否已删除, 0: 否(no); 1: 是(yes)',
  193. wx_user_id bigint default null comment '微信用户id, wechat_db.wx_user.id',
  194. created_at timestamp default current_timestamp() not null,
  195. created_by int default 0 not null,
  196. updated_at timestamp default current_timestamp() not null,
  197. updated_by int default 0 not null,
  198. remark varchar(255) null comment '备注',
  199. constraint customer_2_company foreign key (company_id) references company (id)
  200. ) engine = innoDb
  201. charset = utf8mb4 comment '客户表';
  202. create table company_visit_record
  203. (
  204. id bigint not null auto_increment primary key,
  205. company_id bigint not null comment '公司id',
  206. created_at timestamp default current_timestamp() not null,
  207. created_by int default 0 not null,
  208. updated_at timestamp default current_timestamp() not null,
  209. updated_by int default 0 not null,
  210. remark varchar(255) null comment '备注',
  211. constraint vr_2_company foreign key (company_id) references company (id)
  212. ) engine = innoDb
  213. charset = utf8mb4 comment '公司回访记录';
  214. -- 三证是否需要支持
  215. create table company_invoice
  216. (
  217. company_id bigint not null comment '公司id' primary key,
  218. status smallint(2) default 10 not null comment '状态, 10:待审核(to_be_approve);20:审批通过(approved);20:审批不通过(approved_fail)',
  219. --
  220. address varchar(200) not null comment '开票公司地址',
  221. phone varchar(50) null comment '联系电话',
  222. attachment_file_name int null comment '开票资料附件',
  223. bank_name varchar(100) null comment '开户行名称',
  224. bank_account varchar(30) null comment '银行卡号',
  225. audited_by int default null comment '审核人',
  226. audited_at timestamp default null comment '审核时间',
  227. created_at timestamp default current_timestamp() not null,
  228. created_by int default 0 not null,
  229. updated_at timestamp default current_timestamp() not null,
  230. updated_by int default 0 not null,
  231. remark varchar(255) null comment '备注',
  232. constraint invoice_2_company foreign key (company_id) references company (id)
  233. ) engine = innoDb
  234. charset = utf8mb4 comment '公司开票信息';
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注