api-datamanager/Company/CompanyUtils.py

32 lines
868 B
Python

from DBHelper.MongoHelperInstance import DB_TEST
from Utils.CommonUtil import CommonUtils
class CompanyUtils(object):
@staticmethod
def make_new_cid():
new_cid = CommonUtils.random_code(8)
case = DB_TEST.find_single_column(
"WR_DataBase_v2_test",
"C3.1_工商信息",
{"企业ID": new_cid},
"企业ID"
) is not None
while case:
new_cid = CommonUtils.random_code(8)
return new_cid
@staticmethod
def make_new_change_id():
new_cid = CommonUtils.random_code(8)
case = DB_TEST.find_single_column(
"WR_DataBase_v2_test",
"C3.6_工商变更",
{"变更ID": new_cid},
"变更ID"
) is not None
while case:
new_cid = CommonUtils.random_code(8)
return new_cid