Commit d61785e6 by wangli

实现tags字段

1 parent eeda320f
package com.alibaba.cloud.integration.order.entity; package com.alibaba.cloud.integration.order.entity;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data; import lombok.Data;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.HashMap;
@Data @Data
@TableName(autoResultMap = true) @TableName(autoResultMap = true)
...@@ -26,8 +26,10 @@ public class EngineerInfo { ...@@ -26,8 +26,10 @@ public class EngineerInfo {
private String vehicle; private String vehicle;
private String vehicleNo; private String vehicleNo;
private String beanStatus; private String beanStatus;
@TableField(typeHandler = FastjsonTypeHandler.class)
private JSONObject tags; @TableField(typeHandler = JacksonTypeHandler.class)
private HashMap<String, Object> tags;
private String memo; private String memo;
private Timestamp createTime; private Timestamp createTime;
private Timestamp updateTime; private Timestamp updateTime;
......
...@@ -337,7 +337,7 @@ public class EngineerServiceImpl implements EngineerService { ...@@ -337,7 +337,7 @@ public class EngineerServiceImpl implements EngineerService {
// 标签 // 标签
List<String> tags = new ArrayList<>(); List<String> tags = new ArrayList<>();
if (e.getTags() != null && e.getTags().isEmpty()) { if (e.getTags() != null && e.getTags().isEmpty()) {
for (JSONObject.Entry<String, Object> entry : e.getTags().entrySet()) { for (Map.Entry<String, Object> entry : e.getTags().entrySet()) {
tags.add(String.format("%s+%s", entry.getKey(), entry.getValue().toString())); tags.add(String.format("%s+%s", entry.getKey(), entry.getValue().toString()));
} }
} else { } else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!