def release_labor_demand(userid=199122): con, curs = basic_cit_01() try: sql = [ ''' delete from XDW_APP.dd_contract_item o where o.contract_ukid in (select t.contract_ukid from XDW_APP.dd_contract t where t.create_user_id='%s' )''' % userid, '''delete from XDW_APP.RU_LABOUR_LOG m where m.create_user_id='%s' ''' % userid, '''delete from XDW_APP.dd_unit_price n where n.create_user_id='%s' ''' % userid, '''delete from XDW_APP.rs_labour_publish k where k.create_user_id='%s' ''' % userid, '''update XDW_APP.dd_contract x set x.contract_status=10 where x.create_user_id='%s' ''' % userid, '''update XDW_APP.ts_operation y set y.status=0 where y.create_user_id='%s' ''' % userid, '''update XDW_APP.MS_CARD z set z.status=0 where z.receiver_id='%s' ''' % userid ] for sql1 in sql: curs.execute(sql1) con.commit() close_oracle(con, curs) except Exception as e: print(e) close_oracle(con, curs) print("数据恢复成功!!!")
def release_transport_supply(userid=199161): try: con, curs = basic_cit_01() sql = [ ''' delete from XDW_APP.dd_contract_item o where o.contract_ukid in (select t.contract_ukid from XDW_APP.dd_contract t where t.create_user_id='%s' )''' % userid, '''delete from XDW_APP.RS_TRANSPORT_PUBLISH m where m.create_user_id='%s' ''' % userid, '''delete from XDW_APP.dd_unit_price n where n.create_user_id='%s' ''' % userid, '''delete from XDW_APP.ru_transport_supply_log k where k.create_user_id='%s' ''' % userid, '''update XDW_APP.dd_contract x set x.contract_status=10 where x.create_user_id='%s' ''' % userid, '''update XDW_APP.ts_operation y set y.status=0 where y.create_user_id='%s' ''' % userid, '''update XDW_APP.MS_CARD z set z.status=0 where z.receiver_id='%s' ''' % userid ] for sql1 in sql: curs.execute(sql1) con.commit() close_oracle(con, curs) except Exception as e: print(e) print("数据恢复成功!!!")
def restore_picking(): try: con, curs = basic_cit_01() sql = [ '''UPDATE TS_OPERATION SET STATUS = 0 WHERE OPERATION_UKID = 51763800000008024''', '''UPDATE TS_STOCK_TASK_DETAIL SET TASK_DETAIL_STATUS = 0 ACTUAL_OPERATION_QTY = NULL ACTUAL_START_INFO = NULL ACTUAL_END_INFO = NULL WHERE TASK_UKID = 892374982''', '''UPDATE MS_CARD SET STATUS = 0 WHERE CARD_UKID = 11730000000087300''', '''UPDATE CM_PARTICIPANT_RELATION SET RELATION_STATUS = 20 WHERE RELATION_SN = 51759100080219001''' ] for sql1 in sql: curs.execute(sql1) con.commit() close_oracle(con, curs) except Exception as e: print(e) print("拣选数据恢复成功!!!")
def release_import_inventory(): con, curs = basic_cit_01() try: sql = [ ''' UPDATE XDW_APP.TS_OPERATION SET STATUS = 0, ACT_START_TIME = NULL, ACT_END_TIME = NULL WHERE OPERATION_UKID = 51766200780012166''', ''' UPDATE XDW_APP.MS_CARD SET STATUS = 0 WHERE CARD_UKID = 51761200980144011''', ''' DELETE FROM XDW_APP.RU_INVENTORY_LOG WHERE OPERATION_UKID = 51766200780012166 ''', ''' UPDATE XDW_APP.CM_PARTICIPANT_RELATION SET RELATION_STATUS = 20 WHERE RELATION_SN IN (51761700980144023, 51766200989012167)''' ] for sql1 in sql: curs.execute(sql1) con.commit() close_oracle(con, curs) except Exception as e: print("导入库位库存数据失败") close_oracle(con, curs) print("导入库位库存数据成功")
def restore_sorting(): try: con, curs = basic_cit_01() sql = [ '''update xdw_app.ts_operation t set t.status = 0 where t.operation_ukid = 51763400000008016 and t.status in(5,10)''', '''update xdw_app.ts_stock_task_detail b set b.actual_start_info=NULL b.actual_end_info = NULL b.task_detail_status=0 where b.task_ukid=51763400000008016''', '''update xdw_app.ms_card tk set tk.status=0 where tk.card_ukid = 51763300000008018''' ] for sql1 in sql: curs.execute(sql1) con.commit() close_oracle(curs, con) except Exception as e: print(e) print("分拣数据恢复成功!!!")
def select_import_inventory(): con, curs = basic_cit_01() try: w = [] s = [10, 10] sql = ['''select m.status from xdw_app.ts_operation m where m.operation_ukid=51766200780012166''', ''' select n.status from xdw_app.ms_card n where n. CARD_UKID = 51761200980144011'''] for sql1 in sql: curs.execute(sql1) res1 = curs.fetchone() w.append(res1) assert w == s close_oracle(con, curs) except Exception as e: print(e) close_oracle(con, curs) print("导入库位库存数据验证成功!!!")
def release_storage_supply(): con, curs = basic_cit_01() try: sql = [ '''delete from XDW_APP.dd_contract_item o where o.contract_ukid=51767000000160018''', '''update XDW_APP.dd_contract x set x.contract_status=10 where x.contract_ukid=51767000000160018''', '''update XDW_APP.ts_operation y set y.status=0 where y.operation_ukid=11342455101230011 ''', '''update XDW_APP.MS_CARD z set z.status=0 where z.operation_ukid=11342455101230011''', '''update xdw_app.cm_participant_relation kl set kl.RELATION_STATUS=20 where kl.related_ukid=11712400012112101''' ] for sql1 in sql: curs.execute(sql1) con.commit() close_oracle(con, curs) except Exception as e: print(e) print("发布仓储供应数据恢复失败!!!") close_oracle(con, curs) print("发布仓储供应数据恢复成功!!!")
def select_labor_demand(): con, curs = basic_cit_01() try: w = [] s = [20, 10, 10] sql = ['''select t.contract_status from xdw_app.dd_contract t where t.contract_ukid=51761700000025063''', '''select m.status from xdw_app.ts_operation m where m.operation_ukid=51761600000025102''', ''' select n.status from xdw_app.ms_card n where n.operation_ukid=51761600000025102'''] for sql1 in sql: curs.execute(sql1) res1 = curs.fetchone() w.append(res1) assert w == s close_oracle(con, curs) except Exception as e: print (e) close_oracle(con, curs) print ("发布劳务需求数据验证成功!!!")
def release_transport_supply(): con, curs = basic_cit_01() try: sql = [ '''delete from XDW_APP.dd_unit_price n where n.contract_ukid=51756800000008078 ''', '''delete from XDW_APP.ru_transport_supply_log k where k.contract_ukid=51756800000008078 ''', '''update XDW_APP.dd_contract x set x.contract_status=10 where x.contract_ukid=51756800000008078 ''', '''update XDW_APP.ts_operation y set y.status=0 where y.operation_ukid=51756200000008117 ''', '''update XDW_APP.MS_CARD z set z.status=0 where z.operation_ukid=51756200000008117''', '''update xdw_app.cm_participant_relation kl set kl.RELATION_STATUS=20 where kl.related_ukid=43156800000008456''' ] for sql1 in sql: curs.execute(sql1) con.commit() close_oracle(con, curs) except Exception as e: print(e) print("发布运输供应数据恢复失败!!!") close_oracle(con, curs) print("发布运输供应数据恢复成功!!!")
def select_transport_supply(): con, curs = basic_cit_01() try: w = [] s = [20, 10, 10] sql = [ '''select t.contract_status from xdw_app.dd_contract t where t.contract_ukid=51756800000008078''', '''select m.status from xdw_app.ts_operation m where m.operation_ukid=51756200000008117''', ''' select n.status from xdw_app.ms_card n where n.operation_ukid=51756200000008117''' ] for sql1 in sql: curs.execute(sql1) res1 = curs.fetchone() w.append(res1) assert w == s close_oracle(con, curs) except Exception as e: print(e) close_oracle(con, curs) print("发布运输供应数据验证成功!!!")
def release_labor_demand(): con, curs = basic_cit_01() try: sql = [ '''delete from XDW_APP.dd_contract_item o where o.contract_ukid=51761700000025063''', '''delete from XDW_APP.RU_LABOUR_LOG m where m.contract_ukid=51761700000025063''', '''delete from XDW_APP.dd_unit_price n where n.contract_ukid=51761700000025063''', '''delete from XDW_APP.rs_labour_publish p where p.create_user_id=199216''', '''update XDW_APP.dd_contract x set x.contract_status=10 where x.contract_ukid=51761700000025063 ''', '''update XDW_APP.ts_operation y set y.status=0 where y.operation_ukid=51761600000025102 ''', '''update XDW_APP.MS_CARD z set z.status=0 where z.operation_ukid=51761600000025102''', '''update xdw_app.cm_participant_relation kl set kl.RELATION_STATUS=20 where kl.related_ukid=51761400000025085''' ] for sql1 in sql: curs.execute(sql1) con.commit() close_oracle(con, curs) except Exception as e: print(e) print("发布劳务需求数据恢复失败!!!") close_oracle(con, curs) print("发布劳务需求数据恢复成功!!!")