lesscode-tag 0.0.17__tar.gz → 0.0.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lesscode_tag
3
- Version: 0.0.17
3
+ Version: 0.0.18
4
4
  Summary: lesscode_tag是标签处理工具包
5
5
  Author: Chao.yy
6
6
  Author-email: yuyc@ishangqi.com
@@ -176,3 +176,67 @@ def format_special_tag_list(special_tag_list=None):
176
176
  else:
177
177
  bool_should_list.append(get_single_tag_condition(special_tag))
178
178
  return {"bool": {"should": bool_should_list}}
179
+
180
+
181
+ def format_ck_param_tag(bool_should_more_list, especial_tag_list):
182
+ bool_should_list = {"relation": "or", "value": []}
183
+ if especial_tag_list is not None:
184
+ for tag in especial_tag_list:
185
+ if tag in ["已上市", "新三板挂牌"]:
186
+ market_tag = {
187
+ "已上市": 1,
188
+ "新三板挂牌": 2
189
+ }
190
+ bool_should_list["value"].append({
191
+ "relation": "has",
192
+ "column": "market_tag.status",
193
+ "value": market_tag[tag]
194
+ })
195
+
196
+ if tag in ["国家级专精特新企业", "高新技术企业", "技术实力", "省级单项冠军企业", "国家级单项冠军企业",
197
+ "龙头企业", "中国企业500强", "中国民营企业500强", "中国独角兽企业", "全球独角兽企业", "央企"]:
198
+ diy_tag = {
199
+ "国家级专精特新企业": 8,
200
+ "高新技术企业": 4,
201
+ "技术实力": 7,
202
+ "省级单项冠军企业": 11,
203
+ "国家级单项冠军企业": 13,
204
+ "龙头企业": 9,
205
+ "中国企业500强": 17,
206
+ "中国民营企业500强": 14,
207
+ "中国独角兽企业": 16,
208
+ "全球独角兽企业": 15,
209
+ "央企": 18,
210
+ }
211
+ bool_should_list["value"].append({
212
+ "relation": "has",
213
+ "column": "diy_tag_id",
214
+ "value": diy_tag[tag]
215
+ })
216
+ if tag == "省级专精特新企业":
217
+ bool_should_list["value"].append({
218
+ "relation": "and",
219
+ "value": [{"relation": "has", "column": "diy_tag_id", "value": 3},
220
+ {"relation": "not",
221
+ "value": [
222
+ {"relation": "has", "column": "diy_tag_id", "value": 8}]}]
223
+ })
224
+ if tag == "科技型中小企业":
225
+ bool_should_list["value"].append({
226
+ "relation": "has",
227
+ "column": "certification.name_id",
228
+ "value": 3
229
+ })
230
+ if tag in ["民营", "外资"]:
231
+ capital_type = {
232
+ "民营": 2,
233
+ "外资": 6
234
+ }
235
+ bool_should_list["value"].append({
236
+ "relation": "eq",
237
+ "column": "capital_type",
238
+ "value": capital_type[tag]
239
+ })
240
+
241
+ bool_should_more_list.append(bool_should_list)
242
+ return bool_should_more_list
@@ -0,0 +1 @@
1
+ __version__ = "0.0.18"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lesscode-tag
3
- Version: 0.0.17
3
+ Version: 0.0.18
4
4
  Summary: lesscode_tag是标签处理工具包
5
5
  Author: Chao.yy
6
6
  Author-email: yuyc@ishangqi.com
@@ -1 +0,0 @@
1
- __version__ = "0.0.17"
File without changes
File without changes
File without changes