Prechádzať zdrojové kódy

修改新增数据元失败的bug

chenweida 9 rokov pred
rodič
commit
551038b3ba

+ 0 - 5
Hos-resource/pom.xml

@ -24,11 +24,6 @@
        </snapshotRepository>
    </distributionManagement>
    <dependencies>
        <dependency>
            <groupId>com.yihu.core</groupId>
            <artifactId>ehr-dbhelper</artifactId>
            <version>1.1.7</version>
        </dependency>
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongo-java-driver</artifactId>

+ 14 - 5
Hos-resource/src/main/java/com/yihu/ehr/resource/controller/RsResourceController.java

@ -162,7 +162,7 @@ public class RsResourceController extends BaseController {
        try {
            model.addAttribute("mode", mode);
            model.addAttribute("resourceId", resourceId);
            RsResourceDeatilModel rrsdm= resourceService.getRsResourceDeatilModel(resourceId);
            RsResourceDeatilModel rrsdm = resourceService.getRsResourceDeatilModel(resourceId);
            model.addAttribute("datasetId", rrsdm.getDatasetCode());
            if (!StringUtils.isEmpty(datasetId)) {
                RsResourceDataset ds = resourceService.getLocalDataSetById(datasetId);
@ -401,7 +401,7 @@ public class RsResourceController extends BaseController {
     * @return
     */
    @RequestMapping("/resource/rsResourceInfo")
    public String rsResourceInfoTemplate(Model model, String id, String mode,String categoryId) {
    public String rsResourceInfoTemplate(Model model, String id, String mode, String categoryId) {
        try {
            RsResourceDeatilModel rsResource = null;
            //mode定义:new modify view三种模式,新增,修改,查看
@ -515,8 +515,7 @@ public class RsResourceController extends BaseController {
            params.put("page", page);
            params.put("rows", rows);
            return resourceService.getDataSet(params);
        }
        catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("删除失败!");
        }
@ -602,8 +601,18 @@ public class RsResourceController extends BaseController {
    public Result createMetaData(HttpServletRequest request) {
        try {
            RsResourceMetadata rmd = new RsResourceMetadata();
            BeanUtils.populate(rmd, request.getParameterMap());
            rmd.setCode(request.getParameter("columnCode"));
            rmd.setColumnName(request.getParameter("columnCode"));
            rmd.setColumnLength(request.getParameter("columnLength"));
            rmd.setColumnType(request.getParameter("columnType"));
            rmd.setDefinition(request.getParameter("definition"));
            rmd.setNullable(Integer.valueOf(request.getParameter("inp_field_is_null")));
            rmd.setPrimaryKey(Integer.valueOf(request.getParameter("inp_field_is_PK")));
            rmd.setDataSupportType(Integer.valueOf(request.getParameter("inp_dataset_from")));
            rmd.setLogicDataSource(request.getParameter("logicDataSource"));
            rmd.setResourceId(request.getParameter("resourceId"));
            rmd.setName(request.getParameter("name"));
            // BeanUtils.populate(rmd, request.getParameterMap("logicDataSource"));
            return resourceService.createMetaData(rmd);
        } catch (Exception e) {
            e.printStackTrace();

+ 19 - 19
Hos-resource/src/main/resources/hbm/resource/RsResourceMetadata.hbm.xml

@ -1,65 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- 
    Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
    <class name="com.yihu.ehr.resource.model.RsResourceMetadata" table="rs_resource_metadata" >
    <class name="com.yihu.ehr.resource.model.RsResourceMetadata" table="rs_resource_metadata">
        <id name="id" type="java.lang.String">
            <column name="id" />
            <generator class="uuid" />
            <column name="id"/>
            <generator class="uuid"/>
        </id>
        <property name="datasetId" type="java.lang.String">
            <column name="dataset_id" not-null="true">
            <column name="dataset_id">
                <comment>数据集ID</comment>
            </column>
        </property>
        <property name="code" type="java.lang.String">
            <column name="code" length="128"  />
            <column name="code" length="128"/>
        </property>
        <property name="resourceId" type="java.lang.String">
            <column name="resource_id" length="64"  />
            <column name="resource_id" length="64"/>
        </property>
        <property name="deCode" type="java.lang.String">
            <column name="de_code" length="128"  />
            <column name="de_code" length="128"/>
        </property>
        <property name="name" type="java.lang.String">
            <column name="name" />
            <column name="name"/>
        </property>
        <property name="type" type="java.lang.String">
            <column name="type" length="16" />
            <column name="type" length="16"/>
        </property>
        <property name="format" type="java.lang.String">
            <column name="format" length="64" />
            <column name="format" length="64"/>
        </property>
        <property name="dictId" type="java.lang.Integer">
            <column name="dict_id" />
            <column name="dict_id"/>
        </property>
        <property name="definition" type="java.lang.String">
            <column name="definition" />
            <column name="definition"/>
        </property>
        <property name="nullable" type="java.lang.Integer">
            <column name="nullable" />
            <column name="nullable"/>
        </property>
        <property name="columnType" type="java.lang.String">
            <column name="column_type" length="8" />
            <column name="column_type" length="8"/>
        </property>
        <property name="columnName" type="java.lang.String">
            <column name="column_name" length="64"/>
        </property>
        <property name="columnLength" type="java.lang.String">
            <column name="column_length" length="8" />
            <column name="column_length" length="8"/>
        </property>
        <property name="primaryKey" type="java.lang.Integer">
            <column name="primary_key" />
            <column name="primary_key"/>
        </property>
        <property name="dataSupportType" type="java.lang.Integer">
            <column name="data_support_type" />
            <column name="data_support_type"/>
        </property>
        <property name="logicDataSource" type="java.lang.String">
            <column name="logic_data_source" />
            <column name="logic_data_source"/>
        </property>
    </class>

+ 12 - 8
Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/resource/resourceregister/rsResourceFieldInfoDialog.jsp

@ -2,14 +2,14 @@
<%@include file="/WEB-INF/ehr/commons/jsp/commonInclude.jsp" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<div id="div_info_form"  class="m-form-inline f-mt20 " style="padding-top: 5px">
<div id="div_info_form" class="m-form-inline f-mt20 " style="padding-top: 5px">
    <div class="m-form-group">
        <label><span class="red">*&nbsp;</span>字段名称:</label>
        <div class="m-form-control">
            <input type="hidden" data-type="text">
            <input type="hidden" data-type="text" name="resourceId">
            <input type="hidden" id="inp_resource_id"  name="id">
            <input type="hidden" data-type="text" name="resourceId" value="<%=request.getParameter("resourceId")%>">
            <input type="hidden" id="inp_resource_id" name="id">
            <input type="text" id="inp_field_name" placeholder="请输入字段名称" name="name"/>
        </div>
    </div>
@ -31,16 +31,18 @@
        <label><span class="red">*&nbsp;</span>字段长度:</label>
        <div class="u-checkbox-wrap m-form-control">
            <input type="text" id="inp_field_length" name="columnLength"  >
            <input type="text" id="inp_field_length" name="columnLength">
        </div>
    </div>
    <div class="m-form-group">
        <label><span class="red">*&nbsp;</span>是否主键</label>
        <div class="u-checkbox-wrap m-form-control ">
            <input type="radio" value="1" name="inp_field_is_PK" name="primaryKey">是
            <input type="radio" checked value="0" name="inp_field_is_PK" name="primaryKey">否
        </div>
        <label style="width: 90px"><span class="red">*&nbsp;</span>是否能空</label>
        <div class="u-checkbox-wrap m-form-control ">
            <input type="radio" checked value="1" name="inp_field_is_null" name="nullable">是
            <input type="radio" value="0" name="inp_field_is_null" name="nullable">否
@ -50,7 +52,7 @@
        <label>字段说明:</label>
        <div class="u-checkbox-wrap m-form-control ">
            <input type="text" id="inp_field_remark"  name="definition">
            <input type="text" id="inp_field_remark" name="definition">
        </div>
    </div>
@ -58,8 +60,8 @@
        <label>数据来源</label>
        <div class="u-checkbox-wrap m-form-control ">
            <input type="radio" checked value="1" name="inp_dataset_from" >逻辑表
            <input type="radio" value="0" name="inp_dataset_from" >事实表
            <input type="radio" checked value="1" name="inp_dataset_from">逻辑表
            <input type="radio" value="0" name="inp_dataset_from">事实表
        </div>
    </div>
    <div id="centerTab1" style="display:none">
@ -75,8 +77,10 @@
    <div id="centerTab2">
        <div class="m-form-group">
            <label>逻辑数据来源</label>
            <div class="m-form-control">
                <textarea rows="10" class="l-textarea" style="width:350px;height: 200px" name="logicDataSource"></textarea>
                <textarea rows="10" class="l-textarea" style="width:350px;height: 200px"
                          name="logicDataSource"></textarea>
            </div>
        </div>
    </div>