6 changed files with 122 additions and 16 deletions
@ -0,0 +1,47 @@ |
|||
package com.qs.serve.common.model.tag; |
|||
|
|||
import cn.hutool.core.collection.CollUtil; |
|||
import com.qs.serve.common.util.StringUtils; |
|||
import com.qs.serve.modules.tag.entity.so.TagQuery; |
|||
import com.qs.serve.modules.tbs.entity.TbsCostApply; |
|||
import lombok.experimental.UtilityClass; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2024/7/15 |
|||
*/ |
|||
@UtilityClass |
|||
public class TagFiledUtil { |
|||
|
|||
public final static Map<String,String> TbsCostApplyPageMap = new HashMap<String,String>(){{ |
|||
put("supplier","tbs_cost_apply.supplier_id"); |
|||
}}; |
|||
|
|||
public static void TbsCostApplyPage(TbsCostApply param){ |
|||
List<TagQuery> newList = new ArrayList<>(); |
|||
List<TagQuery> paramTagList = param.getTagQueryList(); |
|||
for (TagQuery tag : paramTagList) { |
|||
if(!StringUtils.hasText(tag.getTargetType())){ |
|||
continue; |
|||
} |
|||
if (StringUtils.hasText(tag.getTargetName()) || CollUtil.isNotEmpty(tag.getTagIds())){ |
|||
String sqlColumn = TbsCostApplyPageMap.get(tag.getDataField()); |
|||
if(StringUtils.hasText(sqlColumn)){ |
|||
TagQuery newVal = new TagQuery(); |
|||
newVal.setTargetType(tag.getTargetType()); |
|||
newVal.setTargetName(tag.getTargetName()); |
|||
newVal.setTagIds(tag.getTagIds()); |
|||
newVal.setSqlColumn(sqlColumn); |
|||
newList.add(newVal); |
|||
} |
|||
} |
|||
} |
|||
param.setTagQueryList(newList); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.qs.serve.modules.tag.entity.so; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2024/7/12 |
|||
*/ |
|||
@Data |
|||
public class TagQuery { |
|||
|
|||
/** |
|||
* 类型 |
|||
*/ |
|||
private String targetType; |
|||
|
|||
private String targetName; |
|||
|
|||
private List<Long> tagIds; |
|||
|
|||
/** |
|||
* 列名 creator.checker |
|||
*/ |
|||
private String dataField; |
|||
|
|||
/** |
|||
* 不用传 |
|||
*/ |
|||
private String sqlColumn; |
|||
|
|||
} |
Loading…
Reference in new issue