    import WorkFlowServer from './WorkFlowServer'

    import { defaultValue } from '../../../util'
    import CAttDataRow from '../support/CAttDataRow'
    import CAttStruct from '../support/CAttStruct'
    import { Geometry } from '../../../base/geometry'
    /**
     * 要素缓冲分析（多圈）
     * @class WorkFlowServer600239
     *
     * @extends WorkFlowServer
     * @param {Object} options 构造参数
     * @param {String} [options.url] 工作流基地址,必传
     * @param {Array<Geometry>} [options.geometrys] 多边形几何,必传,必须为Array<Polygon>
     * @param {CAttStruct} [options.attStrct] 属性结构,CAttStruct数组
     * @param {Array<CAttDataRow>} [options.attRows] 属性记录,Array<CAttDataRow>
     * @param {String} [options.radiusStr] 多重缓冲半径序列字符串,必传,例如:0.001,0.002,0.003
     * @param {Number} [options.traceRadius] 缓冲选项：跟踪半径,必传,例如:0.0001
     * @param {Number} [options.color] 颜色(新增),例如:1
     * @param {Boolean} [options.isMultiFeatureOpr] 复合要素操作(新增),必传,例如:{"activeValue":"true","inactiveValue":"false"}
     * @param {String} [options.inFormat] 字符串格式,必传,例如:{"JSON":"JSON","XML":"XML"}
     * @example
      const attStrct1 = new Zondy.Object.CAttStruct({
        FldName: ["ID", "面积", "周长", "LayerID"],
        FldNumber: 4,
        FldType: ["FldLong", "FldDouble", "FldDouble", "FldLong"],
      });
      //实例化CAttDataRow类
      const valuesRow1 = new Zondy.Object.CAttDataRow(
        [0, 62.566714, 50.803211, 0],
        1
      );
      const workFlowServer600239 = new Zondy.Service.WorkFlowServer600239({
        url: "http://localhost:8089/igs/rest/services/workflow/600239/WorkflowServer",
        geometrys: [
          new Zondy.Geometry.Polygon({
            coordinates: [
              [
                [11.2203627335275, 532.624659163762],
                [2732.66363429598, 532.624659163762],
                [2933.75550165281, -1310.71745827386],
                [-266.956720443423, -1927.39918483481],
                [-1259.00993273713, -747.660229674732],
                [11.2203627335275, 532.624659163762],
              ],
            ],
          }),
        ],
        attStrct: attStrct1,
        attRows: [valuesRow1],
        radiusStr: "0.001,0.002,0.003",
        traceRadius: 0.0001,
        isMultiFeatureOpr: true,
        inFormat: "JSON",
      });
      workFlowServer600239.execute({
        method: Zondy.Enum.FetchMethod.get,
        success: function (res) {
          console.log("execute: ", res);
        },
      });
     */
    class WorkFlowServer600239 extends WorkFlowServer {
      constructor(options) {
        super(options)
        const opt = options || {}
        /**
         * @description 工作流基地址,必传
         * @member {String} WorkFlowServer600239.prototype.url
         * */
        this.url = opt.url
        /**
         * @description 600239
         * @member {Number} WorkFlowServer600239.prototype.flowId
         * @readonly
         * */
        this.flowId = 600239
        /**
         * @description 要素缓冲分析（多圈）
         * @member {String} WorkFlowServer600239.prototype.description
         * @readonly
         * */
        this.description = '要素缓冲分析（多圈）'
        /**
         * @description 缓冲分析
         * @member {String} WorkFlowServer600239.prototype.groupName
         * @readonly
         * */
        this.groupName = '缓冲分析'
        /**
         * @description 多边形几何,必传,必须为Array<Polygon>
         * @member {Array<Geometry>} WorkFlowServer600237.prototype.geometrys
         * */
        this.geometrys = opt.geometrys
        /**
         * @description 属性结构,CAttStruct数组
         * @member {CAttStruct} WorkFlowServer600238.prototype.attStrct
         * */
        this.attStrct = defaultValue(opt.attStrct, {})
        /**
         * @description 属性记录,类型为CAttDataRow[]
         * @member {Array} WorkFlowServer600238.prototype.attRows
         * */
        this.attRows = defaultValue(opt.attRows, [])
        /**
         * @description 多重缓冲半径序列字符串,必传,例如:0.001,0.002,0.003
         * @member {String} WorkFlowServer600239.prototype.radiusStr
         * */
        this.radiusStr = opt.radiusStr
        /**
         * @description 缓冲选项：跟踪半径,必传,例如:0.0001
         * @member {Number} WorkFlowServer600239.prototype.traceRadius
         * */
        this.traceRadius = opt.traceRadius
        /**
         * @description 颜色(新增),例如:1
         * @member {Number} WorkFlowServer600239.prototype.color
         * */
        this.color = defaultValue(opt.color, 1)
        /**
         * @description 复合要素操作(新增),必传,例如:{"activeValue":"true","inactiveValue":"false"}
         * @member {Boolean} WorkFlowServer600239.prototype.isMultiFeatureOpr
         * */
        this.isMultiFeatureOpr = opt.isMultiFeatureOpr
        /**
         * @description 字符串格式,必传,例如:{"JSON":"JSON","XML":"XML"}
         * @member {String} WorkFlowServer600239.prototype.inFormat
         * */
        this.inFormat = opt.inFormat
      }

      /**
       * @description 获取执行工作流check对象
       * @private
       * @return {Object}
       */
      _getCheckQueryOpts() {
        return {
          geometrys: {
            required: true,
            type(v) {
              if (Array.isArray(v) && v.every((a) => a instanceof Geometry)) {
                return true
              }
              return false
            },
            alias: 'sfGeometryXML',
            process(v) {
              const geometrys = []
              v.forEach((geo) => {
                const oldGeo = geo.toOldIGSGeometry()
                geometrys.push(oldGeo)
              })
              return JSON.stringify(geometrys)
            }
          },
          attStrct: {
            type(v) {
              return v instanceof CAttStruct
            },
            alias: 'attStrctXML',
            process(v) {
              return JSON.stringify(v)
            }
          },
          attRows: {
            type(v) {
              if (Array.isArray(v) && v.every((a) => a instanceof CAttDataRow)) {
                return true
              }
              return false
            },
            alias: 'attRowsXML',
            process(v) {
              return JSON.stringify(v)
            }
          },
          radiusStr: {
            required: true,
            type: 'String'
          },
          traceRadius: {
            required: true,
            type: 'Number'
          },
          color: {
            type: 'Number'
          },
          isMultiFeatureOpr: {
            required: true,
            type: 'Boolean'
          },
          inFormat: {
            required: true,
            type: 'String'
          }
        }
      }
    }

    export default WorkFlowServer600239