sql="UPDATE mcms_dept_goods_info SET coding_type = 0 WHERE branch_id=%s;"
cursor.execute(sql,(branch_id))
sql="UPDATE mcms_dept_goods_info SET coding_type = 0 WHERE branch_id=%s;"
cursor.execute(sql,(branch_id))
db.commit()
cursor.close()
db.close()
defget_id(sql):
db,cursor=get_sql_conn()
cursor.execute(sql)
...
...
@@ -187,11 +215,43 @@ def get_id(sql):
new_str1=new_str1.replace("'",'')
# print(new_str1)
cursor.close()
db.close()
returnnew_str1
defget_DRId(branch_id,type):
db,cursor=get_sql_conn()
cursor.execute(
"select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_LYTK' order by CREATE_TIME desc LIMIT 1;"%(branch_id,type))
results=cursor.fetchone()
str1=str(results)
new_str1=str1.replace(',)','')
new_str1=new_str1.replace('(','')
new_str1=new_str1.replace(',','')
new_str1=new_str1.replace("'",'')
# print(new_str1)
cursor.close()
db.close()
returnnew_str1
defget_DN_no(branch_id,type):
DR_id=get_DRId(branch_id,type)
db,cursor=get_sql_conn()
cursor.execute(
"select order_no from mcms_psi_dept where id='%s';"%(
DR_id))
results=cursor.fetchone()
str1=str(results)
new_str1=str1.replace(',)','')
new_str1=new_str1.replace('(','')
new_str1=new_str1.replace(',','')
new_str1=new_str1.replace("'",'')
# print(new_str1)
cursor.close()
db.close()
returnnew_str1
defget_login_user_uxid_bydb(username):
db,cursor=get_sql_conn()
cursor.execute("select id from sys_user where user_code='%s'"%username)
cursor.execute("select id from sys_user where user_code='%s'"%username)