提交 5563fb67 编写于 作者: sq3536's avatar sq3536

提交

上级 743be9c4
......@@ -26,6 +26,8 @@ import cn.ibizlab.util.dict.Option;
import cn.ibizlab.util.errors.BadRequestAlertException;
import cn.ibizlab.util.filter.QueryFilter;
import cn.ibizlab.util.helper.DataObject;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -34,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
......@@ -412,4 +415,77 @@ public class DstCoreResource
}
}
@RequestMapping(method = RequestMethod.GET, value = "/lite/{system}/{from}.ibzbak")
public ResponseEntity<JSONObject> ibzbak(@PathVariable(name="system",required = true) String system, @PathVariable(name="from",required = true) String from)
{
MetaFieldSearchContext context=new MetaFieldSearchContext();
context.setSize(Integer.MAX_VALUE);
context.setN_systemid_eq(system);
context.getSearchCond().ge("updatedate", DataObject.getTimestampValue(from, null));
JSONArray jArray = new JSONArray();
fieldService.searchDefault(context).getContent().forEach(sx->{
JSONObject json = new JSONObject();
JSONObject jo = new JSONObject();
jo.put("psdefieldname", sx.getFieldName());
jo.put("predefinetype", sx.getPredefined());
jo.put("unionkeyvalue", sx.getUnionKey());
jo.put("codename", sx.getCodeName());
jo.put("physicalfield", sx.getPhysicalField());
jo.put("psdeid", DigestUtils.md5DigestAsHex(("2C40DFCD-0DF5-47BF-91A5-C45F810B0001||"+sx.getEntityName()).getBytes()).toLowerCase());
jo.put("logicname", sx.getFieldLogicName());
if (sx.getDataLength() != null && sx.getDataLength() > 0)
jo.put("length", sx.getDataLength());
if (sx.getDataPreci() != null && sx.getDataPreci() > 0)
jo.put("precision2", sx.getDataPreci());
jo.put("ordervalue", sx.getShowOrder());
jo.put("psdefieldid", DigestUtils.md5DigestAsHex((DigestUtils.md5DigestAsHex(("2C40DFCD-0DF5-47BF-91A5-C45F810B0001||"+sx.getEntityName()).getBytes()).toLowerCase()+"||"+sx.getFieldName()).getBytes()).toLowerCase());
if(1==sx.getPhysicalField()&&(StringUtils.isEmpty(sx.getExpression())))
jo.put("deftype", 1);
else {
jo.put("deftype", 2);
jo.put("formulaformat",sx.getExpression());
}
jo.put("pkey", sx.getKeyField());
jo.put("pssystemid", "2C40DFCD-0DF5-47BF-91A5-C45F810B0001");
jo.put("psdename", sx.getEntityName());
jo.put("tablename", sx.getEntityName());
String strRT = "文本,可指定长度";
String strDataTypeId=sx.getFieldType();
jo.put("psdatatypeid", strDataTypeId);
if (strDataTypeId.equalsIgnoreCase("DECIMAL"))
strRT = "数值";
else if (strDataTypeId.equalsIgnoreCase("INT"))
strRT = "整型";
else if (strDataTypeId.equalsIgnoreCase("BIGDECIMAL"))
strRT = "大数值";
else if (strDataTypeId.equalsIgnoreCase("BIGINT"))
strRT = "大整型";
else if (strDataTypeId.equalsIgnoreCase("LONGTEXT"))
strRT = "长文本,没有长度限制";
else if (strDataTypeId.equalsIgnoreCase("LONGTEXT_1000"))
strRT = "长文本,长度1000";
else if (strDataTypeId.equalsIgnoreCase("DATE"))
strRT = "日期型";
else if (strDataTypeId.equalsIgnoreCase("DATETIME"))
strRT = "日期时间型";
jo.put("psdatatypename", strRT);
jo.put("allowempty", sx.getNullable());
json.put("srfvalue", jo);
json.put("srfdeid", "42d91505b9bb15b9900b4298fcca9915");
json.put("srfdename", "PSDEFIELD");
jArray.add(json);
});
JSONObject jo = new JSONObject();
jo.put("items", jArray);
return ResponseEntity.ok(jo);
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册