def purchaseorderadd_fix(addgoods_fix, createwarehouse_fix, pucharseAgreement_fix): #先连接数据库,删除脏数据采购订单 #连接数据库,删除租户3701所有的采购订单 log.info("开始新增采购订单...") connect = DbConnect('online_saas') delete_sql = "delete from purchase_order where tenant_id = '3701'" connect.execute(delete_sql) res = PurchaseOrder().add_order(pucharseAgreement_fix) log.info("采购订单新增完成,采购订单协议号:%s" % res) return res
def purchaseorderadd_fix(addgoods_fix, createwarehouse_fix, pucharseAgreement_fix): #先连接数据库,删除脏数据(租户3701)采购订单 log.info("开始新增采购订单...") connect = DbConnect(host='10.0.34.104', user='******', password='******', database='online_saas') delete_sql = "delete from purchase_order where tenant_id = '3701'" connect.execute(delete_sql) res = PurchaseOrder().add_order(pucharseAgreement_fix) log.info("采购订单新增完成,采购订单协议号:%s" % res) return res
def purchasereceive_fix(purchaseorderadd_fix): #收货前先删除批次库存数据和库存流水 log.info("采购收货前先删除批次库存数据和库存流水") connect = DbConnect('online_saas') delete_inventory = "delete from inventory where tenant_id = '3701'" delete_inventory_flow = "delete from inventory_flow where tenant_id = '3701'" connect.execute(delete_inventory) connect.execute(delete_inventory_flow) connect.close() log.info("数据清理完毕...") log.info("开始收货,进入仓库中...") purchase_orderno = PurchaseReceive().savePurchaseReceive( purchaseorderadd_fix) return purchase_orderno
def pucharseAgreement_fix(ourCompany_fix, contactCompany_fix): #新增采购订单前,先新增本方公司,然后新增往来单位和采购协议 #连接数据库,删除租户3701所有的采购协议 log.info("新增采购订单前,先新增采购协议") connect = DbConnect('online_saas') delete_sql = "delete from purchase_agreement where tenant_id = '3701'" connect.execute(delete_sql) log.info("开始新增采购协议...") PurchaseAgreement().add_purchase() select_sql = "select agreement_no from purchase_agreement where tenant_id = '3701'" agreement_no = connect.select(select_sql) log.info("新增采购协议完成,采购协议号:%s" % agreement_no) connect.close() return agreement_no[0]['agreement_no']
def pucharseAgreement_fix(ourCompany_fix, contactCompany_fix): #新增采购订单前,先新增本方公司,然后新增往来单位和采购协议 #连接数据库,删除租户3701所有的采购协议 log.info("新增采购订单前,先新增采购协议") connect = DbConnect(host='10.0.34.104', user='******', password='******', database='online_saas') delete_sql = "delete from purchase_agreement where tenant_id = '3701'" connect.execute(delete_sql) log.info("开始新增采购协议...") PurchaseAgreement().add_purchase() select_sql = "select agreement_no from purchase_agreement where tenant_id = '3701'" agreement_no = connect.select(select_sql) log.info("新增采购协议完成,采购协议号:%s" % agreement_no) connect.close() return agreement_no[0]['agreement_no']
def purchasereceive_fix(purchaseorderadd_fix): #收货前先删除批次库存数据和库存流水 log.info("采购收货前先删除批次库存数据和库存流水") connect = DbConnect(host='10.0.34.104', user='******', password='******', database='online_saas') delete_inventory = "delete from inventory where tenant_id = '3701'" delete_inventory_flow = "delete from inventory_flow where tenant_id = '3701'" connect.execute(delete_inventory) connect.execute(delete_inventory_flow) log.info("数据清理完毕...") log.info("开始收货,进入仓库中...") # 根据采购订单号,从采购订单明细表中获取订单明细id select_sql = "select id from purchase_order_detail where purchase_order_no = " + "'" + purchaseorderadd_fix[ 'orderNo'] + "'" purchase_detail_id = connect.select(select_sql) purchase_info = [] purchase_info.append(purchaseorderadd_fix) purchase_info.append(purchase_detail_id) purchase_orderno = PurchaseReceive().savePurchaseReceive(purchase_info) connect.close() return purchase_orderno
def del_image(): '''新增图片前先删除''' db = DbConnect('djangoweb') delete_sql = "DELETE FROM hello_fileimage WHERE title = 'file_image_001'" db.execute(delete_sql) db.close()
def del_before_login(): '''新增老师前先删除数据''' db = DbConnect('djangoweb') delete_sql = "DELETE FROM hello_teacher WHERE teacher_name = 'yoyo002'" db.execute(delete_sql) db.close()
def do_register_del(): connect = DbConnect('apps') delete_sql = "delete from auth_user where username = '******'" connect.execute(delete_sql) connect.close()