Browse Source

批量处理脚本

warrior 4 months ago
parent
commit
2a7b214459
2 changed files with 155 additions and 437 deletions
  1. 142 429
      projects/textbook/src/services/importDept.ts
  2. 13 8
      projects/textbook/src/services/shell.ts

+ 142 - 429
projects/textbook/src/services/importDept.ts

@@ -2378,434 +2378,147 @@ export const updateDept = {
   ],
   /* 变更教材字段 */
   list5: [
-    { code: '202409224653', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409266267', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409115131', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409149523', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409205027', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409063485', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409292034371177', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409124888', isbn: '暂无', type: '暂无' },
-    { code: '202409268287', isbn: '暂无', type: '暂无' },
-    { code: '202409261538', isbn: '暂无', type: '暂无' },
-    {
-      code: '202409246487',
-      isbn: '9787040493955',
-      type: '纸质教材附带数字资源',
-    },
-    { code: '202409124146', isbn: '9787117244381', type: '暂无' },
-    { code: '202409207176', isbn: '9787030641298', type: '暂无' },
-    { code: '202409235336', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202408261235', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409190406', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409159978', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409244482', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409245844', isbn: '9787040510898', type: '数字教材' },
-    {
-      code: '202408216936',
-      isbn: '9787040557602',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409238085',
-      isbn: '9787040224658',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409292034371177',
-      isbn: '9787040523775',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202408304676',
-      isbn: '9787040493863',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409033218',
-      isbn: '9787040557794',
-      type: '纸质教材附带数字资源',
-    },
-    { code: '202409192757', isbn: '9787040417807', type: '纸质教材' },
-    {
-      code: '202409159317',
-      isbn: '9787040582369',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409089337',
-      isbn: '9787040607734',
-      type: ' 纸质教材附带数字资源',
-    },
-    {
-      code: '202409141282',
-      isbn: '9787040505016',
-      type: ' 纸质教材附带数字资源',
-    },
-    {
-      code: '202409152604',
-      isbn: '9787040515442',
-      type: ' 纸质教材附带数字资源',
-    },
-    {
-      code: '202409211129',
-      isbn: '9787040426878',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409262836',
-      isbn: '9787040589658',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409063819',
-      isbn: '9787040613810',
-      type: '纸质教材附带数字资源',
-    },
-    { code: '202408292886', isbn: '9787040557763', type: '暂无' },
-    {
-      code: '202409242974',
-      isbn: '9787040621181',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409245812',
-      isbn: '9787040580778',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409209758',
-      isbn: '9787040560718',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409039037',
-      isbn: '9787040550634',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409219794',
-      isbn: '9787040559545',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409213858',
-      isbn: '9787040564747',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409260203',
-      isbn: '9787040505030',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202408200053',
-      isbn: '9787040617351',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409166899',
-      isbn: '9787040553987',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409201263',
-      isbn: '9787040552652',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409243035',
-      isbn: '9787040551136',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409262205',
-      isbn: '9787040527209',
-      type: '纸质教材附带数字资源',
-    },
-    { code: '202409228349', isbn: '9787040526899', type: '暂无' },
-    {
-      code: '202409228349',
-      isbn: '9787040526899',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409226815',
-      isbn: '9787040545203',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409245067',
-      isbn: '9787040614985',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409197602',
-      isbn: '9787040589801',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409143795',
-      isbn: '9787040536225',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409015703',
-      isbn: '9787040536171',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409148003',
-      isbn: '9787040470321',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409220264',
-      isbn: '9787040630169',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409118312',
-      isbn: '9787040589610',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409135741',
-      isbn: '9787040564136',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409162481',
-      isbn: '9787040509694',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409189097',
-      isbn: '9787040523553',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409130769',
-      isbn: '9787040619331',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409146883',
-      isbn: '9787040536560',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409199275',
-      isbn: '9787040565768',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409256301',
-      isbn: '9787040599701',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409227676',
-      isbn: '9787040586947',
-      type: '纸质教材附带数字资源',
-    },
-    { code: '202409190935', isbn: '9787040534078', type: '暂无' },
-    {
-      code: '202409255037',
-      isbn: '9787040602432',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409224653',
-      isbn: '9787040586657',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409063504',
-      isbn: '9787040514612',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409200983',
-      isbn: '9787040512342',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409134421',
-      isbn: '9787040597875',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409246894',
-      isbn: '9787040528909',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409267335',
-      isbn: '9787040563160',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409078624',
-      isbn: '9787040590418',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409253366',
-      isbn: '9787040565539',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202408300754',
-      isbn: '9787040490367',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409106924',
-      isbn: '9787040525212',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409223133',
-      isbn: '9787040441895',
-      type: '纸质教材附带数字资源',
-    },
-    { code: '202409258725', isbn: '9787040318845', type: '暂无' },
-    {
-      code: '202409118485',
-      isbn: '9787040553048',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409246582',
-      isbn: '9787040509359',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409169236',
-      isbn: '9787040574463',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409110179',
-      isbn: '9787040560862',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409182796',
-      isbn: '9787040553369',
-      type: '纸质教材附带数字资源',
-    },
-    { code: '202409022555', isbn: '9787040621792', type: '暂无' },
-    {
-      code: '202409232805',
-      isbn: '9787040619300',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202408261001',
-      isbn: '9787040597233',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409290558203802',
-      isbn: '9787040610932',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409053116',
-      isbn: '9787040585520',
-      type: '纸质教材附带数字资源',
-    },
-    { code: '202409188708', isbn: '9787895309227', type: '数字教材' },
-    {
-      code: '202409206181',
-      isbn: '9787040600469',
-      type: '纸质教材附带数字资源',
-    },
-    { code: '20240927215519', isbn: '9787040296495', type: '纸质教材' },
-    {
-      code: '202409037782',
-      isbn: '9787040580792',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409134537',
-      isbn: '9787040544145',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409256645',
-      isbn: '9787040589924',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409264669',
-      isbn: '9787040516913',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409265768',
-      isbn: '9787040589887',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409101405',
-      isbn: '9787040604351',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409040584',
-      isbn: '9787040572032',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409270926111949',
-      isbn: '9787040597165',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409129924',
-      isbn: '9787040623284',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409262605',
-      isbn: '9787040623277',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202408216484',
-      isbn: '9787040548723',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409246862',
-      isbn: '9787040530056',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202408242404',
-      isbn: '9787040607451',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202408186341',
-      isbn: '9787040562545',
-      type: '纸质教材附带数字资源',
-    },
-    {
-      code: '202409180472',
-      isbn: '9787040526967',
-      type: '纸质教材附带数字资源',
-    },
-    { code: '202409111879', isbn: '9787568941006', type: ' 暂无' },
-    { code: '202408295022', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202408286509', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409028937', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409271142350245', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409266523', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202408315305', isbn: '暂无', type: '纸质教材附带数字资源' },
-    { code: '202409174125', isbn: '暂无', type: '纸质教材附带数字资源' },
+    { code: '202408133685a', title: '水力学(上下册)第3版' },
+    { code: '202408133685b', title: '教育科学研究方法(第二版)' },
+    { code: '202408288315a', title: '商务统计与软件应用' },
+    { code: '202408288315b', title: '罪犯教育学' },
+    { code: '202409026056a', title: '大学生心理健康(第2版)' },
+    { code: '202409026056b', title: '电机与电力拖动' },
+    {
+      code: '202409052834a',
+      title: 'Visual C++面向对象程序设计教程与实验(第3版)',
+    },
+    { code: '202409052834b', title: '斜视弱视学' },
+    { code: '202409063819a', title: '市场调查理论与方法(第二版)' },
+    { code: '202409063819b', title: '大数据导论' },
+    { code: '202409108033a', title: '土木工程合同管理(第5版)' },
+    { code: '202409108033b', title: '流域水文学' },
+    { code: '202409122753a', title: '计算机网络' },
+    { code: '202409122753b', title: '外贸英文制单' },
+    { code: '202409130575a', title: '金融数学(第8版)' },
+    { code: '202409130575b', title: '保险法(第六版)' },
+    { code: '202409133805a', title: '社会学概论新修(第五版)' },
+    { code: '202409133805b', title: '世界经济史(第五版)' },
+    { code: '202409134993a', title: '高等数学 上册、高等数学 下册' },
+    { code: '202409134993b', title: '热制造学引论(第4版)' },
+    { code: '202409135741a', title: '环境规划学(第三版)' },
+    { code: '202409135741b', title: '农业经济学(第五版)' },
+    { code: '202409136674a', title: '数字信号处理原理及实现(第4版)' },
+    { code: '202409136674b', title: '经济法(第七版)' },
+    { code: '202409141335a', title: '有机化学(上册)' },
+    { code: '202409141335b', title: '化工热力学(第二版)' },
+    { code: '202409141501a', title: '大学物理学(第二版)' },
+    { code: '202409141501b', title: '风险管理(第六版)' },
+    { code: '202409143827a', title: '电子商务安全(第2版)' },
+    { code: '202409143827b', title: '家畜育种学(第二版)' },
+    { code: '202409146845a', title: 'GMDSS通信设备与业务(第3版)' },
+    { code: '202409146845b', title: '数学物理方法' },
+    { code: '202409149431a', title: '误差理论与数据处理(第二版)' },
+    { code: '202409149431b', title: '组织学与胚胎学(第四版)' },
+    { code: '202409160775a', title: '《管理学(微课版)》' },
+    { code: '202409160775b', title: '纺织品检验学(第3版)' },
+    { code: '202409162352a', title: '线性代数(第三版)' },
+    { code: '202409162352b', title: '遗传学' },
+    { code: '202409180585a', title: '通信电子电路(微课版)' },
+    { code: '202409180585b', title: '运筹学(第四版)' },
+    { code: '202409182502a', title: '林木病理学(第4版)' },
+    { code: '202409182502b', title: '大学物理学(上、下册)' },
+    { code: '202409183725a', title: 'Web程序设计(第5版)' },
+    { code: '202409183725b', title: '模拟法庭实验教程(第四版)' },
+    { code: '202409185731a', title: ' 建设法规' },
+    { code: '202409185731b', title: '物联网技术及应用 (第2版)' },
+    { code: '202409189166a', title: '流体力学(第5版)' },
+    { code: '202409189166b', title: '电机学' },
+    { code: '202409190694a', title: '植物学(第3版)' },
+    { code: '202409190694b', title: '恢复生态学' },
+    { code: '202409190961a', title: '大学语文' },
+    { code: '202409190961b', title: '电气控制与PLC应用(微课版)' },
+    { code: '202409191009a', title: '现代教育技术' },
+    { code: '202409191009b', title: '运动训练学(第二版)' },
+    { code: '202409192833a', title: '现代航空动力装置控制(第3版)' },
+    { code: '202409192833b', title: '中国历史地理(第三版)' },
+    { code: '202409193598a', title: '医院管理学' },
+    { code: '202409193598b', title: '行政法学' },
+    { code: '202409198297a', title: '人文地理学及野外实习教程' },
+    { code: '202409198297b', title: '运动心理学(第2版)' },
+    { code: '202409201233a', title: '道路工程材料(第3版)' },
+    { code: '202409201233b', title: '法律思维与法学经典阅读(第二版)' },
+    { code: '202409203989a', title: '《管理沟通》第四版' },
+    { code: '202409203989b', title: '编译方法、技术与实践' },
+    { code: '202409205445a', title: '智能产品设计' },
+    { code: '202409205445b', title: '预防医学(第4版)' },
+    { code: '202409205898a', title: '跨境电子商务' },
+    { code: '202409205898b', title: '新编阿拉伯语(1-6)' },
+    { code: '202409208474a', title: '健康教育学' },
+    { code: '202409208474b', title: '商事仲裁法学(第二版)' },
+    { code: '202409208629a', title: '综合地质学' },
+    { code: '202409208629b', title: '工程学导论(第二版)' },
+    {
+      code: '202409208697a',
+      title: '控制系统分析与设计--过程控制系统(第2版)',
+    },
+    { code: '202409208697b', title: '环境土壤学(第三版)' },
+    { code: '202409209803a', title: '建筑节能(第四版)' },
+    { code: '202409209803b', title: '嵌入式系统原理与设计(第2版)' },
+    { code: '202409215276a', title: '工程制图基础' },
+    { code: '202409215276b', title: '城乡规划GIS实践教程' },
+    { code: '202409215402a', title: '土力学简明教程' },
+    { code: '202409215402b', title: '教师专业发展' },
+    { code: '202409216236a', title: '环境监测课程设计与实践' },
+    { code: '202409216236b', title: '中国特色社会主义在浙江的实践(第四版)' },
+    { code: '202409218986a', title: '自动检测技术与装置(第三版)' },
+    { code: '202409218986b', title: '《女装结构设计与纸样》(第四版)' },
+    { code: '202409221043a', title: '信息检索(第三版)' },
+    { code: '202409221043b', title: '市场营销:理论、工具与方法' },
+    { code: '202409230755a', title: '机器人学建模、控制与视觉(第2版)' },
+    { code: '202409230755b', title: '建筑结构抗震设计' },
+    { code: '202409231067a', title: '地图数据采集' },
+    { code: '202409231067b', title: '土壤肥料学(第三版)' },
+    { code: '202409233254a', title: 'MATLAB在电气工程中的应用' },
+    { code: '202409233254b', title: '《现代公共关系学 (第二版)》' },
+    { code: '202409234497a', title: '材料成形装备及自动化(第3版)' },
+    { code: '202409234497b', title: '工程测量学(第三版)' },
+    { code: '202409236366a', title: '高电压工程(第四版)' },
+    { code: '202409236366b', title: '数字电子技术基础(第三版)' },
+    { code: '202409236513a', title: '国际贸易实务(第七版)' },
+    { code: '202409236513b', title: '乌尔都语讲中国文化' },
+    { code: '202409236522a', title: '碳中和建筑信息模型' },
+    { code: '202409236522b', title: '现代机械工程图学教程(第四版)' },
+    { code: '202409236657a', title: '钢结构设计原理(第4版)' },
+    { code: '202409236657b', title: '材料物理' },
+    { code: '202409237363a', title: '当代教育学(第5版)' },
+    { code: '202409237363b', title: '给水工程(第五版)' },
+    { code: '202409237399a', title: '城市轨道交通运营管理' },
+    { code: '202409237399b', title: '汽轮机原理' },
+    { code: '202409238937a', title: '新编思想政治教育学原理(第二版)' },
+    { code: '202409238937b', title: '应用统计学(第3版)' },
+    { code: '202409241908a', title: '光电技术(第2版)' },
+    { code: '202409241908b', title: '韩中口译技巧与实践' },
+    { code: '202409243874a', title: '机电传动控制(第六版)' },
+    { code: '202409243874b', title: '机械系统设计(第三版)' },
+    { code: '202409248834a', title: ' 数据结构(C语言版)(第3版)' },
+    { code: '202409248834b', title: '小学数学课程标准与教材研究' },
+    { code: '202409252036a', title: '智能制造业新模式新业态' },
+    { code: '202409252036b', title: '材料力学(第2版)' },
+    { code: '202409256258a', title: '食品营养学' },
+    { code: '202409256258b', title: '房屋建筑学' },
+    { code: '202409261035a', title: '中药药理学(第五版)' },
+    { code: '202409261035b', title: '概率论与数理统计' },
+    { code: '202409262885a', title: '《循环系统疾病》' },
+    { code: '202409262885b', title: 'Python语言程序设计(微课版)' },
+    { code: '202409264089a', title: '化工设备机械基础' },
+    { code: '202409264089b', title: '普通高校军事理论与军事技能教程' },
+    { code: '202409264566a', title: 'Seismic Design of Building Structures' },
+    { code: '202409264566b', title: '数值分析' },
+    { code: '202409266864a', title: '纪录片创作教程(第2版)' },
+    { code: '202409266864b', title: '肿瘤放射治疗学(第4版)' },
+    { code: '202409267626a', title: '电机学(第三版)' },
+    { code: '202409267626b', title: '中国税收(第十版)' },
+    { code: '202409268235a', title: '中医学基础(新世纪第五版)' },
+    { code: '202409268235b', title: 'SPSS统计分析实用教程(第3版)' },
+    { code: '202409268644a', title: '企业管理—原理.方法.绿色实践' },
+    { code: '202409268644b', title: '装配式建筑工程计量与计价' },
+    { code: '202409268853a', title: '农业气象学(第3版)' },
+    { code: '202409268853b', title: ' 动物营养学(第四版)' },
   ],
 };

+ 13 - 8
projects/textbook/src/services/shell.ts

@@ -645,20 +645,25 @@ export class shellServer {
     let list = updateDept.list5
     for (let index = 0; index < list.length; index++) {
       const item = list[index];
+      let oldc=item.code.substring(0,item.code.length-1)
+      console.log(oldc);
       let query = new Parse.Query('EduTextbook')
-      query.equalTo('code',item.code)
+      query.equalTo('code',oldc)
+      query.equalTo('title',item.title)
       query.notEqualTo('isDeleted',true)
-      query.include('childrens')
-      query.select('childrens')
+      // query.include('childrens')
+      // query.select('childrens')
       let r = await query.find()
-      if(r.length <1 || r.length > 1 || r[0]?.get('childrens').length > 1){
+      // if(r.length <1 || r.length > 1 || r[0]?.get('childrens').length > 1){
+      if(r.length !== 1){
         arr.push(item.code)
         continue
       }
-      let eduTextbookVolume = r[0]?.get('childrens')[0]
-      item.type.trim() != '暂无' && eduTextbookVolume?.set('carrierShape',item.type.trim())
-      item.isbn.trim() != '暂无' && eduTextbookVolume?.set('ISBN',item.isbn.trim())
-      await eduTextbookVolume?.save()
+      // let eduTextbookVolume = r[0]?.get('childrens')[0]
+      // item.type.trim() != '暂无' && eduTextbookVolume?.set('carrierShape',item.type.trim())
+      // item.isbn.trim() != '暂无' && eduTextbookVolume?.set('ISBN',item.isbn.trim())
+      // await eduTextbookVolume?.save()
+      r[0]?.set('code',item.code)
       r[0]?.set('exportPDF',null)
       await r[0]?.save()
       console.log('update=>',item);