def save_data(self, datas): """保存数据""" # 保存基础数据 OcopDB().save_ocop_base_data( {"lqnf": self.lqnf, "sydsfmc": self.sydsfmc, "klmc": self.klmc, "wldz": self.url}) # 保存明细数据 OcopDB().save_ocop_detail_data(datas)
def is_exist(self): """判断数据知否存在""" # 判断基础数据是否存在 base_count = OcopDB().get_ocop_base_count(self.sydsfmc, self.lqnf, self.klmc) detail_count = OcopDB().get_ocop_detail_count(self.sydsfmc, self.lqnf, self.klmc) logger.info("base_count---->%s" % base_count) logger.info("detail_count---->%s" % detail_count) if base_count == 0 and detail_count == 0: return False return True