|
@@ -44,13 +44,23 @@ async def create_pattern(
|
|
|
db: Session = Depends(get_db)
|
|
|
):
|
|
|
try:
|
|
|
+ if 'order_num' in body:
|
|
|
+
|
|
|
+ order_num=body['order_num']
|
|
|
+ else:
|
|
|
+ info = db.query(func.max(TpPatternClassification.order_num).label('max_value')).filter_by(template_id=body['template_id']).first()
|
|
|
+ order_num=info.max_value+1
|
|
|
+ if 'visible'in body:
|
|
|
+ visible=body['visible']
|
|
|
+ else:
|
|
|
+ visible='1'
|
|
|
new_classification = TpPatternClassification(
|
|
|
classification_id=new_guid(),
|
|
|
template_id=body['template_id'],
|
|
|
name=body['name'],
|
|
|
value=body['value'],
|
|
|
- order_num = body['order_num'],
|
|
|
- visible=body['visible'],
|
|
|
+ order_num = order_num,
|
|
|
+ visible=visible,
|
|
|
image=body['image'],
|
|
|
icon=body['icon'],
|
|
|
size=body['size'],
|