package com.engine.organization.entity.jclimport.po;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.json.JSONException;
import org.json.JSONObject;
import weaver.general.Util;

/**
 * @author:dxfeng
 * @createTime: 2022/12/06
 * @version: 1.0
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class HrmFormFieldPO {
    private Integer fieldId;
    private String fieldName;
    private String labelName;
    private Integer isSystem;
    private Integer isMand;
    private String fieldDbType;
    private String fieldHtmlType;
    private String type;
    private String dmlUrl;

    public JSONObject getJsonObject(String fieldValue) throws JSONException {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("fieldid", Util.null2String(this.fieldId));
        jsonObject.put("fieldhtmltype", Util.null2String(this.fieldHtmlType));
        jsonObject.put("type", Util.null2String(this.type));
        jsonObject.put("dmlurl", Util.null2String(this.dmlUrl));
        jsonObject.put("fieldvalue", fieldValue);
        return jsonObject;
    }


}
