-
Notifications
You must be signed in to change notification settings - Fork 0
/
API文档.txt
536 lines (409 loc) · 20 KB
/
API文档.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
todo:
及时清理缓存,删除不必要的数据。
将上传图片的接口提取成模块。
订单、工单详情页面对于图片数据的处理,健壮性需加强。
role_type
000朋友
01 管理员 anzai736311
02 销售(录单员)
101-199 工人
100 客户
300 伙伴
301市场(推广人员)
图片上传,
接口地址:https://www.xiangxun1.com/ssm/file/uploadImage
目标地址:https://www.xiangxun1.com/image/
@param httpServletRequest
@param files
@return String(success error)
网上资料:
同一个微信开放平台下的相同主体的App、公众号、小程序的unionid是相同的,这样就可以锁定是不是同一个用户。微信针对不同的用户在不同的应用下都有唯一的一个openId, 但是要想确定用户是不是同一个用户,就需要靠unionid来区分。一般自己的后台都会有自己的一个用户表,每个用户有不同的userid。也就是说同一个用户在同一个微信开放平台下的相同主体的应用对应着相同的unionid以及不同的openid。所以在用户登录进来的时候,我们只能靠微信返回给我们的unionid去判断是不是同一个用户,在去关联我们的用户表,拿到对应的user_id。
获取用户user_id的方案:
首先,小程序onLaunch时,通过向如下的URL发起request请求(其中js_code填写的是用户wx.login成功时返回的res.code),可以获取用户的session_key和openid:
https://api.weixin.qq.com/sns/jscode2session?appid=wxc70057280c56f254&secret=4b1176fdf52fa6bb86f0969bc2569dbb&js_code=0117drQC06yHLd2N63QC03HrQC07drQB&grant_type=authorization_code
实测返回值:
{"session_key":"pqyFcISGoCoI6+bBxjaviA==","openid":"oA8Tb4r0UGK1emcdiF1S5WxyVKuo"}
网上资料:
通过解密算法,可以获取unionid。它可以作为区分用户身份的主键user_id使用。
与服务器request交互API汇总:
/pages/index/index.js-----------------------
#触发时间:getUserInfo获取用户信息之后
#上传数据:{user_id: char[]}
#获取数据:{rolepla_ptytype: char} //角色(身份)类型
/pages/input/input.js-----------------------
#触发时间:onConfirm点击“提交”按钮之后,调用doInput提交订单时
#上传数据:{
receipt_type: char[], //单据类型
user_id: char[], //录单员的user_id
remark: char[], //备注
name: char[], //订单名称
contact_name: char[], //客户名称(现在还没有找到直接选择微信联系人的方法)
contact_number: char[], //客户电话
}
除了request之外,这里可能还会用到wx.uploadFile(OBJECT)来上传图片附件。
#获取数据:{result: bool} //数据库business_biu表增加记录是否成功。
/pages/inquiry/inquiry.js-----------------------
#触发时间:调用setRecptData获取订单数组数据时
#上传数据:{
string: "getRecptData",
user_id: char[] //发起查询的用户的user_id
}
#获取数据:{ //根据用户ID,返回用户希望查询的订单的数组
receipts: [
{
receipt_number: char[] //单据编号,如00001、00002
name: char[] //单据名称
receipt_type: char[] //单据类型
state: char[] //状态。如果待分配,就是"待分配";如果未完工,就是目前正在进行的工序的名称,如"裁料"、"做衣";如果已完工,就是"已完成"。
},
... //同上的数组元素
}
除了request之外,还会用到wx.downloadFile(OBJECT)来下载图片附件。
/pages/progress/progress.js-----------------------
#触发时间:页面显示onShow时
#上传数据:{
string: "getProcessData"
receipt_number: char[] //单据编号
}
#获取数据:{ //根据单据编号找到对应的工单表,返回如下数组对象
job_table:[
{
job_type: char[], //工单类型
job_number: char[], // 工单编号
name: char[], //工序名,如'做衣',
status: char[], //'已处理'或'未处理'或'待分配',
user_name: char[], //操作者(员工)的nickname
time: char[], //'2018/07/20 13:07:08',
note: char[], //工单备注
},
... //同上的数组元素
]
}
/pages/operate/operate.js-------------------------
#触发时间:页面加载onLoad时
#上传数据:{
string: "getOperateData"
user_id: char[] //用户(员工)的ID
}
#获取数据:{
job_table:[ //根据员工的user_id返回的工单表,也就是调配给该员工的任务清单
{
job_type: char[], //工单类型
job_number: char[], //工单编号
name: char[], //工序名,如'做衣',
},
... //同上的数组元素
]
}
#触发时间:点击“领取”按钮时
#上传数据:{ //根据以下数据,修改job_table表
string: "onTapButtonGet"
user_id: char[] //用户(员工)的ID
job_number: char[] //工单编号
user_name: char[], //操作者(员工)的nickname
time: char[], //提交时间,如'2018/07/20 13:07:08',
}
#触发时间:点击“完工”按钮时
#上传数据:{ //根据以下数据,修改job_table表
string: "onTapButtonDone"
user_id: char[] //用户(员工)的ID
job_number: char[] //工单编号
user_name: char[], //操作者(员工)的nickname
time: char[], //提交时间,如'2018/07/20 13:07:08',
note: char[] //备注,可能为空字符串
}
用户注册登记接口------------------------------------
http://140.143.154.96/day07/regServlet
上传变量:user_id,user_name,password,role_type,level_type,nickname,
数据库记录 wushuangBaOY_WHA密码888888
订单录入接口----------------------------------------
http://140.143.154.96/day07/BillCreateServlet
上传数据:user_id(操作员的微信号),user_name(操作的微信呢称),role_type(操作员角色类型,登录或授权时从服务端获取),company_id(公司ID,直接赋值"12345"就行),
receipt_type(订单类型),订单名称receipt_name, remark(订单备注),cif_user_id(订单中客户微信号),cif_user_name(订单中客户微信呢称)
String User_id = request.getParameter("user_id"); //录单操作ID
String User_name = request.getParameter("user_name");
String Role_type = request.getParameter("role_type");
String Company_id = request.getParameter("company_id");
String Receipt_type=request.getParameter("receipt_type");
String Receipt_name=request.getParameter("receipt_name");String Remark=request.getParameter("remark");
String Cif_user_id = request.getParameter("cif_user_id"); //订单客户id
String Cif_user_name = request.getParameter("cif_user_name");
订单查询接口----------------------------------------
http://140.143.154.96/day07/BillQueryServlet
工单领取或完工接口----------------------------------
http://140.143.154.96/day07/JobDealServlet
工单领取完工输入:user_id(操作员的微信号),user_name(操作的微信呢称),role_type(操作员角色类型,登录或授权时从服务端获取),(公司ID,直接赋值"12345"就行),这几个信息是公用信息,后面的服务处理,都会传几个信息
还需要:job_number(工单编号),job_event(事件:01表示领域,02表示完工)
工单查询接口----------------------------------------
http://140.143.154.96/day07/JobQueryServlet
输入信息,就是通用信息user_id(操作员的微信号),user_name(操作的微信呢称),role_type(操作员角色类型,登录或授权时从服务端获取),company_id(公司ID,直接赋值"12345"就行),work_status(所查询工单的状态代码)
订单进度查询----------------------------------------
http://140.143.154.96/day07/BillProQueryServlet
输入信息,就是通用信息user_id(操作员的微信号),user_name(操作的微信呢称),role_type(操作员角色类型,登录或授权时从服务端获取),company_id(公司ID,直接赋值"12345"就行)
再输入receipt_type(订单类型),receipt_number(订单编号)
企业注册信息----------------------------------------
http://140.143.154.96/day07/CompanyRegisterServlet
company_name(公司名称),company_type(行业),user_id(用户ID),user_name(用户名称),nickname(用户呢称)
用户列表查询----------------------------------------
http://140.143.154.96/day07/userQueryServlet
通用信息user_id(操作员的微信号),user_name(操作的微信呢称),role_type(操作员角色类型,登录或授权时从服务端获取),company_id
user_type(用户类型),1、客户,2、员工、3、伙伴、0、其他
String User_id = request.getParameter("user_id"); //录单操作ID
String User_name = request.getParameter("user_name");
String Role_type = request.getParameter("role_type");
String Company_id = request.getParameter("company_id");
String Cor_event = request.getParameter("cor_event");
1增加 2删除
String Their_scene_code=request.getParameter("their_scene_code");
"03"
String Their_scene_type=request.getParameter("their_scene_type");
recpt_type("301")
String Their_scene_name=request.getParameter("their_scene_name");
String Pre_associate_code=request.getParameter("pre_associate_code");
String Pre_associate_type=request.getParameter("pre_associate_type");如果没有,赋值"000"
String Per_associate_name=request.getParameter("per_associate_name");
String Their_associate_code=request.getParameter("their_associate_code");
String Their_associate_type=request.getParameter("their_associate_type");
String Their_associate_name=request.getParameter("their_associate_name");
String Next_associate_code=request.getParameter("next_associate_code");
String Next_associate_type=request.getParameter("next_associate_type");
如果没有,赋值"000"
String Next_associate_name=request.getParameter("next_associate_name");
[{code_name: "服装", industry_code: "10", industry_type: "101", type_name: "服装代加工"}]
[{code: 0, entity_type: "101", type_name: "采购员"}]
gmt_modify
9999-12-31.0
--RatingCreateServlet点赞接口--------------------------------
String User_id = request.getParameter("user_id");
String User_name = request.getParameter("user_name");
String Role_type = request.getParameter("role_type");
String Company_id = request.getParameter("company_id");
String Their_entity_type=request.getParameter("their_entity_type"); //点赞主体的代码,工单是02,订单是03
String Their_associate_type=request.getParameter("their_associate_type"); //所点赞主体的类型代码,如工单领料是201
String Their_associate_number=request.getParameter("their_associate_number");
//点赞主体的编号
String Their_associate_name=request.getParameter("their_associate_name");
//点赞主体类型名称,如领料
String Rating_type=request.getParameter("rating_type");
//点赞类型代码,101表示点赞,102表示评论
String Rating_name=request.getParameter("rating_name"); //点赞类型名称,101是名称为点赞,102名称为评论
String Remark=request.getParameter("remark"); //如果是点赞是,直接赋值"1",如果是评论的时候,就是评论内容
--------------------------------------------------------
RatingQueryServlet点赞评价接口:
their_entity_type表示主体代码:02是工单,03是订单,
their_associate_type是订单或工单的类型
their_associate_number是订单或工单的编号
返回结果:数组,元素为
code:0
finish_time:"2018-10-05 22:38:50.0"
rating_name:"点赞"
rating_number:"0420181005223850247"
rating_status:"1"
rating_type:"101"
remark:"1"
user_id:"oh1zH5QdEhZG_k44r-VEKO8uhCPw"
user_name:"无双BaOY_WHA"
image_address:
按时间顺序排列,注意去掉user_id重复的元素。
--------------------------------------------------------
RoleEntityServlet 角色->TabBar接口
输入:
String User_id = request.getParameter("user_id"); //录单操作ID
String User_name = request.getParameter("user_name");
String Role_type = request.getParameter("role_type");
String Company_id = request.getParameter("company_id");
String Company_name = request.getParameter("company_name");
输出:
entity_code; 主体代码
entity_name; 主体名称
serial_number; 序号
res.data示例:
[{entity_code: "01", entity_name: "商群", serial_number: "1"},
{entity_code: "09", entity_name: "店铺", serial_number: "2"}]
商群01、工单02、订单03、评价单04、
业务单据05、记账凭证06、内容07、钱包08、店铺09、商品10
-------------------------------------------------------------
商群级别查询接口:userLevelQueryServlet
:
输入: String User_id = request.getParameter("user_id"); //录单操作ID
String User_name = request.getParameter("user_name");
String Role_type = request.getParameter("role_type");
String Company_id = request.getParameter("company_id");
String User_level = request.getParameter("user_level");
user_level为几级代理,01表示一级代理,02表示二级代理,03表示三级代理
--------------------------------------------------------------
切换路由菜单接口:EntityParamServlet
输入:
String User_id = request.getParameter("user_id"); //录单操作ID
String User_name = request.getParameter("user_name");
String Role_type = request.getParameter("role_type");
String Company_id = request.getParameter("company_id");
String Company_name = request.getParameter("company_name");
String their_scene_code = request.getParameter("their_scene_code");
String their_scene_type = request.getParameter("their_scene_type");
String their_scene_name = request.getParameter("their_scene_code");
String their_associate_code = request.getParameter("their_associate_code");
String their_associate_type = request.getParameter("their_associate_type");
String their_associate_name = request.getParameter("their_associate_name");
参考: their_scene_code = "01"; 表示用户
their_scene_type = "301"; 表示该小程序进入的代理商模式
their_associate_code ="01"; 表示用户
their_associate_type = "301"; 表示当前选择的类型为代理商
输出:
[{"code":1,"other_associate_code":"01","other_associate_name":"详情","other_associate_type":"000"},{"code":1,"other_associate_code":"01","other_associate_name":"代理商","other_associate_type":"301"},{"code":1,"other_associate_code":"03","other_associate_name":"订单","other_associate_type":"000"}]
注意:
当返回结果为空时,尝试将their_associate_type改为"000"(其他参数不变)再次查询。
当返回的结果还是空时,尝试将their_scene_code改为"000"(其他参数不变)再次查询。
当返回的结果还是空时,尝试将their_scene_code、their_associate_type都改为"000"(其他参数不变)再次查询。
若返回的结果仍是空,说明没有可查询的内容。
------------------------------------------------------------------------------------
内容项的查询接口:ContentQueryServlet
输入:String User_id = request.getParameter("user_id");
String User_name = request.getParameter("user_name");
String Role_type = request.getParameter("role_type");
String Work_status = request.getParameter("work_status");
String Company_id = request.getParameter("company_id");
String their_associate_code = request.getParameter("their_associate_code"); 主体代码 用户为01
String their_associate_type = request.getParameter("their_associate_type"); 赋值:000
String their_associate_number = request.getParameter("their_associate_number"); 所选择的主体编号
String their_associate_name = request.getParameter("their_associate_name"); 所选择的主体名称
String other_associate_code = request.getParameter("other_associate_code"); 所选择的主体代码,内容为07
String other_associate_type = request.getParameter("other_associate_type"); 赋值:000
String other_associate_number = request.getParameter("other_associate_number"); 赋值:00000
String other_associate_name = request.getParameter("other_associate_name"); 不用赋值
---------------------------------------------------------------------------------------
钱包(账户)明细查询接口:
AccountLogServlet
String User_id = request.getParameter("user_id"); //录单操作ID
String User_name = request.getParameter("user_name");
String Role_type = request.getParameter("role_type");
String Work_status = request.getParameter("work_status");
String Company_id = request.getParameter("company_id");
String their_associate_code = request.getParameter("their_associate_code");
String their_associate_type = request.getParameter("their_associate_type");
String their_associate_number = request.getParameter("their_associate_number");
String their_associate_name = request.getParameter("their_associate_name");
String other_associate_code = request.getParameter("other_associate_code");
String other_associate_type = request.getParameter("other_associate_type");
String other_associate_number = request.getParameter("other_associate_number");
String other_associate_name = request.getParameter("other_associate_name");
String Gmt_modify = request.getParameter("gmt_modify");
输出:
[{accountNo:"0820181218101932521"
accountType:"1122"
accounting_date:"20181217" //交易的时间(在界面显示的时间)
aliasName:"应收帐款-蓝三科技工商银行账户2"
amount:800
createTime:"2018-12-24 14:28:17.0" //用于排序的时间
currency:0
event_code:"1"
remark:"格力电器借出款项"
typeName:"应收帐款"}]
-------------------------------------------------------------------------------
订单查询(基于关系连接)接口:
BillQuery2Servlet
输入:
String User_id = request.getParameter("user_id");
String User_name = request.getParameter("user_name");
String Role_type = request.getParameter("role_type");
String Work_status = request.getParameter("work_status");
String Company_id = request.getParameter("company_id");
String their_associate_code = request.getParameter("their_associate_code");
String their_associate_type = request.getParameter("their_associate_type");
String their_associate_number = request.getParameter("their_associate_number");
String their_associate_name = request.getParameter("their_associate_name");
String other_associate_code = request.getParameter("other_associate_code");
String other_associate_type = request.getParameter("other_associate_type");
String other_associate_number = request.getParameter("other_associate_number");
String other_associate_name = request.getParameter("other_associate_name");
String Gmt_modify = request.getParameter("gmt_modify");
----------------------------------------------------------------------------------
商铺查询接口:
ShopQueryServlet
String User_id = request.getParameter("user_id");
String User_name = request.getParameter("user_name");
String Role_type = request.getParameter("role_type");
String Work_status = request.getParameter("work_status");
String Company_id = request.getParameter("company_id");
String their_associate_code = request.getParameter("their_associate_code");
String their_associate_type = request.getParameter("their_associate_type");
String their_associate_number = request.getParameter("their_associate_number");
String their_associate_name = request.getParameter("their_associate_name");
String other_associate_code = request.getParameter("other_associate_code");
String other_associate_type = request.getParameter("other_associate_type");
String other_associate_number = request.getParameter("other_associate_number");
String other_associate_name = request.getParameter("other_associate_name");
String Gmt_modify = request.getParameter("gmt_modify");
----------------------------------
Comm_dto.setRole_type("02"); //管理员
Work_status = "0";
other_associate_number="00000";
Gmt_modify = "9999-08-25 20:44:28";
Comm_dto.setUser_name("安仔");
their_associate_code = "01";
their_associate_type = "000";
their_associate_number = "oh1zH5ahMZbYh36lYGLce-7wFPWM";
other_associate_code = "09"; //店铺
other_associate_type = "000";
输出:
[{company_id:"54385"
gmt_create:"1990-01-01"
gmt_modify:"1990-01-01 00:00:00.0"
id:"1"
image_1:"11"
image_2:"12"
image_3:"13"
image_4:"14"
product_1:"产品说明1"
product_2:"产品说明2"
product_3:"产品说明3"
product_4:"产品说明4"
remark:"雪峰淘宝旗舰店"
shop_address:"http:dddsddsddd"
shop_name:"淘宝店铺"
shop_number:"001"
shop_type:"01"},{"company_id":"54385","gmt_create":"1990-01-01","gmt_modify":"1990-01-01 00:00:00.0","id":"2","image_1":"11","image_2":"12","image_3":"13","image_4":"14","product_1":"产品说明1","product_2":"产品说明1","product_3":"产品说明1","product_4":"产品说明1","remark":"奶茶妹妹店","shop_address":"http:dddsddddddd","shop_name":"京东店铺","shop_number":"002","shop_type":"01"}]
---------------------------------------------
EntityRelCreateServlet
实体间建立关系
String User_id = request.getParameter("user_id");
String User_name = request.getParameter("user_name");
String Role_type = request.getParameter("role_type");
String Company_id = request.getParameter("company_id");
String Work_status = request.getParameter("work_status");
String their_associate_code = request.getParameter("their_associate_code");
String their_associate_type = request.getParameter("their_associate_type");
String their_associate_number = request.getParameter("their_associate_number");
String their_associate_name = request.getParameter("their_associate_name");
String other_associate_code = request.getParameter("other_associate_code");
String other_associate_type = request.getParameter("other_associate_type");
String other_associate_number = request.getParameter("other_associate_number");
String other_associate_name = request.getParameter("other_associate_name");
String Gmt_modify = request.getParameter("gmt_modify");
EntityRelCreateServlet2----------------------------
把分享当事主体与分享内容赋值
增加社保人员----------------------
traderId:1245212
companyId:1245212
safeId:1245212
identityType:6
identityId:3343434311
name:mkiiH
sex:0
country:156
pay:300 //工资薪金
birthday:2019-05-03
personType:01
personStatus:0
workForm:10
registerType:01
reportDate:2019-05-03
beginDate:2019-05-03
telNo:13192269633
agedSafe:1
jobSafe:1
peasantSafe:1
workSafe:1
medicalSafe:1
birthSafe:1
reportSalary:1701 //申报工资