Browse Source

服务管理-新增修改bug修复

huangzhiyong 7 years ago
parent
commit
1766185da6

+ 2 - 0
src/main/java/com/yihu/hos/system/controller/DictController.java

@ -94,6 +94,7 @@ public class DictController {
            return dictManager.getDictList(params);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
@ -163,6 +164,7 @@ public class DictController {
            return dictManager.getDictItemList(params);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }

+ 2 - 6
src/main/java/com/yihu/hos/system/dao/AppDao.java

@ -38,13 +38,9 @@ public class AppDao extends SQLGeneralDAO {
        return (List<SystemApp>) super.hibernateTemplate.find("from SystemApp");
    }
    public SystemApp findByCode(String code) throws Exception {
    public List<SystemApp> findByCode(String code) throws Exception {
        List<SystemApp> systemApps = (List<SystemApp>) super.hibernateTemplate.find("from SystemApp where code=?", code);
        if (systemApps != null && systemApps.size() > 0) {
            return systemApps.get(0);
        } else {
            return null;
        }
        return systemApps;
    }
    public List<SystemApp> getAllByIdList(List<String> idList) {

+ 6 - 5
src/main/java/com/yihu/hos/system/service/AppManager.java

@ -22,6 +22,7 @@ import org.zbus.net.http.Message;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
@ -64,14 +65,14 @@ public class AppManager {
        return appDao.getEntity(SystemApp.class, id);
    }
    public SystemApp getAppByCode(String code) throws Exception {
    public List<SystemApp> getAppByCode(String code) throws Exception {
        return appDao.findByCode(code);
    }
    @Transactional
    public Result addApp(SystemApp obj) throws Exception {
        SystemApp appByCode = getAppByCode(obj.getCode());
        if (appByCode == null) {
        List<SystemApp> appByCode = getAppByCode(obj.getCode());
        if (appByCode == null || appByCode.size() == 0) {
            appDao.saveEntity(obj);
            return Result.success("保存成功");
        } else {
@ -82,8 +83,8 @@ public class AppManager {
    @Transactional
    public Result updateApp(SystemApp obj) throws Exception {
        SystemApp appByCode = getAppByCode(obj.getCode());
        if (appByCode == null) {
        List<SystemApp> appByCode = getAppByCode(obj.getCode());
        if (appByCode == null || appByCode.size() <= 1) {
            SystemApp systemApp = appDao.getEntity(SystemApp.class, obj.getId());
            systemApp.setName(obj.getName());
            systemApp.setCode(obj.getCode());

+ 2 - 2
src/main/webapp/WEB-INF/ehr/jsp/standard/adapterplan/indexJs.jsp

@ -27,7 +27,7 @@
        { display: 'stdVersion', name: 'stdVersion', hide:true},
        { display: 'adapterStdVersion', name: 'adapterStdVersion', hide:true},
        { display: '适配方案', name: 'name', width: '15%', align: 'left' },
        { display: '发布状态', name: 'status', width: '10%',align: 'center', render: function (rowdata, rowindex, value) {
        { display: '发布状态', name: 'status', width: '5%',align: 'center', render: function (rowdata, rowindex, value) {
          if(rowdata.status==1 && rowdata.type=="1"){
            return ' <div style="vertical-align:middle;margin-top: 10px;"><span>已发布  </span><img src="${contextRoot}/develop/images/button/fabu_icon.png"/></a></div>';
          }else if(rowdata.status==0 && rowdata.type=="1"){
@ -35,7 +35,7 @@
          }
        }},
        { display: '目标发布机构', name: 'stdPublisher', width: '10%', align: 'center' },
        { display: '目标标准名称', name: 'stdName',width: '15%', type: 'int', align: 'center' },
        { display: '目标标准名称', name: 'stdName',width: '10%', type: 'int', align: 'center' },
        { display: '目标标准版本', name: 'stdVersionName', width: '10%', align: 'center' },
        { display: '源发布机构', name: 'publisher', width: '10%', align: 'center' },
        { display: '源标准', name: 'adapterName', width: '10%', align: 'center' },

+ 9 - 3
src/main/webapp/WEB-INF/ehr/jsp/system/app/editorApp.jsp

@ -26,9 +26,15 @@
    <div class="m-form-group">
        <label><span class="red">*&nbsp;</span>图标:</label>
        <div class="m-form-control">
            <c:if test="${model.icon!=''}">
                <img style="width: 60px;" src="${dfs}/${model.icon}" id="img_icon">
            </c:if>
            <c:choose>
                <c:when test="${model.icon!='' && model.icon !=null}">
                    <img style="width: 60px;" src="${dfs}/${model.icon}" id="img_icon" >
                </c:when>
                <c:otherwise>
                    <img style="width: 60px;" src="${dfs}/${model.icon}" id="img_icon" hidden="hidden" >
                </c:otherwise>
            </c:choose>
        </div>
    </div>
    <div class="m-form-group">

+ 7 - 2
src/main/webapp/WEB-INF/ehr/jsp/system/app/editorAppJs.jsp

@ -86,7 +86,7 @@
        bindEvents: function () {
            var me = this;
            $(".m-form-bottom").on("click", "#btnSave", function () {
                $("#btnSave").css("pointer-events", "none");
//                $("#btnSave").css("pointer-events", "none");
                $("#name_icon").removeClass("required");
                if ($("#name_icon").val() == "" || $("#name_icon").val().indexOf("fakepath")>0) {
                    $("#name_icon").addClass("required");
@ -181,7 +181,12 @@
                            formsay.html("上传成功");
                            formObj.find("input[type=text]").attr("data-id", data)//设置已上传的文件的ID
                            formObj.find("input[type=text]").val(data)//设置已上传的文件的ID
                            $("#img_icon").attr("src", "${dfs}/" + data)//设置已上传的文件的ID
                            if(data == ""){
                                $("#img_icon").hide();//隐藏图标
                            }else{
                                $("#img_icon").show();//显示图标
                                $("#img_icon").attr("src", "${dfs}/" + data)//设置已上传的文件的ID
                            }
                            formObj.closest("div").find("span").html("重新上传<i></i>");
                            //console.log(eval('('+data.data+')'));
                        },