From df063e55893f73a1599a0c604b3af95815f608b5 Mon Sep 17 00:00:00 2001 From: Mr-wang Date: Mon, 19 Jun 2023 13:31:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=BA=E6=A8=A1=E7=B4=A2=E5=BC=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/coe/pal/CoEPALController.java | 4 ++-- .../web/DesignerRelationShapeWeb.java | 22 ++++++------------- .../page/pal.pl.repository.designer.htm | 5 +++-- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java index f220fa1c..e324775a 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java @@ -3579,9 +3579,9 @@ public class CoEPALController { * @return {@link String} */ @Mapping("com.actionsoft.apps.coe.pal_guide_check_create") - public String checkUserFirstCreateModel(UserContext me , String methodId ) { + public String checkUserFirstCreateModel(UserContext me , String methodId,String type) { DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.checkUserFirstCreateModel(methodId); + return web.checkUserFirstCreateModel(methodId,type); } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java index c0fcfad0..e16f50d7 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java @@ -4104,29 +4104,21 @@ public class DesignerRelationShapeWeb extends ActionWeb { * @param methodId 模型类型 * @return {@link String} */ - public String checkUserFirstCreateModel(String methodId) { + public String checkUserFirstCreateModel(String methodId,String type) { ResponseObject ro = ResponseObject.newOkResponse(); String sql = "SELECT COUNT(1) FROM APP_ACT_COE_PAL_REPOSITORY WHERE CREATEUSER=? AND PLMETHODID=?"; String uid = _uc.getUID(); int anInt = DBSql.getInt(sql, new Object[]{uid, methodId}); + System.out.println("是否第一次新建模型>>>>>"+anInt); //只有一条记录的时候判断是否第一次创建对应模型 - if (anInt == 1) { - String getCreateDateSql = "SELECT CREATEDATE FROM APP_ACT_COE_PAL_REPOSITORY WHERE CREATEUSER='" + uid + "' AND PLMETHODID='" + methodId + "'"; - long currentTimeMillis = System.currentTimeMillis(); - Timestamp createDateTimestamp = DBSql.getTimestamp(getCreateDateSql, "CREATEDATE"); - long createTimeMillis = createDateTimestamp.getTime(); - long diff = (currentTimeMillis - createTimeMillis) / 1000 / 60; - //相隔时间小于等于1说明是第一次创建这个类型的模型 - if (diff <= 1) { - ro.put("isFirst", true); - } else { + if (type.equals("0")) { + if (anInt > 1) { ro.put("isFirst", false); + } else { + ro.put("isFirst", true); } - - } else if (anInt > 1) { + }else { ro.put("isFirst", false); - } else { - ro.put("isFirst", true); } return ro.toString(); diff --git a/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.htm b/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.htm index 586c18ee..a5c5675a 100755 --- a/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.htm +++ b/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.htm @@ -519,8 +519,9 @@ //检查用户是否第一次创建对应类型的模型 function checkUserFirstCreateModel(){ - $.ajax({ - url: "./jd?sid=" + sid + "&cmd=com.actionsoft.apps.coe.pal_guide_check_create&methodId=" + methodId, + var data_type = window.performance.navigation.type; + $.ajax({ + url: "./jd?sid=" + sid + "&cmd=com.actionsoft.apps.coe.pal_guide_check_create&methodId=" + methodId+"&type="+data_type, type: 'GET', success: function(data) { if(data.data.isFirst){