| | |
| | | select * from lf.sys_download a where create_user = 1 and type = 2; |
| | | ---------------------------------------------------------------------------------------------- |
| | | select a.*,fn_uname(a.create_user) uname from lf.sys_token a |
| | | select * from lf.sys_dict; |
| | | select distinct ns,tab,fn_get_entity(tab) entity,tab_desc,tabletype from lf.sys_dict order by tab; |
| | | select Distinct ns,tab,tab_desc from lf.sys_dict |
| | | select Distinct ns,tab,tab_desc from lf.sys_dict |
| | | |
| | | |
| | | |
| | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.ctrl.KeyValueEntity; |
| | | import com.lf.server.entity.ctrl.TabEntity; |
| | | import com.lf.server.entity.data.DictEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.service.data.DictService; |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询字典表结构") |
| | | @GetMapping(value = "/selectDictTab") |
| | | public ResponseMsg<List<KeyValueEntity>> selectDictTab() { |
| | | public ResponseMsg<List<TabEntity>> selectDictTab() { |
| | | try { |
| | | List<KeyValueEntity> list = dictService.selectDictTab(); |
| | | List<TabEntity> list = dictService.selectDictTab(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | |
| | | import com.lf.server.service.data.UploaderService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 数据上传 |
| | |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "上传元数据") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "path", value = "路径", dataType = "String", paramType = "query") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadMetas") |
| | | public ResponseMsg<Object> uploadMetas(String path, HttpServletRequest req, HttpServletResponse res) { |
| | |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "删除元数据") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "MetaFileEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/deleteMetas") |
| | | public ResponseMsg<Object> deleteMetas(List<MetaFileEntity> list, HttpServletRequest req) { |
| | |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | public ResponseMsg<Object> insertMetas(String path, Map<String, String> map, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("用户未登录", null); |
| | | } |
| | | |
| | | //int rows = uploaderService.deleteFiles(list); |
| | | |
| | | return success("成功", 0); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @author WWW |
| | | */ |
| | | public class KeyValueEntity { |
| | | private String ns; |
| | | private String key; |
| | | |
| | | private String tab; |
| | | |
| | | private String tabDesc; |
| | | private String value; |
| | | |
| | | public KeyValueEntity() { |
| | | } |
| | | |
| | | public String getNs() { |
| | | return ns; |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setNs(String ns) { |
| | | this.ns = ns; |
| | | public void setKey(String key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public String getTabDesc() { |
| | | return tabDesc; |
| | | } |
| | | |
| | | public void setTabDesc(String tabDesc) { |
| | | this.tabDesc = tabDesc; |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | } |
| | |
| | | |
| | | private String tabDesc; |
| | | |
| | | private String tabletype; |
| | | private String tableType; |
| | | |
| | | public TabEntity() { |
| | | } |
| | |
| | | this.tabDesc = tabDesc; |
| | | } |
| | | |
| | | public String getTabletype() { |
| | | return tabletype; |
| | | public String getTableType() { |
| | | return tableType; |
| | | } |
| | | |
| | | public void setTabletype(String tabletype) { |
| | | this.tabletype = tabletype; |
| | | public void setTableType(String tableType) { |
| | | this.tableType = tableType; |
| | | } |
| | | } |
| | |
| | | package com.lf.server.mapper.data; |
| | | |
| | | import com.lf.server.entity.ctrl.KeyValueEntity; |
| | | import com.lf.server.entity.ctrl.TabEntity; |
| | | import com.lf.server.entity.data.DictEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | public List<KeyValueEntity> selectDictTab(); |
| | | public List<TabEntity> selectDictTab(); |
| | | |
| | | /** |
| | | * 插入一条 |
| | |
| | | package com.lf.server.service.data; |
| | | |
| | | import com.lf.server.entity.ctrl.KeyValueEntity; |
| | | import com.lf.server.entity.ctrl.TabEntity; |
| | | import com.lf.server.entity.data.DictEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.data.DictMapper; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<KeyValueEntity> selectDictTab() { |
| | | public List<TabEntity> selectDictTab() { |
| | | return dictMapper.selectDictTab(); |
| | | } |
| | | |
| | |
| | | |
| | | try { |
| | | Field field = t.getClass().getDeclaredField(key); |
| | | if (field != null) { |
| | | field.setAccessible(true); |
| | | String value = req.getParameter(key); |
| | | field.setAccessible(true); |
| | | String value = req.getParameter(key); |
| | | |
| | | switch (field.getType().toString()) { |
| | | case "double": |
| | | field.set(t, Double.valueOf(value)); |
| | | break; |
| | | case "long": |
| | | field.set(t, Long.valueOf(value)); |
| | | break; |
| | | case "int": |
| | | field.set(t, Integer.valueOf(value)); |
| | | break; |
| | | case "class java.sql.Timestamp": |
| | | field.set(t, Timestamp.valueOf(value)); |
| | | break; |
| | | //case "class java.lang.String": |
| | | default: |
| | | field.set(t, value); |
| | | break; |
| | | } |
| | | switch (field.getType().toString()) { |
| | | case "double": |
| | | field.set(t, Double.valueOf(value)); |
| | | break; |
| | | case "long": |
| | | field.set(t, Long.valueOf(value)); |
| | | break; |
| | | case "int": |
| | | field.set(t, Integer.valueOf(value)); |
| | | break; |
| | | case "class java.sql.Timestamp": |
| | | field.set(t, Timestamp.valueOf(value)); |
| | | break; |
| | | //case "class java.lang.String": |
| | | default: |
| | | field.set(t, value); |
| | | break; |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | |
| | | </select> |
| | | |
| | | <select id="selectTabs" resultType="com.lf.server.entity.ctrl.TabEntity"> |
| | | select distinct ns,tab,fn_get_entity(tab) entity,tab_desc,tabletype from lf.sys_dict order by tab |
| | | select distinct ns,tab,fn_get_entity(tab) entity,tab_desc,tableType from lf.sys_dict order by tab |
| | | </select> |
| | | |
| | | <select id="selectFields" resultType="com.lf.server.entity.data.DictEntity"> |
| | |
| | | select * from lf.sys_dict where id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectDictTab" resultType="com.lf.server.entity.ctrl.KeyValueEntity"> |
| | | <select id="selectDictTab" resultType="com.lf.server.entity.ctrl.TabEntity"> |
| | | select ns,tab,tab_desc from lf.sys_dict |
| | | </select> |
| | | |