//#import Util.js
//#import base64.js
//#import HttpUtil.js
//#import session.js
//#import $@projectCode:services/modelService.jsx
//#import @handlers/include/checklogin.jsx
function trim(s){
  if(s){
    return s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
  }
  return ""
}


var spec = @spec;
(function(){

  var env = checklogin();
  if(!env){
    return;
  }
  var shopId = env.shopId;
  var warehouseId = env.warehouseId;
  var m = shopId;


//判断是subplatform,还是shop,还是platform
  var params = JSON.parse($body);
  var searchArgs = params.searchArgs;
  var searchArgs = params.searchArgs;
  var templateId = params.templateId;

  var sort = params.sort;
  var exportRange = params.exportRange;
  var outputTarget = params.outputTarget;
  var ids = params.ids;
  var key = params.key;
  env.params = params;



  var taskInfoId = @projectCodeService.addExportTask(null,env);

  var ret = {
    state:'ok',
    taskInfoId : taskInfoId
  }

  out.print(JSON.stringify(ret));

})();





