owl-cli 6.214.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/owl-init.js +26 -5
- package/examples/models/owlsys/backendSession.json +52 -0
- package/examples/models/owlsys/orgBatch/org_admin_batch_import/api/src/eventhandlers/afterAdd.jsx +10 -0
- package/examples/models/owlsys/orgBatch/org_admin_batch_import/api/src/tasks/batchImport.jsx +318 -0
- package/examples/models/owlsys/orgBatch/org_admin_batch_import.json +75 -0
- package/examples/models/owlsys/orgBatch/org_batch_export/api/src/eventhandlers/batchExport.jsx +24 -0
- package/examples/models/owlsys/orgBatch/org_batch_export/api/src/tasks/batchExport.jsx +375 -0
- package/examples/models/owlsys/orgBatch/org_batch_export.json +102 -0
- package/examples/models/owlsys/orgBatch/org_batch_import/api/src/eventhandlers/batchImport.jsx +24 -0
- package/examples/models/owlsys/orgBatch/org_batch_import/api/src/plugins/downTemplate.jsx +79 -0
- package/examples/models/owlsys/orgBatch/org_batch_import/api/src/tasks/batchImport.jsx +424 -0
- package/examples/models/owlsys/orgBatch/org_batch_import.json +82 -0
- package/examples/models/owlsys/orgBatch/org_batch_repair_parentid/api/src/eventhandlers/batchUpdate.jsx +24 -0
- package/examples/models/owlsys/orgBatch/org_batch_repair_parentid/api/src/plugins/downTemplate.jsx +54 -0
- package/examples/models/owlsys/orgBatch/org_batch_repair_parentid/api/src/tasks/batchUpdate.jsx +924 -0
- package/examples/models/owlsys/orgBatch/org_batch_repair_parentid.json +82 -0
- package/examples/models/owlsys/orgBatch/org_batch_update/api/src/eventhandlers/batchUpdate.jsx +24 -0
- package/examples/models/owlsys/orgBatch/org_batch_update/api/src/plugins/downTemplate.jsx +79 -0
- package/examples/models/owlsys/orgBatch/org_batch_update/api/src/tasks/batchUpdate.jsx +472 -0
- package/examples/models/owlsys/orgBatch/org_batch_update.json +81 -0
- package/examples/models/owlsys/orgBatch/org_batch_update_parentid/api/src/eventhandlers/batchUpdate.jsx +24 -0
- package/examples/models/owlsys/orgBatch/org_batch_update_parentid/api/src/plugins/downTemplate.jsx +54 -0
- package/examples/models/owlsys/orgBatch/org_batch_update_parentid/api/src/tasks/batchUpdate.jsx +509 -0
- package/examples/models/owlsys/orgBatch/org_batch_update_parentid.json +82 -0
- package/examples/models/owlsys/orgBatch/org_batch_update_state/api/src/eventhandlers/batchUpdate.jsx +24 -0
- package/examples/models/owlsys/orgBatch/org_batch_update_state/api/src/plugins/downTemplate.jsx +61 -0
- package/examples/models/owlsys/orgBatch/org_batch_update_state/api/src/tasks/doUpdateTask.jsx +299 -0
- package/examples/models/owlsys/orgBatch/org_batch_update_state.json +81 -0
- package/examples/models/owlsys/orgBatch/orguser_batch_import/api/src/eventhandlers/batchImport.jsx +24 -0
- package/examples/models/owlsys/orgBatch/orguser_batch_import/api/src/plugins/downTemplate.jsx +52 -0
- package/examples/models/owlsys/orgBatch/orguser_batch_import/api/src/tasks/batchImport.jsx +297 -0
- package/examples/models/owlsys/orgBatch/orguser_batch_import.json +82 -0
- package/examples/models/owlsys/orgBatch/orguser_batch_update/api/src/eventhandlers/batchImport.jsx +24 -0
- package/examples/models/owlsys/orgBatch/orguser_batch_update/api/src/plugins/downTemplate.jsx +58 -0
- package/examples/models/owlsys/orgBatch/orguser_batch_update/api/src/tasks/batchUpdate.jsx +345 -0
- package/examples/models/owlsys/orgBatch/orguser_batch_update.json +82 -0
- package/examples/models/owlsys/organization/business_circle.json +144 -0
- package/examples/models/owlsys/organization/business_circle_application.json +50 -0
- package/examples/models/owlsys/organization/createSiteOrder.json +50 -0
- package/examples/models/owlsys/organization/entity.json +64 -0
- package/examples/models/owlsys/organization/merchant_apply/api/src/plugins/doCertifyToNotPass.jsx +68 -0
- package/examples/models/owlsys/organization/merchant_apply/api/src/plugins/doCertifyToPass.jsx +135 -0
- package/examples/models/owlsys/organization/merchant_apply.json +561 -0
- package/examples/models/owlsys/organization/merchant_user.json +55 -0
- package/examples/models/owlsys/organization/orgAdminGroups.json +179 -0
- package/examples/models/owlsys/organization/org_admin_groups/api/src/plugins/addUserToGroup.jsx +65 -0
- package/examples/models/owlsys/organization/org_admin_groups/api/src/plugins/createNewUser.jsx +9 -0
- package/examples/models/owlsys/organization/org_certify_log/api/src/plugins/doCertifyToNotPass.jsx +66 -0
- package/examples/models/owlsys/organization/org_certify_log/api/src/plugins/doCertifyToPass.jsx +94 -0
- package/examples/models/owlsys/organization/org_certify_log.json +78 -0
- package/examples/models/owlsys/organization/org_entity.json +60 -0
- package/examples/models/owlsys/organization/org_modules.json +117 -0
- package/examples/models/owlsys/organization/org_source.json +30 -0
- package/examples/models/owlsys/organization/org_user.json +81 -0
- package/examples/models/owlsys/organization/orgs/api/src/eventHandlers/doCheckBeforeAddOrUpdate.jsx +32 -0
- package/examples/models/owlsys/organization/orgs/api/src/eventHandlers/doCheckBeforeDelete.jsx +19 -0
- package/examples/models/owlsys/organization/orgs/api/src/eventHandlers/setIdByOrgType.jsx +47 -0
- package/examples/models/owlsys/organization/orgs/api/src/plugins/toOrg.jsx +48 -0
- package/examples/models/owlsys/organization/orgs.json +671 -0
- package/examples/models/owlsys/organization/platformAdminGroups.json +78 -0
- package/examples/models/owlsys/organization/website/api/src/plugins/syncToOrg.jsx +27 -0
- package/examples/models/owlsys/organization/website.json +104 -0
- package/examples/models/owlsys/permissions/permission.json +165 -0
- package/examples/models/owlsys/permissions/roles.json +48 -0
- package/examples/models/owlsys/permissions/tablelevelpermission.json +42 -0
- package/examples/models/owlsys/server_token.json +38 -0
- package/examples/models/owlsys/session.json +57 -0
- package/examples/models/owlsys/tasks/process_job.json +94 -0
- package/examples/models/owlsys/tasks/process_job_checklog.json +66 -0
- package/examples/models/owlsys/tasks/process_job_log.json +34 -0
- package/examples/models/owlsys/user/address.json +52 -0
- package/examples/models/owlsys/user/mall_u/api/src/plugins/changePassword.jsx +133 -0
- package/examples/models/owlsys/user/mall_u_category/api/src/eventHandlers/autoSetFullPath_addAfter.jsx +25 -0
- package/examples/models/owlsys/user/mall_u_category/api/src/eventHandlers/autoSetFullPath_updateBefore.jsx +23 -0
- package/examples/models/owlsys/user/mall_user_logout/api/src/eventhandlers/updateUserState.jsx +25 -0
- package/examples/models/owlsys/user/org_user_address.json +46 -0
- package/examples/models/owlsys/user/org_user_address_default.json +48 -0
- package/examples/models/owlsys/user/org_user_invoice.json +56 -0
- package/examples/models/owlsys/user/user.json +458 -0
- package/examples/models/owlsys/user/user_address.json +46 -0
- package/examples/models/owlsys/user/user_address_default.json +48 -0
- package/examples/models/owlsys/user/user_batch_base_export/api/src/eventhandlers/batchExport.jsx +24 -0
- package/examples/models/owlsys/user/user_batch_base_export/api/src/tasks/batchExport.jsx +240 -0
- package/examples/models/owlsys/user/user_batch_base_export.json +97 -0
- package/examples/models/owlsys/user/user_batch_export_bigmember_info/api/src/eventhandlers/batchExport.jsx +24 -0
- package/examples/models/owlsys/user/user_batch_export_bigmember_info/api/src/plugins/downTemplate.jsx +47 -0
- package/examples/models/owlsys/user/user_batch_export_bigmember_info/api/src/tasks/batchExportTask.jsx +208 -0
- package/examples/models/owlsys/user/user_batch_export_bigmember_info.json +83 -0
- package/examples/models/owlsys/user/user_batch_export_by_userid/api/src/eventhandlers/batchExport.jsx +24 -0
- package/examples/models/owlsys/user/user_batch_export_by_userid/api/src/plugins/downTemplate.jsx +44 -0
- package/examples/models/owlsys/user/user_batch_export_by_userid/api/src/tasks/batchExportTask.jsx +262 -0
- package/examples/models/owlsys/user/user_batch_export_by_userid.json +83 -0
- package/examples/models/owlsys/user/user_batch_import/api/src/eventhandlers/batchImport.jsx +24 -0
- package/examples/models/owlsys/user/user_batch_import/api/src/tasks/doAddUserTask.jsx +250 -0
- package/examples/models/owlsys/user/user_batch_import.json +76 -0
- package/examples/models/owlsys/user/user_batch_update_category/api/src/eventhandlers/batchUpdate.jsx +24 -0
- package/examples/models/owlsys/user/user_batch_update_category/api/src/tasks/doUpdateUserTask.jsx +191 -0
- package/examples/models/owlsys/user/user_batch_update_category.json +77 -0
- package/examples/models/owlsys/user/user_batch_update_password/api/src/eventhandlers/batchUpdate.jsx +24 -0
- package/examples/models/owlsys/user/user_batch_update_password/api/src/plugins/downTemplate.jsx +48 -0
- package/examples/models/owlsys/user/user_batch_update_password/api/src/tasks/doUpdateUserTask.jsx +140 -0
- package/examples/models/owlsys/user/user_batch_update_password.json +82 -0
- package/examples/models/owlsys/user/user_batch_update_state/api/src/eventhandlers/batchUpdate.jsx +24 -0
- package/examples/models/owlsys/user/user_batch_update_state/api/src/tasks/doUpdateUserTask.jsx +140 -0
- package/examples/models/owlsys/user/user_batch_update_state.json +75 -0
- package/examples/models/owlsys/user/user_category.json +96 -0
- package/examples/models/owlsys/user/user_education.json +56 -0
- package/examples/models/owlsys/user/user_income.json +56 -0
- package/examples/models/owlsys/user/user_industry.json +56 -0
- package/examples/models/owlsys/user/user_invoice.json +88 -0
- package/examples/models/owlsys/user/user_logout.json +65 -0
- package/examples/models/owlsys/user/user_purchased_merchant.json +41 -0
- package/examples/models/owlsys/user/user_source.json +57 -0
- package/examples/models/owlsys/user/user_third_openid.json +64 -0
- package/examples/models/owlsys/user/user_third_openid_source.json +55 -0
- package/examples/models/owlsys/user/user_update_log.json +69 -0
- package/examples/models/owlsys/user_logs/app_logs.json +48 -0
- package/examples/models/owlsys/user_logs/history_p.json +77 -0
- package/examples/models/owlsys/user_logs/recent_apps.json +37 -0
- package/examples/models/owlsys/user_logs/user_login_error_log.json +65 -0
- package/examples/models/owlsys/user_logs/user_login_log.json +64 -0
- package/examples/owlsysApps/commonService/build.xml +29 -0
- package/examples/owlsysApps/commonService/src/meta.json +10 -0
- package/examples/owlsysApps/commonService/src/services/BackendSessionUtil.jsx +84 -0
- package/examples/owlsysApps/commonService/src/services/CommonUtil.jsx +165 -0
- package/examples/owlsysApps/commonService/src/services/LoginUtil.jsx +44 -0
- package/examples/owlsysApps/commonService/src/services/PasswordUtil.jsx +62 -0
- package/examples/owlsysApps/commonService/src/services/SessionUtil.jsx +87 -0
- package/examples/owlsysApps/owlPermission/build.xml +29 -0
- package/examples/owlsysApps/owlPermission/src/icon.png +0 -0
- package/examples/owlsysApps/owlPermission/src/meta.json +9 -0
- package/examples/owlsysApps/owlPermission/src/services/RolesService.jsx +173 -0
- package/examples/owlsysApps/owlPermission/src/services/permissionService.jsx +93 -0
- package/examples/owlsysApps/owlShell/build.xml +28 -0
- package/examples/owlsysApps/owlShell/package-lock.json +3 -0
- package/examples/owlsysApps/owlShell/src/consts.jsx +36 -0
- package/examples/owlsysApps/owlShell/src/handlers/add_app_log.jsx +31 -0
- package/examples/owlsysApps/owlShell/src/handlers/changePassword.jsx +54 -0
- package/examples/owlsysApps/owlShell/src/handlers/getCurrentOrg.jsx +45 -0
- package/examples/owlsysApps/owlShell/src/handlers/getCurrentUser.jsx +168 -0
- package/examples/owlsysApps/owlShell/src/handlers/getPermissions.jsx +39 -0
- package/examples/owlsysApps/owlShell/src/handlers/getRoles.jsx +10 -0
- package/examples/owlsysApps/owlShell/src/handlers/getSpec.jsx +65 -0
- package/examples/owlsysApps/owlShell/src/handlers/getViewTemplate.jsx +53 -0
- package/examples/owlsysApps/owlShell/src/handlers/get_recent_apps.jsx +45 -0
- package/examples/owlsysApps/owlShell/src/handlers/leftMenuHandler.jsx +360 -0
- package/examples/owlsysApps/owlShell/src/handlers/loadSettings.jsx +32 -0
- package/examples/owlsysApps/owlShell/src/handlers/login.jsx +400 -0
- package/examples/owlsysApps/owlShell/src/handlers/logout.jsx +27 -0
- package/examples/owlsysApps/owlShell/src/handlers/meanLogin.jsx +231 -0
- package/examples/owlsysApps/owlShell/src/handlers/organization/create_site.jsx +52 -0
- package/examples/owlsysApps/owlShell/src/handlers/organization/getSiteOrder.jsx +32 -0
- package/examples/owlsysApps/owlShell/src/handlers/organization/getUserSites.jsx +29 -0
- package/examples/owlsysApps/owlShell/src/handlers/organization/getWebSite.jsx +49 -0
- package/examples/owlsysApps/owlShell/src/handlers/organization/saveSite.jsx +42 -0
- package/examples/owlsysApps/owlShell/src/handlers/refreshApps.jsx +533 -0
- package/examples/owlsysApps/owlShell/src/handlers/set_recent_apps.jsx +44 -0
- package/examples/owlsysApps/owlShell/src/handlers/switchOrgs.jsx +99 -0
- package/examples/owlsysApps/owlShell/src/handlers/switchRole.jsx +64 -0
- package/examples/owlsysApps/owlShell/src/icon.png +0 -0
- package/examples/owlsysApps/owlShell/src/include/checklogin.jsx +108 -0
- package/examples/owlsysApps/owlShell/src/jobs/create_site_jobs.jsx +172 -0
- package/examples/owlsysApps/owlShell/src/jobs/refresh_apps_jobs.jsx +628 -0
- package/examples/owlsysApps/owlShell/src/meta.json +16 -0
- package/examples/owlsysApps/owlShell/src/pages/addHistory.jsx +35 -0
- package/examples/owlsysApps/owlShell/src/pages/common/include_head.jsx +8 -0
- package/examples/owlsysApps/owlShell/src/pages/common/include_head.jsxp +4 -0
- package/examples/owlsysApps/owlShell/src/pages/home.html +0 -0
- package/examples/owlsysApps/owlShell/src/pages/index.jsx +39 -0
- package/examples/owlsysApps/owlShell/src/pages/index.jsxp +16 -0
- package/examples/owlsysApps/owlShell/src/pages/leftMenu.jsx +204 -0
- package/examples/owlsysApps/owlShell/src/pages/leftMenu.jsxp +84 -0
- package/examples/owlsysApps/owlShell/src/pages/logOut.jsx +35 -0
- package/examples/owlsysApps/owlShell/src/pages/login/checkShopAdmin.jsx +69 -0
- package/examples/owlsysApps/owlShell/src/pages/login/checkWarehouseAdmin.jsx +66 -0
- package/examples/owlsysApps/owlShell/src/pages/login/shopLogin.jsx +14 -0
- package/examples/owlsysApps/owlShell/src/pages/login/shopLogin.jsxp +99 -0
- package/examples/owlsysApps/owlShell/src/pages/login/shopLoginOk.jsx +85 -0
- package/examples/owlsysApps/owlShell/src/pages/login/warehouseLogin.jsx +13 -0
- package/examples/owlsysApps/owlShell/src/pages/login/warehouseLogin.jsxp +100 -0
- package/examples/owlsysApps/owlShell/src/pages/login/warehouseLoginOk.jsx +72 -0
- package/examples/owlsysApps/owlShell/src/pages/main.jsx +34 -0
- package/examples/owlsysApps/owlShell/src/pages/main.jsxp +84 -0
- package/examples/owlsysApps/owlShell/src/pages/subMain.jsx +23 -0
- package/examples/owlsysApps/owlShell/src/pages/subMain.jsxp +38 -0
- package/examples/owlsysApps/owlShell/src/pages/test.jsx +1 -0
- package/examples/owlsysApps/owlShell/src/pages/updatePassword.jsx +18 -0
- package/examples/owlsysApps/owlShell/src/pages/viewHistory.jsx +120 -0
- package/examples/owlsysApps/owlShell/src/utils/PermissionUtil.jsx +47 -0
- package/examples/owlsysApps/owlShell/src/utils/RolesUtils.jsx +152 -0
- package/examples/owlsysApps/owlShell/src/utils/verifyAdminUtil.jsx +40 -0
- package/package.json +1 -1
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
//#import Util.js
|
|
2
|
+
//#import excel.js
|
|
3
|
+
//#import $owl_mall_u:services/modelService.jsx
|
|
4
|
+
//#import $owl_org_batch_export:services/modelService.jsx
|
|
5
|
+
//#import $owl_orgs:services/modelService.jsx
|
|
6
|
+
//#import $owlService:services/common/SearchUtil.jsx
|
|
7
|
+
//#import DateUtil.js
|
|
8
|
+
|
|
9
|
+
;(function () {
|
|
10
|
+
|
|
11
|
+
var jBatchImport = owl_org_batch_exportService.get(batchId);
|
|
12
|
+
|
|
13
|
+
$.log("org_batch_export....batchExport.jsx....begin...jBatchImport=" + JSON.stringify(jBatchImport));
|
|
14
|
+
var logMsg = "";
|
|
15
|
+
var beginTime = (new Date()).getTime();
|
|
16
|
+
try {
|
|
17
|
+
var orgId = jBatchImport._orgId;
|
|
18
|
+
|
|
19
|
+
var totalAmount = getTotalCount(jBatchImport);
|
|
20
|
+
if (totalAmount > 10000) {
|
|
21
|
+
logMsg = appendLog(logMsg, "操作终止,原因是:本次商家导出总数量超过10000,请缩小搜索范围分多次导出");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var recordList = getMerchantList(jBatchImport);
|
|
26
|
+
|
|
27
|
+
var index = 0;
|
|
28
|
+
var titles = [
|
|
29
|
+
{"index": index++, "columnWidth": "22", "field": "parent_id", "title": "上级ID"},
|
|
30
|
+
{"index": index++, "columnWidth": "40", "field": "fullPathName", "title": "上级名称"},
|
|
31
|
+
{"index": index++, "columnWidth": "22", "field": "orgType", "title": "组织类型"},
|
|
32
|
+
{"index": index++, "columnWidth": "22", "field": "merType", "title": "商家类型"},
|
|
33
|
+
{"index": index++, "columnWidth": "22", "field": "id", "title": "商家ID"},
|
|
34
|
+
{"index": index++, "columnWidth": "22", "field": "name", "title": "商家名称"},
|
|
35
|
+
{"index": index++, "columnWidth": "22", "field": "name_en", "title": "英文名称"},
|
|
36
|
+
{"index": index++, "columnWidth": "22", "field": "regionPath", "title": "所在地区"},
|
|
37
|
+
{"index": index++, "columnWidth": "22", "field": "contact", "title": "联系人"},
|
|
38
|
+
{"index": index++, "columnWidth": "22", "field": "mobile", "title": "联系手机"},
|
|
39
|
+
{"index": index++, "columnWidth": "22", "field": "phone", "title": "座机"},
|
|
40
|
+
{"index": index++, "columnWidth": "22", "field": "email", "title": "邮箱"},
|
|
41
|
+
{"index": index++, "columnWidth": "22", "field": "address", "title": "店铺地址"},
|
|
42
|
+
{"index": index++, "columnWidth": "22", "field": "businessTime", "title": "开业时间"},
|
|
43
|
+
{"index": index++, "columnWidth": "22", "field": "openTime", "title": "营业时间"},
|
|
44
|
+
{"index": index++, "columnWidth": "40", "field": "shopAddress", "title": "店铺网址"},
|
|
45
|
+
{"index": index++, "columnWidth": "22", "field": "siteId", "title": "站点Id"},
|
|
46
|
+
{"index": index++, "columnWidth": "40", "field": "homePageId", "title": "移动端首页Id"},
|
|
47
|
+
{"index": index++, "columnWidth": "40", "field": "pcHomePageId", "title": "PC端首页Id"},
|
|
48
|
+
{"index": index++, "columnWidth": "40", "field": "kefuUrl", "title": "客服链接"},
|
|
49
|
+
{"index": index++, "columnWidth": "40", "field": "memo", "title": "备注"},
|
|
50
|
+
{"index": index++, "columnWidth": "40", "field": "deliveryMemo", "title": "配送备注"},
|
|
51
|
+
{"index": index++, "columnWidth": "22", "field": "deliveryMode", "title": "配送方式"},
|
|
52
|
+
{"index": index++, "columnWidth": "60", "field": "moduleIds", "title": "权限组织类型ID"},
|
|
53
|
+
{"index": index++, "columnWidth": "60", "field": "deliveryPriceTemplates", "title": "默认运费模板ID"},
|
|
54
|
+
{"index": index++, "columnWidth": "60", "field": "platformCategories", "title": "经营范围"},
|
|
55
|
+
{"index": index++, "columnWidth": "22", "field": "owl_createTime", "title": "创建时间"},
|
|
56
|
+
{"index": index++, "columnWidth": "22", "field": "certifyState", "title": "审核状态"},
|
|
57
|
+
{"index": index++, "columnWidth": "22", "field": "publishState", "title": "发布状态"},
|
|
58
|
+
{"index": index++, "columnWidth": "22", "field": "enableState", "title": "冻结状态"},
|
|
59
|
+
{"index": index++, "columnWidth": "22", "field": "productCanBuyState", "title": "商品可否购买"},
|
|
60
|
+
{"index": index++, "columnWidth": "22", "field": "canGiveIntegral", "title": "可否赠送积分"},
|
|
61
|
+
{"index": index++, "columnWidth": "40", "field": "tag", "title": "商家标签"}
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
logMsg = appendLog(logMsg, "总导出商家数量:" + recordList.length);
|
|
65
|
+
|
|
66
|
+
// $.log("org_batch_export...batchExport.jsx............title=" + JSON.stringify(titles));
|
|
67
|
+
// $.log("org_batch_export...batchExport.jsx............recordList=" + JSON.stringify(recordList));
|
|
68
|
+
|
|
69
|
+
var export_fileName = DateUtil.getLongDate(new Date().getTime());
|
|
70
|
+
|
|
71
|
+
var fileUrl = Excel.createExcelList(export_fileName, titles, recordList);
|
|
72
|
+
|
|
73
|
+
jBatchImport.file = {url: fileUrl, name: export_fileName};
|
|
74
|
+
|
|
75
|
+
logMsg = appendLog(logMsg, "商家导出结束。");
|
|
76
|
+
|
|
77
|
+
} catch (e) {
|
|
78
|
+
$.log("org_batch_export....batchExport.jsx....error=" + e);
|
|
79
|
+
logMsg = appendLog(logMsg, "操作出现异常,异常信息为:" + e);
|
|
80
|
+
} finally {
|
|
81
|
+
var endTime = (new Date()).getTime();
|
|
82
|
+
var logInfo = "总耗时=" + (endTime - beginTime) + "毫秒";
|
|
83
|
+
|
|
84
|
+
logMsg = appendLog(logMsg, "");
|
|
85
|
+
logMsg = appendLog(logMsg, logInfo);
|
|
86
|
+
|
|
87
|
+
jBatchImport.msg = logMsg;
|
|
88
|
+
owl_org_batch_exportService.update(jBatchImport);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
})();
|
|
92
|
+
|
|
93
|
+
function appendLog(logInfo, s) {
|
|
94
|
+
if (logInfo) {
|
|
95
|
+
return logInfo + "\n" + s;
|
|
96
|
+
}
|
|
97
|
+
return s;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function getMerchantList(jBatchImport) {
|
|
101
|
+
|
|
102
|
+
var searchArgs = getSearchArgs(jBatchImport);
|
|
103
|
+
|
|
104
|
+
var pageLimit = 500;
|
|
105
|
+
var totalRecords = owl_orgsService.count(null, searchArgs, jBatchImport.keyword);
|
|
106
|
+
var totalPages = (totalRecords + pageLimit - 1) / pageLimit;
|
|
107
|
+
$.log("org_batch_export...batchExport.jsx.....getMerchantList....totalPages=" + totalPages + "...totalRecords=" + totalRecords);
|
|
108
|
+
|
|
109
|
+
var totalMerchant = 0;
|
|
110
|
+
var resultList = [];
|
|
111
|
+
for (var k = 1; k <= totalPages; k++) {
|
|
112
|
+
var start = (k - 1) * pageLimit;
|
|
113
|
+
$.log("org_batch_export...batchExport.jsx...getMerchantList...start=" + start);
|
|
114
|
+
|
|
115
|
+
var beginExecTime = new Date().getTime();
|
|
116
|
+
|
|
117
|
+
var recordList = searchMerchants(jBatchImport, searchArgs, start, pageLimit);
|
|
118
|
+
var size = recordList.length;
|
|
119
|
+
if (size > 0) {
|
|
120
|
+
for (var i = 0; i < size; i++) {
|
|
121
|
+
var jMerchant = recordList[i];
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
var publishStateName = "";
|
|
125
|
+
if (jMerchant.publishState == "0") {
|
|
126
|
+
publishStateName = "不发布";
|
|
127
|
+
} else if (jMerchant.publishState == "1") {
|
|
128
|
+
publishStateName = "发布";
|
|
129
|
+
}
|
|
130
|
+
var certifyStateName = "";
|
|
131
|
+
if (jMerchant.certifyState == "0") {
|
|
132
|
+
certifyStateName = "新增待审核";
|
|
133
|
+
} else if (jMerchant.certifyState == "1") {
|
|
134
|
+
certifyStateName = "修改待审核";
|
|
135
|
+
} else if (jMerchant.certifyState == "2") {
|
|
136
|
+
certifyStateName = "审核不通过";
|
|
137
|
+
} else if (jMerchant.certifyState == "3") {
|
|
138
|
+
certifyStateName = "审核通过";
|
|
139
|
+
}
|
|
140
|
+
var enableStateName = "";
|
|
141
|
+
if (jMerchant.enableState == "Y") {
|
|
142
|
+
enableStateName = "激活";
|
|
143
|
+
} else if (jMerchant.enableState == "N") {
|
|
144
|
+
enableStateName = "冻结";
|
|
145
|
+
}
|
|
146
|
+
var productCanBuyStateName = "";
|
|
147
|
+
if (jMerchant.productCanBuyState == "0") {
|
|
148
|
+
productCanBuyStateName = "不可以";
|
|
149
|
+
} else if (jMerchant.productCanBuyState == "1") {
|
|
150
|
+
productCanBuyStateName = "可以";
|
|
151
|
+
}
|
|
152
|
+
var canGiveIntegralName = "";
|
|
153
|
+
if (jMerchant.canGiveIntegral == "0") {
|
|
154
|
+
canGiveIntegralName = "不可以";
|
|
155
|
+
} else if (jMerchant.canGiveIntegral == "1") {
|
|
156
|
+
canGiveIntegralName = "可以";
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
var contactInfo = jMerchant.contactInfo || {};
|
|
160
|
+
var qiyu_info = jMerchant.qiyu_info || {};
|
|
161
|
+
|
|
162
|
+
var orgTypeName = getOrgTypeName(jMerchant.orgType);
|
|
163
|
+
var merTypeName = getMerTypeName(jMerchant.merType);
|
|
164
|
+
var deliveryModeName = getDeliveryModeName(jMerchant.deliveryMode);
|
|
165
|
+
var moduleIds = getOrgModules(jMerchant);
|
|
166
|
+
var deliveryPriceTemplates = getDeliveryPriceTemplate(jMerchant);
|
|
167
|
+
var platformCategories = getPlatformCategoryName(jMerchant);
|
|
168
|
+
|
|
169
|
+
jMerchant.moduleIds = moduleIds;
|
|
170
|
+
jMerchant.deliveryPriceTemplates = deliveryPriceTemplates;
|
|
171
|
+
jMerchant.platformCategories = platformCategories;
|
|
172
|
+
jMerchant.orgType = orgTypeName;
|
|
173
|
+
jMerchant.merType = merTypeName;
|
|
174
|
+
jMerchant.deliveryMode = deliveryModeName;
|
|
175
|
+
jMerchant.publishState = publishStateName;
|
|
176
|
+
jMerchant.certifyState = certifyStateName;
|
|
177
|
+
jMerchant.enableState = enableStateName;
|
|
178
|
+
jMerchant.productCanBuyState = productCanBuyStateName;
|
|
179
|
+
jMerchant.canGiveIntegral = canGiveIntegralName;
|
|
180
|
+
jMerchant.contact = contactInfo.contact || "";
|
|
181
|
+
jMerchant.mobile = contactInfo.mobile || "";
|
|
182
|
+
jMerchant.phone = contactInfo.phone || "";
|
|
183
|
+
jMerchant.email = contactInfo.email || "";
|
|
184
|
+
jMerchant.address = contactInfo.address || "";
|
|
185
|
+
jMerchant.businessTime = contactInfo.businessTime || "";
|
|
186
|
+
jMerchant.openTime = contactInfo.openTime || "";
|
|
187
|
+
jMerchant.shopAddress = contactInfo.shopAddress || "";
|
|
188
|
+
jMerchant.siteId = contactInfo.siteId || "";
|
|
189
|
+
jMerchant.homePageId = contactInfo.homePageId || "";
|
|
190
|
+
jMerchant.pcHomePageId = contactInfo.pcHomePageId || "";
|
|
191
|
+
jMerchant.kefuUrl = qiyu_info.kefuUrl || "";
|
|
192
|
+
jMerchant.owl_createTime = DateUtil.getLongDate(new Date(jMerchant.owl_createTime));
|
|
193
|
+
if (jMerchant.owl_modifyTime) {
|
|
194
|
+
jMerchant.lastModifyTime = DateUtil.getLongDate(new Date(jMerchant.owl_modifyTime));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// $.log("org_batch_export...batchExport.jsx...orgInfo...orgId=" + jMerchant.id + "...jMerchant=" + JSON.stringify(jMerchant));
|
|
198
|
+
|
|
199
|
+
resultList.push(jMerchant);
|
|
200
|
+
totalMerchant++;
|
|
201
|
+
} catch (e) {
|
|
202
|
+
$.log("org_batch_export...batchExport.jsx...商家获取异常...orgId=" + jMerchant.id + "...error=" + e);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
var endExecTime = new Date().getTime();
|
|
208
|
+
$.log("org_batch_export...batchExport.jsx.....getMerchantList....totalTime=" + (endExecTime - beginExecTime) + "ms" + "...totalMerchant=" + totalMerchant);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return resultList;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function searchMerchants(jBatchImport, searchArgs, from, pageSize) {
|
|
215
|
+
var sr = owl_orgsService.search(null, searchArgs, jBatchImport.keyword, from, pageSize, [{"owl_createTime": {order: "desc"}}]);
|
|
216
|
+
if (sr.state == 'ok') {
|
|
217
|
+
return sr.list;
|
|
218
|
+
}
|
|
219
|
+
return [];
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function getFormatTime(jMerchant, jParentOrder, timeKey) {
|
|
223
|
+
if (jMerchant.time_info && jMerchant.time_info[timeKey]) {
|
|
224
|
+
return DateUtil.getLongDate(new Date(jMerchant.time_info[timeKey]));
|
|
225
|
+
}
|
|
226
|
+
if (jParentOrder) {
|
|
227
|
+
if (jParentOrder.time_info && jParentOrder.time_info[timeKey]) {
|
|
228
|
+
return DateUtil.getLongDate(new Date(jParentOrder.time_info[timeKey]));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return "";
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
function getPlatformCategoryName(jMerchant) {
|
|
236
|
+
var result = "";
|
|
237
|
+
var platform_category = jMerchant.platform_category;
|
|
238
|
+
if (platform_category) {
|
|
239
|
+
var count = 0;
|
|
240
|
+
for (var i = 0; i < platform_category.length; i++) {
|
|
241
|
+
if (result != "") {
|
|
242
|
+
result += ";\n";
|
|
243
|
+
}
|
|
244
|
+
result += platform_category[i].fullPathName || platform_category[i].name;
|
|
245
|
+
count++;
|
|
246
|
+
if(count >= 100) {
|
|
247
|
+
result += ";\n";
|
|
248
|
+
result += "【注意:经营范围超过100个,后面的经营范围不做展示,如需查看,请到系统中查看】";
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return result;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function getTotalCount(jBatchImport) {
|
|
257
|
+
var searchArgs = getSearchArgs(jBatchImport);
|
|
258
|
+
return owl_orgsService.count(null, searchArgs, jBatchImport.keyword);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
function getSearchArgs(jBatchImport) {
|
|
263
|
+
var beginTime = 0;
|
|
264
|
+
var endTime = 4102415999000;
|
|
265
|
+
if (jBatchImport.beginCreateTime) {
|
|
266
|
+
beginTime = new Date(jBatchImport.beginCreateTime).getTime();
|
|
267
|
+
}
|
|
268
|
+
if (jBatchImport.endCreateTime) {
|
|
269
|
+
endTime = new Date(jBatchImport.endCreateTime).getTime();
|
|
270
|
+
}
|
|
271
|
+
var searchArgs = {};
|
|
272
|
+
if(jBatchImport._orgId != "0") {
|
|
273
|
+
searchArgs._orgIds = jBatchImport._orgId;
|
|
274
|
+
} else {
|
|
275
|
+
if (jBatchImport.parent_id) {
|
|
276
|
+
searchArgs._orgIds = jBatchImport.parent_id;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (jBatchImport.orgType && jBatchImport.orgType != "all") {
|
|
280
|
+
searchArgs.orgType = jBatchImport.orgType;
|
|
281
|
+
}
|
|
282
|
+
if (jBatchImport.merType && jBatchImport.merType != "all") {
|
|
283
|
+
searchArgs.merType = jBatchImport.merType;
|
|
284
|
+
}
|
|
285
|
+
if (jBatchImport.publishState && jBatchImport.publishState != "all") {
|
|
286
|
+
searchArgs.publishState = jBatchImport.publishState;
|
|
287
|
+
}
|
|
288
|
+
if (jBatchImport.certifyState && jBatchImport.certifyState != "all") {
|
|
289
|
+
searchArgs.certifyState = jBatchImport.certifyState;
|
|
290
|
+
}
|
|
291
|
+
if (jBatchImport.enableState && jBatchImport.enableState != "all") {
|
|
292
|
+
searchArgs.enableState = jBatchImport.enableState;
|
|
293
|
+
}
|
|
294
|
+
if (jBatchImport.deliveryMode && jBatchImport.deliveryMode != "all") {
|
|
295
|
+
searchArgs.deliveryMode = jBatchImport.deliveryMode;
|
|
296
|
+
}
|
|
297
|
+
if (jBatchImport.productCanBuyState && jBatchImport.productCanBuyState != "all") {
|
|
298
|
+
searchArgs.productCanBuyState = jBatchImport.productCanBuyState;
|
|
299
|
+
}
|
|
300
|
+
if (jBatchImport.canGiveIntegral && jBatchImport.canGiveIntegral != "all") {
|
|
301
|
+
searchArgs.canGiveIntegral = jBatchImport.canGiveIntegral;
|
|
302
|
+
}
|
|
303
|
+
if (jBatchImport.parent_name) {
|
|
304
|
+
searchArgs.parent_name = jBatchImport.parent_name;
|
|
305
|
+
}
|
|
306
|
+
searchArgs.owl_createTime = SearchUtil.getSearchDateRangeEx(beginTime, endTime);
|
|
307
|
+
return searchArgs;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
function getOrgTypeName(orgType) {
|
|
312
|
+
if (orgType == "org") {
|
|
313
|
+
return "组织机构";
|
|
314
|
+
} else if (orgType == "merchant") {
|
|
315
|
+
return "商家";
|
|
316
|
+
}
|
|
317
|
+
return "";
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function getMerTypeName(merType) {
|
|
321
|
+
if (merType == "com") {
|
|
322
|
+
return "普通商家";
|
|
323
|
+
} else if (merType == "gp") {
|
|
324
|
+
return "集采商家";
|
|
325
|
+
} else if (merType == "crossDirectMail") {
|
|
326
|
+
return "跨境直邮";
|
|
327
|
+
} else if (merType == "crossBonded") {
|
|
328
|
+
return "跨境保税";
|
|
329
|
+
}
|
|
330
|
+
return "";
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function getDeliveryModeName(deliveryMode) {
|
|
334
|
+
if (deliveryMode == "0") {
|
|
335
|
+
return "快递";
|
|
336
|
+
} else if (deliveryMode == "1") {
|
|
337
|
+
return "自提";
|
|
338
|
+
} else if (deliveryMode == "2") {
|
|
339
|
+
return "快递和自提";
|
|
340
|
+
} else if (deliveryMode == "3") {
|
|
341
|
+
return "同上级";
|
|
342
|
+
}
|
|
343
|
+
return "";
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function getOrgModules(jMerchant) {
|
|
347
|
+
var result = "";
|
|
348
|
+
var org_modules = jMerchant.org_modules;
|
|
349
|
+
if (org_modules) {
|
|
350
|
+
for (var i = 0; i < org_modules.length; i++) {
|
|
351
|
+
var jModule = org_modules[i];
|
|
352
|
+
if (result != "") {
|
|
353
|
+
result += ";";
|
|
354
|
+
}
|
|
355
|
+
result += jModule.id;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return result;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function getDeliveryPriceTemplate(jMerchant) {
|
|
362
|
+
var result = "";
|
|
363
|
+
var delivery_price_template = jMerchant.delivery_price_template;
|
|
364
|
+
if (delivery_price_template) {
|
|
365
|
+
for (var i = 0; i < delivery_price_template.length; i++) {
|
|
366
|
+
var jModule = delivery_price_template[i];
|
|
367
|
+
if (result != "") {
|
|
368
|
+
result += ";";
|
|
369
|
+
}
|
|
370
|
+
result += jModule.id;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return result;
|
|
374
|
+
}
|
|
375
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"base_info": {
|
|
3
|
+
"#meta": {
|
|
4
|
+
"fieldLabel": "基本信息",
|
|
5
|
+
"showTitle": "yes",
|
|
6
|
+
"includeKey": "no",
|
|
7
|
+
"position": "card",
|
|
8
|
+
"span": 1
|
|
9
|
+
},
|
|
10
|
+
"id": "string(128),formSize:8,listSize:12,searchable:true,disabled:true;内部ID",
|
|
11
|
+
"name": "string(18),formSize:8,listSize:10,require:true;导出名称",
|
|
12
|
+
"file": "file,formSize:8,disabled:true;导出文件"
|
|
13
|
+
},
|
|
14
|
+
"search_info": {
|
|
15
|
+
"#meta": {
|
|
16
|
+
"fieldLabel": "搜索条件",
|
|
17
|
+
"includeKey": "no",
|
|
18
|
+
"position": "card",
|
|
19
|
+
"span": 2
|
|
20
|
+
},
|
|
21
|
+
"keyword": "string(18),formSize:4,listSize:10,require:true;关键字",
|
|
22
|
+
"parent_id": "string(16),formSize:2,searchable:true;上级Id",
|
|
23
|
+
"parent_name": "string(16),formSize:2,searchable:true;上级名称",
|
|
24
|
+
"orgType": "choice,listSize:6,values:all_所有/org_组织机构/merchant_商家,defaultValue:all,searchable:true,formSize:4;组织类型",
|
|
25
|
+
"merType": "choice,listSize:6,values:all_所有/com_普通商家/gp_集采商家/crossDirectMail_跨境直邮/crossBonded_跨境保税,defaultValue:all,searchable:true,formSize:4;商家类型",
|
|
26
|
+
"publishState": "choice,listSize:6,values:all_所有/0_不发布_#f48924/1_发布,defaultValue:all,searchable:true,formSize:4;发布状态",
|
|
27
|
+
"certifyState": "choice,listSize:6,values:all_所有/0_新增待审核_#037ef3/1_修改待审核_#037ef3/2_审核不通过_#ff4c4c/3_审核通过,defaultValue:all,searchable:true,formSize:4;审核状态",
|
|
28
|
+
"enableState": "choice,listSize:6,values:all_所有/Y_激活/N_冻结_red,defaultValue:all,searchable:true,formSize:4;冻结状态",
|
|
29
|
+
"deliveryMode": "choice,values:all_所有/0_快递/1_自提/2_快递和自提/3_同上级,defaultValue:all,formSize:4,searchable:true;配送方式",
|
|
30
|
+
"productCanBuyState": "choice,listSize:6,values:all_所有/0_不可以/1_可以,defaultValue:all,searchable:true,formSize:4;商品可否购买",
|
|
31
|
+
"canGiveIntegral": "choice,listSize:6,values:all_所有/0_不可以/1_可以,defaultValue:all,searchable:true,formSize:4;可否赠送积分",
|
|
32
|
+
"beginCreateTime": "date,formSize:2,listSize:9,require:true;创建开始时间",
|
|
33
|
+
"endCreateTime": "date,formSize:2,listSize:9,require:true;创建结束时间"
|
|
34
|
+
},
|
|
35
|
+
"other_info": {
|
|
36
|
+
"#meta": {
|
|
37
|
+
"fieldLabel": "其他信息",
|
|
38
|
+
"includeKey": "no",
|
|
39
|
+
"position": "card",
|
|
40
|
+
"span": 1
|
|
41
|
+
},
|
|
42
|
+
"owl_createTime": "date,formSize:8,disabled:true,listSize:9;操作时间",
|
|
43
|
+
"owl_createUserId": "string(18),formSize:8,listSize:8,disabled:true;操作人"
|
|
44
|
+
},
|
|
45
|
+
"msg_info": {
|
|
46
|
+
"#meta": {
|
|
47
|
+
"fieldLabel": "处理结果",
|
|
48
|
+
"includeKey": "no",
|
|
49
|
+
"position": "card"
|
|
50
|
+
},
|
|
51
|
+
"msg": "string(128),formSize:8,multiline:T,showList:false;处理结果"
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
"_t": "org_batch_export",
|
|
57
|
+
"#meta": {
|
|
58
|
+
"rem": "商家导出",
|
|
59
|
+
"projectName": "商家导出",
|
|
60
|
+
"parent": [
|
|
61
|
+
"platform"
|
|
62
|
+
],
|
|
63
|
+
"visitType": [
|
|
64
|
+
"platform"
|
|
65
|
+
],
|
|
66
|
+
"exLists": [
|
|
67
|
+
{
|
|
68
|
+
"name": "默认列表",
|
|
69
|
+
"code": "defaultList",
|
|
70
|
+
"buttons":{
|
|
71
|
+
"showAdd": true,
|
|
72
|
+
"showDel": false,
|
|
73
|
+
"showRecycle": false
|
|
74
|
+
},
|
|
75
|
+
"expandIconColumnIndex":1,
|
|
76
|
+
"list": ["id","name","owl_createTime","owl_createUserId"]
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"pos": 1,
|
|
80
|
+
"group": {
|
|
81
|
+
"id": "basicInfo",
|
|
82
|
+
"name": "基本信息",
|
|
83
|
+
"icon": "layout",
|
|
84
|
+
"pos": 1,
|
|
85
|
+
"level2": {
|
|
86
|
+
"id": "org_batch_update",
|
|
87
|
+
"name": "组织批量管理",
|
|
88
|
+
"icon": "outline",
|
|
89
|
+
"pos": 2
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"eventHandlers": [
|
|
93
|
+
{
|
|
94
|
+
"handlerId":"org_batch_export_eventHandlers_batchExport",
|
|
95
|
+
"pageId":"eventhandlers/batchExport.jsx",
|
|
96
|
+
"throwException":true,
|
|
97
|
+
"eventName": "org_batch_export_add_after",
|
|
98
|
+
"description":"新增后,自动执行"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
}
|
package/examples/models/owlsys/orgBatch/org_batch_import/api/src/eventhandlers/batchImport.jsx
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#import Util.js
|
|
2
|
+
//#import jobs.js
|
|
3
|
+
;
|
|
4
|
+
(function () {
|
|
5
|
+
var data = ctx.get("data");
|
|
6
|
+
|
|
7
|
+
var when = new Date().getTime();
|
|
8
|
+
var postData = {batchId: data.id};
|
|
9
|
+
JobsService.submitTask("owl_org_batch_import", "tasks/batchImport.jsx", postData, when);
|
|
10
|
+
})();
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//#import excel.js
|
|
2
|
+
//#import $owl_download_template:services/modelService.jsx
|
|
3
|
+
|
|
4
|
+
function main() {
|
|
5
|
+
var params = JSON.parse($body);
|
|
6
|
+
|
|
7
|
+
var id = "owl_download_template_org_batch_import_v2";
|
|
8
|
+
var jDownloadTemplate = owl_download_templateService.get(id);
|
|
9
|
+
var fileUrl = "";
|
|
10
|
+
if (!jDownloadTemplate) {
|
|
11
|
+
var index = 0;
|
|
12
|
+
var titles = [
|
|
13
|
+
{"index": index++, "columnWidth": "22", "field": "parentId", "title": "上级ID"},
|
|
14
|
+
{"index": index++, "columnWidth": "22", "field": "parentName", "title": "上级名称"},
|
|
15
|
+
{"index": index++, "columnWidth": "22", "field": "orgType", "title": "组织类型"},
|
|
16
|
+
{"index": index++, "columnWidth": "22", "field": "merType", "title": "商家类型"},
|
|
17
|
+
{"index": index++, "columnWidth": "22", "field": "name", "title": "商家名称"},
|
|
18
|
+
{"index": index++, "columnWidth": "22", "field": "name_en", "title": "英文名称"},
|
|
19
|
+
{"index": index++, "columnWidth": "22", "field": "regionName", "title": "所在地区"},
|
|
20
|
+
{"index": index++, "columnWidth": "22", "field": "contact", "title": "联系人"},
|
|
21
|
+
{"index": index++, "columnWidth": "22", "field": "mobile", "title": "联系手机"},
|
|
22
|
+
{"index": index++, "columnWidth": "22", "field": "phone", "title": "座机"},
|
|
23
|
+
{"index": index++, "columnWidth": "22", "field": "email", "title": "邮箱"},
|
|
24
|
+
{"index": index++, "columnWidth": "22", "field": "storeAddress", "title": "门店地址"},
|
|
25
|
+
{"index": index++, "columnWidth": "22", "field": "address", "title": "退货地址"},
|
|
26
|
+
{"index": index++, "columnWidth": "22", "field": "businessTime", "title": "开业时间"},
|
|
27
|
+
{"index": index++, "columnWidth": "22", "field": "openTime", "title": "营业时间"},
|
|
28
|
+
{"index": index++, "columnWidth": "22", "field": "shopAddress", "title": "店铺网址"},
|
|
29
|
+
{"index": index++, "columnWidth": "22", "field": "siteId", "title": "站点Id"},
|
|
30
|
+
{"index": index++, "columnWidth": "22", "field": "homePageId", "title": "移动端首页Id"},
|
|
31
|
+
{"index": index++, "columnWidth": "22", "field": "pcHomePageId", "title": "PC端首页Id"},
|
|
32
|
+
{"index": index++, "columnWidth": "40", "field": "kefuUrl", "title": "客服链接"},
|
|
33
|
+
{"index": index++, "columnWidth": "40", "field": "memo", "title": "备注"},
|
|
34
|
+
{"index": index++, "columnWidth": "40", "field": "deliveryMemo", "title": "配送备注"},
|
|
35
|
+
{"index": index++, "columnWidth": "22", "field": "deliveryMode", "title": "配送方式"},
|
|
36
|
+
{"index": index++, "columnWidth": "60", "field": "moduleIds", "title": "权限组织类型ID"},
|
|
37
|
+
{"index": index++, "columnWidth": "60", "field": "deliveryPriceTemplates", "title": "默认运费模板ID"},
|
|
38
|
+
{"index": index++, "columnWidth": "60", "field": "platformCategories", "title": "经营范围"},
|
|
39
|
+
{"index": index++, "columnWidth": "30", "field": "platformCategories", "title": "商家标签"}
|
|
40
|
+
];
|
|
41
|
+
var recordList = [
|
|
42
|
+
{
|
|
43
|
+
parentId:"owl_orgs_100001",
|
|
44
|
+
parentName:"武商梦时代",
|
|
45
|
+
orgType:"商家",
|
|
46
|
+
merType:"普通商家",
|
|
47
|
+
name:"商家A",
|
|
48
|
+
name_en:"",
|
|
49
|
+
regionName:"湖北省武汉市汉阳区",
|
|
50
|
+
moduleIds:"owl_org_modules_102;owl_org_modules_103",
|
|
51
|
+
deliveryPriceTemplates:"owl_delivery_price_template_210004;owl_delivery_price_template_250000",
|
|
52
|
+
platformCategories:"全部商品|食品酒水饮料;全部商品|进口食品;全部商品|数码家电",
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
var file_type_name = "批量导入商家模板";
|
|
57
|
+
|
|
58
|
+
fileUrl = Excel.createExcelList(file_type_name, titles, recordList);
|
|
59
|
+
|
|
60
|
+
jDownloadTemplate = {};
|
|
61
|
+
jDownloadTemplate.file_type_id = "org_batch_import";
|
|
62
|
+
jDownloadTemplate.file_type_name = file_type_name;
|
|
63
|
+
jDownloadTemplate.file = {url: fileUrl, name: file_type_name};
|
|
64
|
+
owl_download_templateService.add(jDownloadTemplate);
|
|
65
|
+
} else {
|
|
66
|
+
fileUrl = jDownloadTemplate.file.url;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var ret = {
|
|
70
|
+
state: 'ok',
|
|
71
|
+
action: 'navigate',
|
|
72
|
+
target: "_blank",
|
|
73
|
+
url: fileUrl
|
|
74
|
+
}
|
|
75
|
+
out.print(JSON.stringify(ret));
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
main();
|