From 62e34faacf9d5de8bf94de6cabd219560af3b1d7 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 10 十二月 2024 18:02:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/revision/service/RevisionModelUtil.java | 4
Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java | 130 +++--
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Icons/index.vue | 49 ++
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue | 4
Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/util/WebUtil.java | 479 +++++++++++++-------
Source/plt-web/plt-web-parent/plt-web/src/test/java/BoServiceTest.java | 43 +
Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue | 6
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/model/BaseLinkModel.java | 54 -
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/wrapper/VciQueryWrapperForDO.java | 33 +
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/PlatformWebApplication.java | 1
Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/impl/SmUserQueryServiceImpl.java | 2
Source/plt-web/plt-web-parent/plt-web/pom.xml | 7
Source/plt-web/plt-web-ui/src/components/flow-cycle/components/DetailPanel.vue | 7
Source/plt-web/plt-web-ui/src/components/flow-cycle/components/ItemPanel.vue | 33
Source/plt-web/plt-web-parent/plt-web/src/test/java/PartDO.java | 76 +++
Source/plt-web/plt-web-parent/plt-web-permission/README.md | 25 +
Source/plt-web/plt-web-parent/plt-web-permission/src/test/java/StrTest.java | 32 +
Source/plt-web/plt-web-ui/src/components/flow-cycle/components/DetailForm.vue | 2
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue | 1
/dev/null | 230 ----------
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/model/BaseModel.java | 3
Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/WebBoServiceI.java | 44 +
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/BaseLinkModelDTO.java | 2
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue | 1
Source/plt-web/plt-web-parent/plt-web/src/test/java/WebUtilTest.java | 28 +
Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-table.vue | 2
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/util/ApplicationContextProvider.java | 60 --
27 files changed, 766 insertions(+), 592 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/BaseLinkModelDTO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/BaseLinkModelDTO.java
index 5b25d70..e5d1c98 100644
--- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/BaseLinkModelDTO.java
+++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/BaseLinkModelDTO.java
@@ -2,7 +2,7 @@
import com.alibaba.fastjson.annotation.JSONField;
-import com.vci.model.BaseLinkModel;
+import com.vci.starter.web.model.BaseLinkModel;
import com.vci.starter.web.annotation.Column;
import java.util.ArrayList;
diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/BaseLinkModel.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/BaseLinkModel.java
deleted file mode 100644
index 44fe7f3..0000000
--- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/BaseLinkModel.java
+++ /dev/null
@@ -1,230 +0,0 @@
-package com.vci.model;
-
-
-import com.vci.starter.web.annotation.Column;
-import com.vci.starter.web.annotation.VciFieldType;
-import com.vci.starter.web.enumpck.VciFieldTypeEnum;
-
-import java.util.Date;
-
-/**
- * 榛樿鐨勯摼鎺ョ被鍨�---鍏煎鑰佺殑骞冲彴-璇峰嬁浣跨敤com.vci.starter.web.涓嬬殑BaseLinkModel
- * @author weidy
- */
-public class BaseLinkModel implements java.io.Serializable{
- /**
- * 涓婚敭
- */
- @Column(nullable = false)
- private String oid;
-
- /**
- * 鍒涘缓浜�
- */
- @Column(length = 50)
- private String creator;
-
- /**
- * 鍒涘缓鏃堕棿
- */
- @VciFieldType(VciFieldTypeEnum.VTDateTime)
- private Date createTime;
-
- /**
- * 鏈�鍚庝慨鏀逛汉
- */
- @Column(length = 50)
- private String lastModifier;
-
- /**
- * 鏈�鍚庝慨鏀规椂闂�
- */
- @VciFieldType(VciFieldTypeEnum.VTDateTime)
- private Date lastModifyTime;
-
- /**
- * from绔富閿�
- */
- @Column(name="f_oid",length = 50)
- private String foid;
-
- /**
- * from绔増鏈富閿�
- */
- @Column(name="f_revisionoid",length = 50)
- private String frevisionoid;
-
- /**
- * from绔璞′富閿�
- */
- @Column(name="f_nameoid",length = 50)
- private String fnameoid;
-
- /**
- * from绔笟鍔$被鍨�
- */
- @Column(name="f_btwname",length = 30)
- private String fbtmname;
-
- /**
- * to绔富閿�
- */
- @Column(name="t_oid",length = 50)
- private String toid;
-
- /**
- * to绔増鏈富閿�
- */
- @Column(name="t_revisionoid",length = 50)
- private String trevisionoid;
-
- /**
- * to绔璞′富閿�
- */
- @Column(name="t_nameoid",length = 50)
- private String tnameoid;
-
- /**
- * to绔笟鍔$被鍨�
- */
- @Column(name="t_btwname",length = 30)
- private String tbtmname;
-
- /**
- * 鏃堕棿鎴�
- */
- private Date ts;
-
- public String getOid() {
- return oid;
- }
-
- public void setOid(String oid) {
- this.oid = oid;
- }
-
- public String getCreator() {
- return creator;
- }
-
- public void setCreator(String creator) {
- this.creator = creator;
- }
-
- public Date getCreateTime() {
- return createTime;
- }
-
- public void setCreateTime(Date createTime) {
- this.createTime = createTime;
- }
-
- public String getLastModifier() {
- return lastModifier;
- }
-
- public void setLastModifier(String lastModifier) {
- this.lastModifier = lastModifier;
- }
-
- public Date getLastModifytime() {
- return lastModifyTime;
- }
-
- public void setLastModifytime(Date lastModifytime) {
- this.lastModifyTime = lastModifytime;
- }
-
- public String getFoid() {
- return foid;
- }
-
- public void setFoid(String foid) {
- this.foid = foid;
- }
-
- public String getFrevisionoid() {
- return frevisionoid;
- }
-
- public void setFrevisionoid(String frevisionoid) {
- this.frevisionoid = frevisionoid;
- }
-
- public String getFnameoid() {
- return fnameoid;
- }
-
- public void setFnameoid(String fnameoid) {
- this.fnameoid = fnameoid;
- }
-
-
- public String getToid() {
- return toid;
- }
-
- public void setToid(String toid) {
- this.toid = toid;
- }
-
- public String getTrevisionoid() {
- return trevisionoid;
- }
-
- public void setTrevisionoid(String trevisionoid) {
- this.trevisionoid = trevisionoid;
- }
-
- public String getTnameoid() {
- return tnameoid;
- }
-
- public void setTnameoid(String tnameoid) {
- this.tnameoid = tnameoid;
- }
-
- public String getFbtmname() {
- return fbtmname;
- }
-
- public void setFbtmname(String fbtmname) {
- this.fbtmname = fbtmname;
- }
-
- public String getTbtmname() {
- return tbtmname;
- }
-
- public void setTbtmname(String tbtmname) {
- this.tbtmname = tbtmname;
- }
-
- public Date getTs() {
- return ts;
- }
-
- public void setTs(Date ts) {
- this.ts = ts;
- }
-
- @Override
- public String toString() {
- return "BaseLinkModel{" +
- "oid='" + oid + '\'' +
- ", creator='" + creator + '\'' +
- ", createTime=" + createTime +
- ", lastModifier='" + lastModifier + '\'' +
- ", lastModifytime=" + lastModifyTime +
- ", foid='" + foid + '\'' +
- ", frevisionoid='" + frevisionoid + '\'' +
- ", fnameoid='" + fnameoid + '\'' +
- ", fbtmname='" + fbtmname + '\'' +
- ", toid='" + toid + '\'' +
- ", trevisionoid='" + trevisionoid + '\'' +
- ", tnameoid='" + tnameoid + '\'' +
- ", tbtmname='" + tbtmname + '\'' +
- ", ts=" + ts +
- '}';
- }
-}
diff --git a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/revision/service/RevisionModelUtil.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/revision/service/RevisionModelUtil.java
index 9859eb5..438ef78 100644
--- a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/revision/service/RevisionModelUtil.java
+++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/revision/service/RevisionModelUtil.java
@@ -334,7 +334,7 @@
linkModel.setCreateTime(currentDate);
linkModel.setTs(currentDate);
linkModel.setLastModifier(linkModel.getCreator());
- linkModel.setLastModifytime(currentDate);
+ linkModel.setLastModifyTime(currentDate);
}
/**
@@ -365,7 +365,7 @@
Date currentDate = new Date();
linkModel.setTs(currentDate);
linkModel.setLastModifier(VciBaseUtil.getCurrentUserId());
- linkModel.setLastModifytime(currentDate);
+ linkModel.setLastModifyTime(currentDate);
}
/**
diff --git a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/model/BaseLinkModel.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/model/BaseLinkModel.java
index cc08bbd..11b6e91 100644
--- a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/model/BaseLinkModel.java
+++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/model/BaseLinkModel.java
@@ -65,7 +65,7 @@
/**
* from绔笟鍔$被鍨�
*/
- @Column(name="f_btmname",length = 30)
+ @Column(name="f_btwname",length = 30)
private String fbtmname;
/**
@@ -89,7 +89,7 @@
/**
* to绔笟鍔$被鍨�
*/
- @Column(name="t_btmname",length = 30)
+ @Column(name="t_btwname",length = 30)
private String tbtmname;
/**
@@ -135,12 +135,12 @@
this.lastModifier = lastModifier;
}
- public Date getLastModifytime() {
+ public Date getLastModifyTime() {
return lastModifyTime;
}
- public void setLastModifytime(Date lastModifytime) {
- this.lastModifyTime = lastModifytime;
+ public void setLastModifyTime(Date lastModifyTime) {
+ this.lastModifyTime = lastModifyTime;
}
public String getFoid() {
@@ -167,6 +167,13 @@
this.fnameoid = fnameoid;
}
+ public String getFbtmname() {
+ return fbtmname;
+ }
+
+ public void setFbtmname(String fbtmname) {
+ this.fbtmname = fbtmname;
+ }
public String getToid() {
return toid;
@@ -192,14 +199,6 @@
this.tnameoid = tnameoid;
}
- public String getFbtmname() {
- return fbtmname;
- }
-
- public void setFbtmname(String fbtmname) {
- this.fbtmname = fbtmname;
- }
-
public String getTbtmname() {
return tbtmname;
}
@@ -216,40 +215,11 @@
this.ts = ts;
}
- public Date getLastModifyTime() {
- return lastModifyTime;
- }
-
- public void setLastModifyTime(Date lastModifyTime) {
- this.lastModifyTime = lastModifyTime;
- }
-
public Map<String, String> getData() {
return data;
}
public void setData(Map<String, String> data) {
this.data = data;
- }
-
- @Override
- public String toString() {
- return "BaseLinkModel{" +
- "oid='" + oid + '\'' +
- ", creator='" + creator + '\'' +
- ", createTime=" + createTime +
- ", lastModifier='" + lastModifier + '\'' +
- ", lastModifyTime=" + lastModifyTime +
- ", foid='" + foid + '\'' +
- ", frevisionoid='" + frevisionoid + '\'' +
- ", fnameoid='" + fnameoid + '\'' +
- ", fbtmname='" + fbtmname + '\'' +
- ", toid='" + toid + '\'' +
- ", trevisionoid='" + trevisionoid + '\'' +
- ", tnameoid='" + tnameoid + '\'' +
- ", tbtmname='" + tbtmname + '\'' +
- ", ts=" + ts +
- ", data=" + data +
- '}';
}
}
diff --git a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/model/BaseModel.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/model/BaseModel.java
index 2571ef3..b68afbd 100644
--- a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/model/BaseModel.java
+++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/model/BaseModel.java
@@ -133,7 +133,7 @@
/**
* 鐢熷懡鍛ㄦ湡鐨勭紪鍙�
*/
- @Transient()
+ @Column()
private String lctId;
/**
@@ -146,6 +146,7 @@
* 鏃堕棿鎴筹紝鏍煎紡鏄痽yyy-MM-dd HH:mm:ss.SSS
*/
@JsonFormat(pattern = VciDateUtil.DateTimeMillFormat)
+ @VciFieldType(VciFieldTypeEnum.VTDateTime)
private Date ts;
/**
diff --git a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/util/ApplicationContextProvider.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/util/ApplicationContextProvider.java
index 800ff1d..51d8004 100644
--- a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/util/ApplicationContextProvider.java
+++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/util/ApplicationContextProvider.java
@@ -1,36 +1,17 @@
package com.vci.starter.web.util;
-import com.vci.starter.web.annotation.controller.VciUnCheckRight;
-import com.vci.starter.web.annotation.log.VciUnLog;
-import com.vci.starter.web.autoconfigure.AppAutoConfigure;
-import com.vci.starter.web.pagemodel.BaseResult;
import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
-import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
/**
* spring鐨勪笂涓嬫枃宸ュ叿锛�
- * 娉ㄦ剰springmvc涓殑controller涓嶅簲璇ュ湪杩欓噷鑾峰彇锛屽洜涓簊pringmvc鍙簲璇ヨ鍓嶇璋冪敤
- * 娌℃湁浣跨敤springboot鐨刴ain鍑芥暟閲岃缃苟鑾峰彇鏄洜涓哄彲鑳戒細璁╁涓湇鍔″悎骞跺埌涓�璧峰惎鍔�
- * @author weidy
- * @date 2019/10/31 9:02 AM
+ * @author dangsn
+ * @date 2024/12/3
*/
-@RestController
-@RequestMapping("/application")
+@Component
public class ApplicationContextProvider implements ApplicationContextAware {
-
- /**
- * 鏈嶅姟鐨勯厤缃�
- */
- @Autowired
- private AppAutoConfigure appAutoConfigure;
/**
* 搴旂敤鐨勪笂涓嬫枃
@@ -39,12 +20,12 @@
/**
* 璁剧疆搴旂敤鐨勪笂涓嬫枃
- * @param applicationContext 涓婁笅鏂�
+ * @param context 涓婁笅鏂�
* @throws BeansException 鍑虹幇閿欒鏃堕渶瑕佹姏鍑哄紓甯哥粰spring瀹瑰櫒
*/
@Override
- public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
- ApplicationContextProvider.applicationContext = applicationContext;
+ public void setApplicationContext(ApplicationContext context) throws BeansException {
+ applicationContext = context;
}
/**
@@ -75,33 +56,4 @@
public static <T> T getBean(Class<T> c) throws BeansException{
return applicationContext.getBean(c);
}
-
- /**
- * 鍏虫満
- * @return 鎵ц瀹屾垚
- */
- @PostMapping("/shutDownContext")
- @VciUnLog
- @VciUnCheckRight
- public BaseResult shutDownContext(String privateKey){
- if( appAutoConfigure.getPrivateTokenKey().equalsIgnoreCase(privateKey)) {
- ConfigurableApplicationContext ctx = (ConfigurableApplicationContext) applicationContext;
- ctx.close();
- return BaseResult.success("鍏抽棴鏈嶅姟鎴愬姛");
- }else{
- return BaseResult.fail("鎮ㄦ病鏈夋潈闄愬叧闂湇鍔�");
- }
- }
-
- /**
- * 妫�鏌ユ槸鍚﹀畬鎴�
- * @return 璋冪敤灏辫鏄庢垚鍔熶簡
- */
- @PostMapping("/checkOnline")
- @VciUnLog
- @VciUnCheckRight
- public BaseResult checkOnline(){
- return BaseResult.success("鍚姩瀹屾垚");
- }
-
}
diff --git a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/wrapper/VciQueryWrapperForDO.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/wrapper/VciQueryWrapperForDO.java
index 5f8f765..af95a71 100644
--- a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/wrapper/VciQueryWrapperForDO.java
+++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/wrapper/VciQueryWrapperForDO.java
@@ -175,6 +175,39 @@
}};
/**
+ * BaseModel鍜孊usinessObject涓殑灞炴�ф槧灏勩��
+ * key锛氫负BaseModel涓殑灞炴�э紝value锛氫负BusinessObject涓殑灞炴��
+ */
+ public static final Map<String, String> BASEMODEL_CBO_FIELD_MAP = new HashMap(){{
+ put("oid", "oid");
+ put("revisionoid","revoid");
+ put("nameoid","nameoid");
+ put("btmname","btname");
+ put("lastr","islastr");
+ put("firstr","isfirstr");
+ put("lastv","islastv");
+ put("firstv","isfirstv");
+ put("creator","creator");
+ put("createtime","createtime");
+ put("lastmodifier","modifier");
+ put("lastmodifytime","modifytime");
+ put("revisionrule","revisionrule");
+ put("versionrule","versionrule");
+ put("revisionseq","revisionseq");
+ put("revisionvalue","revisionvalue");
+ put("versionseq","versionseq");
+ put("versionvalue","versionvalue");
+ put("lctid","lctid");
+ put("lcstatus","lcstatus");
+ put("ts","ts");
+ put("id","id");
+ put("name","name");
+ put("description","description");
+ put("owner","owner");
+ put("copyfromversion","fromversion");
+ }};
+
+ /**
* 涓婚敭灞炴��
*/
public static final String OID_FIELD = "oid";
diff --git a/Source/plt-web/plt-web-parent/plt-web-permission/README.md b/Source/plt-web/plt-web-parent/plt-web-permission/README.md
new file mode 100644
index 0000000..395cd44
--- /dev/null
+++ b/Source/plt-web/plt-web-parent/plt-web-permission/README.md
@@ -0,0 +1,25 @@
+DO瀵硅薄涓紝鏋氫妇鍜屽紩鐢ㄤ娇鐢ㄨ寖渚嬶細
+####
+涓�銆佹灇涓剧殑浣跨敤鑼冧緥锛�
+#####
+```java
+ @VciUseEnum(value = FrameWorkEnumConstant.SUPPLIER_TYPE,showTextField = "supplierTypeText")
+ @Column(columnDefinition = "渚涘簲鍟嗙被鍨�")
+ private String supplierType;
+
+ @Column(columnDefinition = "渚涘簲鍟嗙被鍨嬫樉绀烘枃鏈�")
+ @Transient
+ private String supplierTypeText;
+```
+浜屻�佸紩鐢ㄤ娇鐢ㄨ寖渚嬶細
+#####
+```java
+ @VciUseRefer(FrameWorkBtmTypeConstant.BD_SUPPLIER_CLASSIFY_BTM_TYPE)
+ @Column(columnDefinition = "渚涘簲鍟嗗熀鏈垎绫�",nullable = false)
+ private String pkSupplierClassify;
+
+
+ @Column(columnDefinition = "渚涘簲鍟嗗熀鏈垎绫绘樉绀哄悕绉�")
+ @Transient(referColumn = "pkSupplierClassify.name")
+ private String pkSupplierClassifyText;
+```
diff --git a/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/WebBoServiceI.java b/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/WebBoServiceI.java
index a1f9f49..af2b509 100644
--- a/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/WebBoServiceI.java
+++ b/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/WebBoServiceI.java
@@ -67,7 +67,7 @@
* @param btmType 涓氬姟绫诲瀷
* @param conditionMap 鏌ヨ鏉′欢
* @param ph 鍒嗛〉鍜屾帓搴�
- * @param clauseList 鏌ヨ瀛楁锛屽弬鐓у瓧娈典娇鐢▁xxx.yy;鏋氫妇瀛楁浣跨敤xxx_enumCode;鐢熷懡鍛ㄦ湡浼氳嚜鍔ㄥ鐞嗕负lcStatus_text
+ * @param clauseList 鏌ヨ瀛楁锛屽弬鐓у瓧娈典娇鐢╢ield.yy;鏋氫妇瀛楁浣跨敤enumCode_field;鐢熷懡鍛ㄦ湡浼氳嚜鍔ㄥ鐞嗕负lcStatus_text銆傛牴鎹瓧娈垫槧灏凪ap鐨刱ey鑰屾潵銆�
* @return
* @throws VciBaseException
*/
@@ -137,8 +137,9 @@
* @return
* @throws VciBaseException
*/
- List<BusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, Object> replaceMap, PageHelper ph, List<String> clauseList) throws VciBaseException;
-
+ List<BusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, Object> replaceMap,
+ PageHelper ph, List<String> clauseList) throws VciBaseException;
+
/**
* 鏌ヨ鏁伴噺
* @param btmType 涓氬姟绫诲瀷鍚嶇О
@@ -196,7 +197,7 @@
/**
* 鍙敤sql璇彞鏌ヨ锛岃繖涓拰queryBySqlForMap鍖哄埆鏄紝鐗规畩鐨剆ql(濡傚寘鍚湁鍑芥暟鐨�)鍙互鐢ㄨ繖涓柟娉曪紝浣嗘槸鏈塻ql娉ㄥ叆椋庨櫓
* @param sql sql璇彞锛屾煡璇㈡潯浠跺繀椤昏嚜琛屽湪鍏朵腑澶勭悊瀹屾垚
- * @return 鏁版嵁鏄犲皠
+ * @return 鏁版嵁鏄犲皠銆侻ap涓紝key鍊间负澶у啓銆�
* @throws VciBaseException 鏌ヨ鍑洪敊娲绘姏鍑哄紓甯�
*/
List<Map> queryByOnlySqlForMap(String sql) throws VciBaseException;
@@ -212,7 +213,7 @@
<T> List<T> queryByOnlySqlForObj(String sql, Class<T> tClass) throws VciBaseException;
/**
- * 鏍规嵁sql璇彞鏉ユ煡璇㈠唴瀹癸紝杩斿洖Map
+ * 鏍规嵁sql璇彞鏉ユ煡璇㈠唴瀹癸紝杩斿洖Map銆俿ql涓嶈兘鏄痵elect * 鎴栬�� select t.*
* @param sql 涓轰簡闃叉SQL娉ㄥ叆锛屽�煎繀椤诲湪sql璇彞閲屼互:xxx鏍煎紡锛屽 id =:idvalue锛岀劧鍚庡湪conditionMap涓坊鍔犲缓涓篿dvalue鐨勬牸寮�
* @param conditionMap 鏌ヨ鏉′欢锛屽繀椤讳笌sql閲屽搴�
* @return map鏁版嵁
@@ -220,7 +221,7 @@
*/
List<Map> queryBySqlForMap(String sql, Map<String, String> conditionMap) throws VciBaseException;
/**
- * 鏍规嵁sql璇彞鏉ユ煡璇㈠唴瀹癸紝杩斿洖Map
+ * 鏍规嵁sql璇彞鏉ユ煡璇㈠唴瀹癸紝杩斿洖Map銆俿ql涓嶈兘鏄痵elect * 鎴栬�� select t.*
* @param sql 涓轰簡闃叉SQL娉ㄥ叆锛屽�煎繀椤诲湪sql璇彞閲屼互:xxx鏍煎紡锛屽 id =:idvalue锛岀劧鍚庡湪conditionMap涓坊鍔犲缓涓篿dvalue鐨勬牸寮�
* @param conditionMap 鏌ヨ鏉′欢锛屽繀椤讳笌sql閲屽搴�
* @param selectKeys 鏌ヨ鐨勫瓧娈�
@@ -288,7 +289,6 @@
*/
<T> BatchCBO batchAddSave(List<T> list) throws VciBaseException;
-
/**
* 淇敼鏁版嵁锛屽彲浠ュ湪request閲岃缃笉鎸佷箙鍖�
* @param obj 淇敼鏁版嵁瀵硅薄
@@ -305,6 +305,14 @@
*/
<T> BatchCBO batchEditSave(List<T> list) throws VciBaseException;
+ /**
+ * 鍒犻櫎鏁版嵁锛屽彲浠ュ湪request閲岃缃笉鎸佷箙鍖�
+ * @param obj 鍒犻櫎鏁版嵁瀵硅薄
+ * @param checkRefered 鏄惁鍒犻櫎寮曠敤鐨勬暟鎹�
+ * @return 闇�瑕佸垱寤虹殑CBO,CLO;闇�瑕佷慨鏀圭殑CBO,CLO;闇�瑕佸垹闄ょ殑CBO,CLO
+ * @throws VciBaseException
+ */
+ <T> BatchCBO delete(T obj,boolean checkRefered) throws VciBaseException;
/**
* 鍒犻櫎鏁版嵁锛屽彲浠ュ湪request閲岃缃笉鎸佷箙鍖�
@@ -312,8 +320,16 @@
* @return 闇�瑕佸垱寤虹殑CBO,CLO;闇�瑕佷慨鏀圭殑CBO,CLO;闇�瑕佸垹闄ょ殑CBO,CLO
* @throws VciBaseException
*/
- <T> BatchCBO delete(T obj,boolean checkRefered) throws VciBaseException;
<T> BatchCBO delete(T obj) throws VciBaseException;
+
+ /**
+ * 鎵归噺鍒犻櫎鏁版嵁锛屽彲浠ュ湪request閲岃缃笉鎸佷箙鍖�
+ * @param list 闇�瑕佸垹闄ゆ暟鎹璞″垪琛�
+ * @param checkRefered 鏄惁鍒犻櫎寮曠敤鐨勬暟鎹�
+ * @return 闇�瑕佸垱寤虹殑CBO,CLO;闇�瑕佷慨鏀圭殑CBO,CLO;闇�瑕佸垹闄ょ殑CBO,CLO,checkRefered:[false/true]鏄惁妫�鏌ヨ寮曠敤锛岄粯璁や笉妫�鏌�
+ * @throws VciBaseException
+ */
+ <T> BatchCBO batchDelete(List<T> list,boolean checkRefered) throws VciBaseException;
/**
* 鎵归噺鍒犻櫎鏁版嵁锛屽彲浠ュ湪request閲岃缃笉鎸佷箙鍖�
@@ -321,12 +337,8 @@
* @return 闇�瑕佸垱寤虹殑CBO,CLO;闇�瑕佷慨鏀圭殑CBO,CLO;闇�瑕佸垹闄ょ殑CBO,CLO,checkRefered:[false/true]鏄惁妫�鏌ヨ寮曠敤锛岄粯璁や笉妫�鏌�
* @throws VciBaseException
*/
- <T> BatchCBO batchDelete(List<T> list,boolean checkRefered) throws VciBaseException;
-
<T> BatchCBO batchDelete(List<T> list) throws VciBaseException;
-
-
/**
* 鏍规嵁鏌ヨ鏉′欢鏉ュ垹闄ゆ暟鎹�
* @param c 鍒犻櫎鏁版嵁瀵硅薄鎵�灞炵被
@@ -420,7 +432,8 @@
* @return 鍒楄〃鏁版嵁锛屾暟鎹槸Map褰㈠紡鐨勶紝鍖呭惈鍒嗛〉淇℃伅
* @throws VciBaseException
*/
- DataGrid queryGridByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, Object> replaceMap, PageHelper ph) throws VciBaseException;
+ DataGrid queryGridByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, Object> replaceMap,
+ PageHelper ph) throws VciBaseException;
/**
* 鏍规嵁鏌ヨ鏂规鏉ユ煡璇㈠垪琛ㄦ暟鎹紝鍙互鑷畾涔夋煡璇㈢殑鍒楋紝鍖呮嫭鍙傜収鍜屾灇涓�
@@ -432,8 +445,9 @@
* @return 鍒楄〃鏁版嵁锛屾暟鎹槸Map褰㈠紡鐨勶紝鍖呭惈鍒嗛〉淇℃伅
* @throws VciBaseException
*/
- DataGrid queryGridByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, Object> replaceMap, PageHelper ph, List<String> clauseList) throws VciBaseException;
-
+ DataGrid queryGridByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, Object> replaceMap,
+ PageHelper ph, List<String> clauseList) throws VciBaseException;
+
/**
* 鏌ヨ瀵硅薄鐨勫垪琛ㄦ暟鎹�
* @param c 鏌ヨ瀵硅薄鎵�灞炵被
diff --git a/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/impl/SmUserQueryServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/impl/SmUserQueryServiceImpl.java
index ea8b652..a39479e 100644
--- a/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/impl/SmUserQueryServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/impl/SmUserQueryServiceImpl.java
@@ -959,7 +959,7 @@
tree.setOid(cbo.oid);
tree.setText(cbo.id + " " + cbo.name);
Map<String,String> attributeMap = new HashMap<>();
- WebUtil.copyValueToCboFromMap(cbo,attributeMap);
+ WebUtil.copyValueToMapFromBos(cbo,attributeMap);
tree.setAttributes(attributeMap);
tree.setLeaf(true);
treeList.add(tree);
diff --git a/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java
index ad5ea40..614884d 100644
--- a/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java
@@ -15,21 +15,23 @@
import com.vci.omd.utils.ObjectTool;
import com.vci.pagemodel.*;
import com.vci.starter.web.annotation.Column;
+import com.vci.starter.web.annotation.VciFieldType;
import com.vci.starter.web.constant.QueryOptionConstant;
import com.vci.starter.web.enumpck.BooleanEnum;
+import com.vci.starter.web.enumpck.VciFieldTypeEnum;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.pagemodel.PageHelper;
import com.vci.starter.web.util.BeanUtilForVCI;
import com.vci.starter.web.util.Lcm.Func;
import com.vci.starter.web.util.VciBaseUtil;
+import com.vci.starter.web.util.VciDateUtil;
import com.vci.starter.web.wrapper.VciQueryWrapperForDO;
import com.vci.web.properties.WebProperties;
import com.vci.web.service.*;
import com.vci.web.util.PlatformClientUtil;
import com.vci.web.util.WebUtil;
import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.math3.distribution.TDistribution;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.slf4j.Logger;
@@ -553,7 +555,7 @@
// 涓�灞傚弬鐓� a.b
// 绗簩涓弬鏁扮粰绌猴紝鏄涓嶅浠庡睘鎬т腑鏌ュ叾鍙傛暟鐨勪笟鍔$被鍨嬶紝鐢变笅涓嬩笓鐢ㄦ帄涓繘琛屽鐞�
BtmRefQueryOption refOpt = new BtmRefQueryOption(
- kvs[0], "", new String[]{kvs[1]}
+ kvs[0], "", new String[]{kvs[1]}
);
refOpts.add(refOpt);
} else if(len == 3){
@@ -563,7 +565,7 @@
// 涓夊眰浠ョ殑鍙傜収 a.b.c.d a.b.c.d.e
// TODO 闇�瑕佹敮鎸佷笁灞備互鍙婁互涓婄殑鍙傜収
}
- }else if(attrName.indexOf("_")>-1
+ }else if(attrName.indexOf("_")>-1
&& !"lcStatus_text".toLowerCase().equalsIgnoreCase(attrName.toLowerCase())){
enumAttrName.add(attrName);
}else{
@@ -596,8 +598,6 @@
ObjectQueryService.FindBTMObjectsV3Result bos = qtService.findBTMObjectsV3(qt.getId(), OQTool.qtTOXMl(qt).asXML(), refOpts.toArray(new BtmRefQueryOption[refOpts.size()]));
if (bos != null && bos.count > 0) {
for (BusinessObject bo : bos.returnValue) {
-// BusinessObject cbo = new BusinessObject();
-// cbo = bo;
queryEnumText(bo,enumAttrName);
allCbos.add(bo);
}
@@ -700,7 +700,7 @@
Map<String, OsStatusVO> statusVOMap = statusService.selectAllStatusMap();
cbos.stream().forEach(cbo->{
try{
- ObjectTool.setBOAttributeValue(cbo,"lcStatus_text", statusVOMap.getOrDefault(cbo.lcStatus,new OsStatusVO()).getName());
+ ObjectTool.setBOAttributeValue(cbo,"lcStatus_text".toLowerCase(), statusVOMap.getOrDefault(cbo.lcStatus,new OsStatusVO()).getName());
}catch(Exception e){
logger.error("鑾峰彇鐢熷懡鍛ㄦ湡涓姸鎬佺殑鏄剧ず鏂囨湰鍑洪敊",e);
}
@@ -728,7 +728,7 @@
@Override
public void queryEnumText(BusinessObject cbo, LinkObject clo, List<String> enumAttrName) throws VciBaseException{
if(enumAttrName.size()>0){//鏌ヨ鏋氫妇
- for(String enumAttr:enumAttrName){//鏍煎紡涓� code_field code鏄灇涓剧殑缂栫爜锛宖ield鏄綋鍓嶄笟鍔$被鍨嬪瓨鍌ㄦ灇涓惧�肩殑瀛楁
+ for(String enumAttr : enumAttrName){//鏍煎紡涓� code_field code鏄灇涓剧殑缂栫爜锛宖ield鏄綋鍓嶄笟鍔$被鍨嬪瓨鍌ㄦ灇涓惧�肩殑瀛楁
if(enumAttr.toLowerCase().equals("creator_name")){
//鍒涘缓浜虹殑鍚嶇О
String creator = "";
@@ -770,18 +770,20 @@
String enumCode = tempArray[0];//鏋氫妇缂栫爜
if (tempArray.length > 1) {
//浠庢灇涓句腑鑾峰彇鍊�
- String valueFieldName = tempArray[1];
+ String valueFieldName = tempArray[1];//鏋氫妇鍦ㄤ笟鍔$被鍨嬩笂瀛樻斁鐨勫睘鎬�
String comboxField = "";
if(valueFieldName.contains("#")){
valueFieldName = tempArray[1].split("#")[0];
comboxField = tempArray[1].split("#")[1];
}
+ //鑾峰彇鏋氫妇椤�
String enumKey = "";
if (cbo != null) {
enumKey = ObjectTool.getBOAttributeValue(cbo,valueFieldName);
} else if (clo != null) {
enumKey = ObjectTool.getLOAttributeValue(clo,valueFieldName);
}
+ //鑾峰彇鏋氫妇椤圭殑涓枃鏄剧ず
String enumText = "";
if (WebUtil.isNotNull(enumKey)) {
enumText = enumService.getValue(enumCode, enumKey);
@@ -994,9 +996,8 @@
* @throws VciBaseException 鏌ヨ鍑洪敊浼氭姏鍑哄紓甯�
*/
@Override
- public List<BusinessObject> queryCBOByScheme(String queryScheme,
- Map<String, String> conditionMap, Map<String, Object> replaceMap,
- PageHelper ph, List<String> clauseList) throws VciBaseException {
+ public List<BusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, Object> replaceMap,
+ PageHelper ph, List<String> clauseList) throws VciBaseException {
QueryTemplate qt = getQtByName(queryScheme,replaceMap);
return baseQueryCBO(qt,conditionMap,ph,clauseList);
}
@@ -1155,7 +1156,7 @@
/**
* 鍙敤sql璇彞鏌ヨ锛岃繖涓拰queryBySqlForMap鍖哄埆鏄紝鐗规畩鐨剆ql(濡傚寘鍚湁鍑芥暟鐨�)鍙互鐢ㄨ繖涓柟娉曪紝浣嗘槸鏈塻ql娉ㄥ叆椋庨櫓
* @param sql sql璇彞锛屾煡璇㈡潯浠跺繀椤昏嚜琛屽湪鍏朵腑澶勭悊瀹屾垚
- * @return 鏁版嵁鏄犲皠
+ * @return 鏁版嵁鏄犲皠銆侻ap涓紝key鍊间负澶у啓銆�
* @throws VciBaseException 鏌ヨ鍑洪敊娲绘姏鍑哄紓甯�
*/
@Override
@@ -1198,13 +1199,32 @@
List<Map> allData = queryByOnlySqlForMap(sql);
//闇�瑕佽浆鎹竴涓媍bo鐨勯偅涓睘鎬�
Map<String/**涓氬姟绫诲瀷涓殑瀛楁*/, String/**灞炴�ч噷鐨勫瓧娈�**/> fieldNameMap = WebUtil.getFieldNameMap(tClass);
+ Map<String, Field> fieldMap = WebUtil.getFieldMapForObject(tClass);
List<T> dataList = new ArrayList<>();
if(!CollectionUtils.isEmpty(allData)){
allData.stream().forEach(data->{
Map thisData = new HashMap();
if(!CollectionUtils.isEmpty(data)){
data.forEach((key,value)->{
- thisData.put(fieldNameMap.getOrDefault(((String)key).toLowerCase(Locale.ROOT), (String) key),value);
+ String fieldName = fieldNameMap.getOrDefault(((String)key).toLowerCase(Locale.ROOT), (String) key);
+ String fieldValue = String.valueOf(value);
+ if(fieldMap.containsKey(fieldName)){
+ Field field = fieldMap.get(fieldName);
+ if(field.isAnnotationPresent(VciFieldType.class)){
+ VciFieldType vciFieldType = field.getAnnotation(VciFieldType.class);
+ VciFieldTypeEnum vciFieldTypeEnum = vciFieldType.value();
+ if(VciFieldTypeEnum.VTDateTime.equals(vciFieldTypeEnum) && StringUtils.isNotBlank(fieldValue)){
+ fieldValue = VciDateUtil.date2Str(VciDateUtil.long2Date(Long.parseLong(fieldValue)), VciDateUtil.DateTimeFormat);
+ }
+ if(VciFieldTypeEnum.VTDate.equals(vciFieldTypeEnum) && StringUtils.isNotBlank(fieldValue)){
+ fieldValue = VciDateUtil.date2Str(VciDateUtil.long2Date(Long.parseLong(fieldValue)), VciDateUtil.DateFormat);
+ }
+ if(VciFieldTypeEnum.VTTime.equals(vciFieldTypeEnum) && StringUtils.isNotBlank(fieldValue)){
+ fieldValue = VciDateUtil.date2Str(VciDateUtil.long2Date(Long.parseLong(fieldValue)), VciDateUtil.TimeFormat);
+ }
+ }
+ }
+ thisData.put(fieldName,fieldValue);
});
}
try {
@@ -1224,7 +1244,7 @@
* 鏍规嵁sql璇彞鏉ユ煡璇㈠唴瀹癸紝杩斿洖Map----sql涓嶈兘鏄痵elect * 鎴栬�� select t.*
* @param sql 涓轰簡闃叉SQL娉ㄥ叆锛屽�煎繀椤诲湪sql璇彞閲屼互:xxx鏍煎紡锛屽 id =:idvalue锛岀劧鍚庡湪conditionMap涓坊鍔犲缓涓篿dvalue鐨勬牸寮�
* @param conditionMap 鏌ヨ鏉′欢锛屽繀椤讳笌sql閲屽搴�
- * @return 涓氬姟鏁版嵁鐨勬槧灏�
+ * @return 涓氬姟鏁版嵁鐨勬槧灏勩��
* @throws VciBaseException 鏌ヨ鍑洪敊浼氭姏鍑哄紓甯�
*/
@Override
@@ -1234,7 +1254,7 @@
}
/**
- * 鍜屼笂涓柟娉曚竴鏍凤紝澶氫紶浜嗘煡璇㈠瓧娈� selectKeys
+ * 鍜屼笂涓柟娉曚竴鏍凤紝澶氫紶浜嗘煡璇㈠瓧娈� selectKeys銆俿ql涓嶈兘鏄痵elect * 鎴栬�� select t.*
* @param sql sql璇彞
* @param conditionMap 鏌ヨ鏉′欢
* @param selectKeys 鏌ヨ鐨勫瓧娈�
@@ -1272,7 +1292,7 @@
ava = new AttributeValue[0];
}
try {
- String[][] results =platformClientUtil.getSqlQueryService(sql, ava);
+ String[][] results = platformClientUtil.getSqlQueryService(sql, ava);
if(results.length>0){
if(selectKeys==null) {
String selectSql = sql.substring(sql.toLowerCase(Locale.ROOT).indexOf("select") + 6, sql.toLowerCase(Locale.ROOT).indexOf(" from")).trim();
@@ -1345,35 +1365,32 @@
swapConditionMap(c,conditionMap);
//鑾峰彇瑕佹煡璇㈢殑鎵�鏈夌殑鍒�
Map<String,String> allFieldAttrMap = WebUtil.getFieldNameMap(c);
- if(!allFieldAttrMap.containsKey("lctid")){
- allFieldAttrMap.put("lctid","lctid");
+ //淇敼allFieldAttrMap闆嗗悎涓殑key鐨勫ぇ灏忓啓
+ List<String> queryAttr = new ArrayList<String>();
+ Iterator<String> it = allFieldAttrMap.keySet().iterator();
+ while(it.hasNext()){
+ queryAttr.add(it.next());
}
- List<String> queryAttr = new ArrayList<String>();
- Iterator<String> it = allFieldAttrMap.keySet().iterator();
- while(it.hasNext()){
- queryAttr.add(it.next());
- }
- for(String columnName:queryAttr){
- String fieldName = allFieldAttrMap.get(columnName);
- allFieldAttrMap.remove(columnName);
+ for(String columnName : queryAttr){
+ String fieldName = allFieldAttrMap.get(columnName);
+ allFieldAttrMap.remove(columnName);
allFieldAttrMap.put(columnName.toLowerCase(),fieldName);
}
+
List<T> allObject = new ArrayList<T>();
- List<BusinessObject> allCbos = queryCBO(WebUtil.getBtmTypeByObject(c), conditionMap, ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList()));//鎵ц鏌ヨ
- List<String> oids = new ArrayList<String>();
-
- if(allCbos!=null&&allCbos.size()>0){
+ List<String> clauseList = new ArrayList<>(allFieldAttrMap.keySet());
+
+ List<BusinessObject> allCbos = queryCBO(WebUtil.getBtmTypeByObject(c).toLowerCase(), conditionMap, ph, clauseList);
+ if(!CollectionUtils.isEmpty(allCbos)){
for(BusinessObject cbo : allCbos){
T obj = null;
try {
obj = c.newInstance();
- WebUtil.copyValueToObjectFromCbos(cbo, obj,allFieldAttrMap);//涓轰簡灏戝幓鏌ヨ涓�娆″瓧娈�
- } catch (InstantiationException e) {
+ WebUtil.copyValueToObjectFromCbos(cbo, obj, allFieldAttrMap);//涓轰簡灏戝幓鏌ヨ涓�娆″瓧娈�
+ } catch (Exception e) {
- } catch (IllegalAccessException e) {
}
if(obj !=null){
- oids.add(cbo.oid);
allObject.add(obj);
}
}
@@ -1453,6 +1470,7 @@
swapConditionMap(c,conditionMap);
//鑾峰彇瑕佹煡璇㈢殑鎵�鏈夌殑鍒�
Map<String,String> allFieldAttrMap = WebUtil.getFieldNameMap(c);
+ //淇敼allFieldAttrMap闆嗗悎涓殑key鐨勫ぇ灏忓啓
List<String> queryAttr = new ArrayList<String>();
Iterator<String> it = allFieldAttrMap.keySet().iterator();
while(it.hasNext()){
@@ -1463,18 +1481,18 @@
allFieldAttrMap.remove(columnName);
allFieldAttrMap.put(columnName.toLowerCase(),fieldName);
}
+ List<String> clauseList = new ArrayList<>(allFieldAttrMap.keySet());
List<T> allObject = new ArrayList<T>();
- List<BusinessObject> allCbos = queryCBOByScheme(queryScheme, conditionMap, replaceMap,ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList()));
+ List<BusinessObject> allCbos = queryCBOByScheme(queryScheme, conditionMap, replaceMap,ph, clauseList);
List<String> oids = new ArrayList<String>();
- if(allCbos!=null&&allCbos.size()>0){
+ if(allCbos != null && allCbos.size() > 0){
for(BusinessObject cbo : allCbos){
T obj = null;
try {
obj = c.newInstance();
WebUtil.copyValueToObjectFromCbos(cbo, obj,allFieldAttrMap);//涓轰簡灏戝幓鏌ヨ涓�娆″瓧娈�
- } catch (InstantiationException e) {
+ } catch (Exception e) {
- } catch (IllegalAccessException e) {
}
if(obj !=null){
oids.add(cbo.oid);
@@ -1598,12 +1616,10 @@
//缂栬緫鐨勬椂鍊欙紝TS鍜孫ID涓嶈兘璁剧疆.鍥犱负骞冲彴閭f帴鍙h缃簡灏变細鎶ラ敊
}else {
//闇�瑕佸垽鏂槸鍚﹂粯璁ょ殑灞炴�э紝濡傛灉鏄粯璁ゅ睘鎬э紝鍒欎娇鐢ㄥ璞$殑璧嬪�肩殑鏂瑰紡
- if (WebUtil.isDefaultField(fieldName) && WebUtil.inArray(new String[]{"id", "name", "description","lcstatus","revisionvalue","versionvalue"}, fieldName.toLowerCase())) {
- WebUtil.setValueToField(fieldName, cbo, value);
- ObjectTool.setBOAttributeValue(cbo, attrName.toLowerCase(), value);
- } else {
- ObjectTool.setBOAttributeValue(cbo, attrName.toLowerCase(), value);
+ if (WebUtil.isDefaultField(fieldName.toLowerCase()) && WebUtil.inArray(new String[]{"id", "name", "description","lcstatus","revisionvalue","versionvalue"}, fieldName.toLowerCase())) {
+ WebUtil.setValueToCboField(fieldName, cbo, value);
}
+ ObjectTool.setBOAttributeValue(cbo, attrName.toLowerCase(), value);
}
}
}
@@ -1752,13 +1768,20 @@
public <T> BatchCBO delete(T obj) throws VciBaseException {
return delete(obj,true);
}
+
+ /**
+ * 鍒犻櫎鏁版嵁锛屽彲浠ュ湪request閲岃缃笉鎸佷箙鍖�
+ * @param obj 鍒犻櫎鏁版嵁瀵硅薄
+ * @param checkRefered 鏄惁鍒犻櫎寮曠敤鐨勬暟鎹�
+ * @return 闇�瑕佸垱寤虹殑CBO,CLO;闇�瑕佷慨鏀圭殑CBO,CLO;闇�瑕佸垹闄ょ殑CBO,CLO
+ * @throws VciBaseException
+ */
@Override
public <T> BatchCBO delete(T obj,boolean checkRefered) throws VciBaseException{
List<T> list = new ArrayList<T>();
list.add(obj);
return batchDelete(list,checkRefered);
}
-
/**
* 鎵归噺鍒犻櫎鏁版嵁锛屽彲浠ュ湪request閲岃缃笉鎸佷箙鍖�
@@ -1796,9 +1819,8 @@
String btmType = WebUtil.getBtmTypeByObject(obj.getClass());
String pkValue = WebUtil.getValueFromFieldForCbo(pkField, obj);
//鎵�浠ヨ繖閲屼篃鏄洿鎺ユ煡璇㈢殑鍗曚釜'
- List<BusinessObject> deleteCbos = queryCBO(btmType, getOneQuery(
- WebUtil.getCboAttrNameFromField(pkField, obj.getClass()), pkValue));
- if(deleteCbos!=null){
+ List<BusinessObject> deleteCbos = queryCBO(btmType, getOneQuery(WebUtil.getCboAttrNameFromField(pkField, obj.getClass()), pkValue));
+ if(!CollectionUtils.isEmpty(deleteCbos)){
allDeleteCbos.addAll(deleteCbos);
if(!btmBos.containsKey(btmType)){
btmBos.put(btmType, deleteCbos);
@@ -1894,15 +1916,14 @@
conditionMap.put(QUERY_FILTER_SECRET,BooleanEnum.FASLE.getValue());//鏌ヨ鐨勬椂鍊欎笉鑳芥煡璇㈠瘑绾�
List<BusinessObject> allCbos = queryCBO(btmType, conditionMap);
BatchCBO batchCbo = new BatchCBO();
- if(allCbos.size()>0){
+ if(!CollectionUtils.isEmpty(allCbos)){
Map<String,List<BusinessObject>> btmBos = new HashMap<String, List<BusinessObject>>();
btmBos.put(btmType, allCbos);
checkCanDelete(btmBos);
- Set<BusinessObject> allDeleteCbos = new HashSet<BusinessObject>();
- allDeleteCbos.addAll(allCbos);
+ Set<BusinessObject> allDeleteCbos = new HashSet<BusinessObject>(allCbos);
batchCbo.setDeleteCbos(allDeleteCbos);
}
- if(allCbos.size()>0 && WebUtil.isPersistence()){
+ if(!CollectionUtils.isEmpty(allCbos) && WebUtil.isPersistence()){
persistenceBatch(batchCbo);
}
return batchCbo;
@@ -1931,7 +1952,7 @@
selectSql += ",btmname ";
}
sql = selectSql + fromSql;
- List<BusinessObject> allDelete =queryBySql(sql, conditionMap);
+ List<BusinessObject> allDelete = queryBySql(sql, conditionMap);
if(allDelete.size() == 0){
return batchCbo;//娌℃湁鍒犻櫎浠讳綍鏁版嵁
}
@@ -2002,7 +2023,6 @@
return queryGridByBo(btmType,conditionMap,new PageHelper(-1,true));
}
-
/**
* 鏍规嵁涓氬姟绫诲瀷鏉ユ煡璇㈠垪琛ㄦ暟鎹紱鍙互鍦╬ageHelper涓缃槸鍚︽煡璇㈡�绘暟
* @param btmType 涓氬姟绫诲瀷鍚嶇О
@@ -2015,7 +2035,7 @@
public DataGrid queryGridByBo(String btmType,
Map<String, String> conditionMap, PageHelper ph)
throws VciBaseException {
- return queryGridByBo(btmType,conditionMap,ph,null);
+ return queryGridByBo(btmType,conditionMap,ph,new ArrayList<String>());
}
/**
@@ -2037,7 +2057,7 @@
}
List<BusinessObject> allCbos = queryCBO(btmType, conditionMap, ph, clauseList);
DataGrid dg = new DataGrid();
- if(allCbos.size()>0){
+ if(!CollectionUtils.isEmpty(allCbos)){
List<Map> mapList = cbos2Map(allCbos);
dg.setData(mapList);
//鑲畾鏄綋鍓嶅垎椤垫湁鍊硷紝鎵嶄細鏈夋�绘暟
diff --git a/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/util/WebUtil.java b/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/util/WebUtil.java
index 0659902..e1037a1 100644
--- a/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/util/WebUtil.java
+++ b/Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/util/WebUtil.java
@@ -303,7 +303,7 @@
String jsonString = JSONObject.toJSONStringWithDateFormat(o, VciDateUtil.DateTimeMillFormat, SerializerFeature.WriteDateUseDateFormat);
if(StringUtils.isNotBlank(jsonString)) {
JSONObject jsonObject = JSONObject.parseObject(jsonString);
- if(jsonObject!=null){
+ if(jsonObject != null){
for(String key : jsonObject.keySet()){
map.put(key,jsonObject.get(key));
}
@@ -324,7 +324,7 @@
String jsonString = JSONObject.toJSONStringWithDateFormat(o, VciDateUtil.DateTimeMillFormat, SerializerFeature.WriteDateUseDateFormat);
if(StringUtils.isNotBlank(jsonString)) {
JSONObject jsonObject = JSONObject.parseObject(jsonString);
- if(jsonObject!=null){
+ if(jsonObject != null){
for(String key : jsonObject.keySet()){
map.put(key,jsonObject.getString(key));
}
@@ -457,7 +457,7 @@
Object key = it.next();
String newKey = key.toString().toLowerCase();
Object value = map.get(key);
- if(value !=null){
+ if(value != null){
if(value instanceof String && WebUtil.isNotNull(value.toString())){
unNullMap.put(newKey, value);
}else if(!(value instanceof String)){
@@ -476,7 +476,7 @@
public static Map<String,String> getReferAttrName(Class c){
Map<String,String> fieldMap = new HashMap<String, String>();
List<Field> allField = getAllFieldForObj(c);
- if(allField!=null&&allField.size()>0){
+ if(!CollectionUtils.isEmpty(allField)){
for(Field field : allField){
if (field.isAnnotationPresent(Transient.class)){
//鏈夊弬鐓ф垨鑰呮灇涓�
@@ -508,7 +508,7 @@
public static List<String> getReferBoAttrName(Class c,boolean isNotHasEnum){
List<String> fieldMap = new ArrayList<String>();
List<Field> allField = getAllFieldForObj(c);
- if(allField!=null&&allField.size()>0){
+ if(!CollectionUtils.isEmpty(allField)){
for(Field field : allField){
if (field.isAnnotationPresent(Transient.class)){
//鏈夊弬鐓ф垨鑰呮灇涓�
@@ -524,18 +524,18 @@
}
/**
- * 鑾峰彇瀵硅薄涓庝笟鍔$被鍨嬮噷鐨勫睘鎬ф槧灏�
- * @param c 瀵硅薄鎵�灞炵被
- * @return Map<String,String> 涓氬姟绫诲瀷鐨勫瓧娈碉細瀵硅薄涓婄殑灞炴��
+ * 鑾峰彇DO瀵硅薄涓庝笟鍔$被鍨嬮噷鐨勫睘鎬ф槧灏�
+ * @param c DO瀵硅薄鎵�灞炵被
+ * @return Map<String,String> 涓氬姟绫诲瀷鐨勫瓧娈�(key)锛欴O瀵硅薄涓婄殑灞炴��(value)
*/
- public static Map<String/*涓氬姟绫诲瀷涓殑瀛楁*/,String/*瀵硅薄涓婄殑灞炴��*/> getFieldNameMap(Class c){
+ public static Map<String/*涓氬姟绫诲瀷涓殑瀛楁*/,String/*DO瀵硅薄涓婄殑灞炴��*/> getFieldNameMap(Class c){
Map<String,String> fieldMap = new HashMap<String, String>();
List<Field> allField = getAllFieldForObj(c);
- if(allField!=null&&allField.size()>0){
+ if(!CollectionUtils.isEmpty(allField)){
for(Field field : allField){
if(!field.getName().equals("serialVersionUID")){
if(!field.isAnnotationPresent(Transient.class) ){
- String clientBoAttrName = getCboAttrNameFromField(field,c);
+ String clientBoAttrName = getCboAttrNameFromField(field, c);
fieldMap.put(clientBoAttrName, field.getName());
if(field.isAnnotationPresent(VciUseEnum.class)){
//杩欎釜鏄灇涓撅紝闇�瑕�
@@ -555,10 +555,10 @@
}
}
if(!CollectionUtils.isEmpty(fieldMap)){
- //鐪嬬湅鏈夋病鏈塶ull
+ //鐪嬬湅鏈夋病鏈塶ull锛岃繃婊ゆ帀value涓簄ull鐨�
Map<String,String> fieldMapNotNull = new HashMap<>();
fieldMap.forEach((key,value)->{
- if(value!=null){
+ if(value != null){
fieldMapNotNull.put(key,value);
}
});
@@ -608,14 +608,14 @@
if(!isFindColumn){
//鎵句竴涓婫et鏂规硶涓�..set鏂规硶涓婅偗瀹氭槸涓嶆敮鎸佺殑锛�
Method getMethod = getGetmethod(c, field);
- if(getMethod!=null && !getMethod.isAnnotationPresent(Transient.class)){
+ if(getMethod != null && !getMethod.isAnnotationPresent(Transient.class)){
if(getMethod.isAnnotationPresent(Column.class)){
String name = ((Column)getMethod.getAnnotation(Column.class)).name();
if(isNotNull(name)){
clientBoAttrName = name.toLowerCase();
}
}
- }else if(getMethod!=null && getMethod.isAnnotationPresent(Transient.class)){
+ }else if(getMethod != null && getMethod.isAnnotationPresent(Transient.class)){
//璇存槑涓嶆槸鎸佷箙鍖栫殑灞炴�э紝浣嗘槸浠庡钩鍙颁腑鏌ヨ鍑烘潵鍚庡彲鑳藉緱闇�瑕佹樉绀�
String referColumn = ((Transient)field.getAnnotation(Transient.class)).referColumn();
if(isNotNull(referColumn)){
@@ -623,7 +623,9 @@
}
}
}
- return VciQueryWrapperForDO.BASE_MODEL_COMPATIBILITY_MAP.getOrDefault(clientBoAttrName.toLowerCase(Locale.ROOT),clientBoAttrName);
+ //濡傛灉鐗堟湰鏈搴忓彿鐨勫睘鎬э紝闇�瑕佷粠灞炴�х殑鏄犲皠涓紝鑾峰彇涓氬姟绫诲瀷涓殑瀛楁鍚嶇О
+ clientBoAttrName = VciQueryWrapperForDO.BASEMODEL_CBO_FIELD_MAP.getOrDefault(clientBoAttrName.toLowerCase(Locale.ROOT),clientBoAttrName);
+ return clientBoAttrName;
}
/**
@@ -653,7 +655,7 @@
*/
public static Field getPkFieldForObj(Class c){
List<Field> allField = getAllFieldForObj(c);
- if(allField!=null&&allField.size()>0){
+ if(!CollectionUtils.isEmpty(allField)){
for(Field field : allField){
if(field.isAnnotationPresent(Id.class)){
return field;
@@ -676,7 +678,7 @@
*/
public static Field getTsField(Class c){
List<Field> allField = getAllFieldForObj(c);
- if(allField!=null&&allField.size()>0){
+ if(!CollectionUtils.isEmpty(allField)){
for(Field field : allField){
if(field.getName().equals("ts")){
return field;
@@ -707,10 +709,10 @@
*/
public static Field getFieldForObject(String fieldName,Class c){
List<Field> allField = getAllFieldForObj(c);
- if(allField!=null&&allField.size()>0){
+ if(!CollectionUtils.isEmpty(allField)){
for(Field field : allField){
if(field.getName().toLowerCase().equalsIgnoreCase(fieldName.toLowerCase())){
- return field;
+ return field;
}
}
}
@@ -748,12 +750,12 @@
* @return 鏂规硶
*/
public static Method getSetmethod(Class c,String fieldName){
- if(c!=null&&isNotNull(fieldName)){
+ if(c != null && isNotNull(fieldName)){
try {
PropertyDescriptor pd = new PropertyDescriptor(fieldName, c);
return pd.getWriteMethod();
- } catch (SecurityException e) {
- } catch (IntrospectionException e) {
+ } catch (Exception e) {
+ //TODO 涓嶅仛澶勭悊
}
}
return null;
@@ -770,8 +772,8 @@
try {
PropertyDescriptor pd = new PropertyDescriptor(fieldName, c);
return pd.getReadMethod();
- } catch (SecurityException e) {
- } catch (IntrospectionException e) {
+ } catch (Exception e) {
+ //TODO 涓嶅仛浠讳綍澶勭悊
}
}
return null;
@@ -813,89 +815,83 @@
* @param value 灞炴�у��
*/
public static void setValueForFieldFromCbo(String fieldName,Object obj,String value){
+ System.out.println("fieldName锛�"+fieldName+"锛寁alue锛�"+value);
try{
Field field = getFieldForObject(fieldName,obj);
- if(field!=null){
- field.setAccessible(true);
- Method setMethod = getSetmethod(field.getDeclaringClass(), fieldName);
- if(setMethod ==null) {
- logger.error(obj.getClass().getName() + "涓睘鎬�" + fieldName + "娌℃湁setter鏂规硶");
- }
- Class type = field.getType();
- //浠庡钩鍙拌鍙栧埌鐨勫�间笉浼氫负null锛屼负绌烘椂涓�""锛涙墍浠ヤ笉澶勭悊绌哄��
- if(type.equals(int.class) || type.equals(Integer.class)){
- int valueObj = getInt(value);
- if(setMethod !=null) {
- setMethod.invoke(obj,valueObj);
- }else{
- field.set(obj,valueObj);
- }
- }else if(type.equals(float.class) || type.equals(Float.class)){
- float valueObj = getFloat(value);
- if(setMethod !=null) {
- setMethod.invoke(obj, valueObj);
- }else{
- field.set(obj,valueObj);
- }
- }else if(type.equals(long.class) || type.equals(Long.class)){
- long valueObj = getLong(value);
- if(setMethod !=null) {
- setMethod.invoke(obj, valueObj);
- }else{
- field.set(obj,valueObj);
- }
- }else if(type.equals(Double.class) || type.equals(double.class)){
- double valueObj = getDouble(value);
- if(setMethod !=null) {
- setMethod.invoke(obj, valueObj);
- }else{
- field.set(obj,valueObj);
- }
- //浠庡钩鍙颁腑鏌ヨ鍑烘潵灏变笉鐢ㄥ鐞嗙簿搴︿簡锛屽洜涓哄钩鍙颁細鑷澶勭悊
- }else if(type.equals(Short.class) || type.equals(short.class)){
- short valueObject = getShort(value);
- if(setMethod !=null) {
- setMethod.invoke(obj, valueObject);
- }else{
- field.set(obj,valueObject);
- }
- }else if(type.equals(Date.class)){
- //骞冲彴瀹為檯瀛樺偍鐨勯兘鏄疶imestamp,涓嶈鏄棩鏈燂紝鏃ユ湡鏃堕棿锛岄兘鏄�傚鏋滀粎鏄椂闂达紝闇�瑕佺敤瀛楃涓叉潵瀛樺偍銆�
- Date d = null;
- if(StringUtils.isNotBlank(value)){
- try {
- if (value.indexOf("-") > -1 && value.indexOf(".") > -1 && value.indexOf(" ") > -1 && value.substring(value.lastIndexOf(".") + 1).length() == 9) {
- //2013-4-19.14.5. 45. 734000000 杩欑鏍煎紡锛岃繖涓湪浣跨敤SQL璇彞鐩存帴鏌ヨ鍑烘椂闂村瓧娈电殑鏃跺�欏氨浼氭樉绀烘垚杩欐牱
- String ymd = value.substring(0, value.indexOf("."));
- value = value.substring(value.indexOf(".") + 1);
- if (value.indexOf(".") > -1) {
- String hms = value.substring(0, value.lastIndexOf("."));
- String nano = value.substring(value.lastIndexOf(".") + 1).trim();
- hms = hms.replace(".", ":").replace(" ", "");
- Date tempDate = VciDateUtil.str2Date(ymd + " " + hms, "yyyy-M-d h:m:s");
- if (tempDate != null) {
- Timestamp ts = Timestamp.valueOf(VciDateUtil.date2Str(tempDate, VciDateUtil.DateTimeFormat) + "." + nano);
- d = ts;
- }
+ if(field != null){
+ field.setAccessible(true);
+ Method setMethod = getSetmethod(field.getDeclaringClass(), fieldName);
+ if(setMethod == null) {
+ logger.error(obj.getClass().getName() + "涓睘鎬�" + fieldName + "娌℃湁setter鏂规硶");
+ }
+ Class type = field.getType();
+ //浠庡钩鍙拌鍙栧埌鐨勫�间笉浼氫负null锛屼负绌烘椂涓�""锛涙墍浠ヤ笉澶勭悊绌哄��
+ if(type.equals(int.class) || type.equals(Integer.class)){
+ int valueObj = getInt(value);
+ if(setMethod != null) {
+ setMethod.invoke(obj,valueObj);
+ }else{
+ field.set(obj,valueObj);
+ }
+ }else if(type.equals(float.class) || type.equals(Float.class)){
+ float valueObj = getFloat(value);
+ if(setMethod != null) {
+ setMethod.invoke(obj, valueObj);
+ }else{
+ field.set(obj,valueObj);
+ }
+ }else if(type.equals(long.class) || type.equals(Long.class)){
+ long valueObj = getLong(value);
+ if(setMethod != null) {
+ setMethod.invoke(obj, valueObj);
+ }else{
+ field.set(obj,valueObj);
+ }
+ }else if(type.equals(Double.class) || type.equals(double.class)){
+ double valueObj = getDouble(value);
+ if(setMethod != null) {
+ setMethod.invoke(obj, valueObj);
+ }else{
+ field.set(obj,valueObj);
+ }
+ //浠庡钩鍙颁腑鏌ヨ鍑烘潵灏变笉鐢ㄥ鐞嗙簿搴︿簡锛屽洜涓哄钩鍙颁細鑷澶勭悊
+ }else if(type.equals(Short.class) || type.equals(short.class)){
+ short valueObject = getShort(value);
+ if(setMethod != null) {
+ setMethod.invoke(obj, valueObject);
+ }else{
+ field.set(obj,valueObject);
+ }
+ }else if(type.equals(Date.class)){
+ //骞冲彴瀹為檯瀛樺偍鐨勯兘鏄疶imestamp,涓嶈鏄棩鏈燂紝鏃ユ湡鏃堕棿锛岄兘鏄�傚鏋滀粎鏄椂闂达紝闇�瑕佺敤瀛楃涓叉潵瀛樺偍銆�
+ Date d = null;
+ if(StringUtils.isNotBlank(value)){
+ try {
+ if (value.indexOf("-") > -1 && value.indexOf(".") > -1 && value.indexOf(" ") > -1 && value.substring(value.lastIndexOf(".") + 1).length() == 9) {
+ //2013-4-19.14.5. 45. 734000000 杩欑鏍煎紡锛岃繖涓湪浣跨敤SQL璇彞鐩存帴鏌ヨ鍑烘椂闂村瓧娈电殑鏃跺�欏氨浼氭樉绀烘垚杩欐牱
+ String ymd = value.substring(0, value.indexOf("."));
+ value = value.substring(value.indexOf(".") + 1);
+ if (value.indexOf(".") > -1) {
+ String hms = value.substring(0, value.lastIndexOf("."));
+ String nano = value.substring(value.lastIndexOf(".") + 1).trim();
+ hms = hms.replace(".", ":").replace(" ", "");
+ Date tempDate = VciDateUtil.str2Date(ymd + " " + hms, "yyyy-M-d h:m:s");
+ if (tempDate != null) {
+ Timestamp ts = Timestamp.valueOf(VciDateUtil.date2Str(tempDate, VciDateUtil.DateTimeFormat) + "." + nano);
+ d = ts;
}
- } else if (value.matches("\\d+\\.?\\d*")) {
- //杩樻湁鍧戠埞鐨勬槸缁欑殑long鍨嬬殑瀛楃涓�
- d = new Date();
- d.setTime(getLong(value));
- } else {
- if(field.isAnnotationPresent(VciFieldType.class)) {
- VciFieldType vciFieldType = field.getAnnotation(VciFieldType.class);
- if(VciFieldTypeEnum.VTDate.equals(vciFieldType.value())) {
- d = VciDateUtil.str2Date(value, VciDateUtil.DateFormat);
- }else if(VciFieldTypeEnum.VTDateTime.equals(vciFieldType.value())){
- d = VciDateUtil.str2Date(value, VciDateUtil.DateTimeFormat);
- }else {
- if(value.indexOf("-") > -1 &&value.length() == 10 ) {
- d = VciDateUtil.str2Date(value, VciDateUtil.DateFormat);
- }else {
- d = VciDateUtil.str2Date(value, VciDateUtil.DateTimeMillFormat);
- }
- }
+ }
+ } else if (value.matches("\\d+\\.?\\d*")) {
+ //杩樻湁鍧戠埞鐨勬槸缁欑殑long鍨嬬殑瀛楃涓�
+ d = new Date();
+ d.setTime(getLong(value));
+ } else {
+ if(field.isAnnotationPresent(VciFieldType.class)) {
+ VciFieldType vciFieldType = field.getAnnotation(VciFieldType.class);
+ if(VciFieldTypeEnum.VTDate.equals(vciFieldType.value())) {
+ d = VciDateUtil.str2Date(value, VciDateUtil.DateFormat);
+ }else if(VciFieldTypeEnum.VTDateTime.equals(vciFieldType.value())){
+ d = VciDateUtil.str2Date(value, VciDateUtil.DateTimeFormat);
}else {
if(value.indexOf("-") > -1 &&value.length() == 10 ) {
d = VciDateUtil.str2Date(value, VciDateUtil.DateFormat);
@@ -903,34 +899,41 @@
d = VciDateUtil.str2Date(value, VciDateUtil.DateTimeMillFormat);
}
}
- }
- } catch (Exception e) {
- try {
- d = VciDateUtil.str2Date(value, VciDateUtil.DateTimeMillFormat);
- } catch (Exception e1) {
-
+ }else {
+ if(value.indexOf("-") > -1 &&value.length() == 10 ) {
+ d = VciDateUtil.str2Date(value, VciDateUtil.DateFormat);
+ }else {
+ d = VciDateUtil.str2Date(value, VciDateUtil.DateTimeMillFormat);
+ }
}
}
- }
- try {
- if(d != null ){
- if(setMethod !=null) {
- setMethod.invoke(obj, d);
- }else{
- field.set(obj,d);
- }
- }
- } catch (Exception e) {
- }
- }else if(type.equals(String.class)){
- if(setMethod != null) {
- setMethod.invoke(obj, value);
- }else{
- field.set(obj,value);
- }
- }else{
- logger.info("WebUtil.setValueForFieldForCbo:涓嶆敮鎸佺殑绫诲瀷" + type.toString());
- }
+ } catch (Exception e) {
+ try {
+ d = VciDateUtil.str2Date(value, VciDateUtil.DateTimeMillFormat);
+ } catch (Exception e1) {
+
+ }
+ }
+ }
+ try {
+ if(d != null ){
+ if(setMethod !=null) {
+ setMethod.invoke(obj, d);
+ }else{
+ field.set(obj,d);
+ }
+ }
+ } catch (Exception e) {
+ }
+ }else if(type.equals(String.class)){
+ if(setMethod != null) {
+ setMethod.invoke(obj, value);
+ }else{
+ field.set(obj,value);
+ }
+ }else{
+ logger.info("WebUtil.setValueForFieldForCbo:涓嶆敮鎸佺殑绫诲瀷" + type.toString());
+ }
}
}catch (Exception e) {
if(logger.isErrorEnabled()){
@@ -1009,7 +1012,7 @@
setMethod.invoke(targetObject, value);
}else{
Field field = getFieldForObject(fieldName, targetObject);
- if(field !=null){
+ if(field != null){
field.setAccessible(true);
field.set(targetObject, value);
}
@@ -1040,12 +1043,12 @@
if(isNotNull(fieldName)){
try {
Method getMethod = getGetmethod(sourceObject.getClass(), fieldName);
- if(getMethod !=null){
+ if(getMethod != null){
return getMethod.invoke(sourceObject);
}else{
//璇存槑娌℃湁璁剧疆getter锛屾瘮濡侭O鍜孡O瀵硅薄杩欑
Field field = getFieldForObject(fieldName, sourceObject);
- if(field !=null){
+ if(field != null){
field.setAccessible(true);
return field.get(sourceObject);
}
@@ -1089,7 +1092,7 @@
* @param fieldAttrMap 灞炴�ф槧灏�
*/
public static void copyValueToObjectFromCbos(BusinessObject cbo,Object obj,Map<String,String> fieldAttrMap){
- if(cbo!=null){
+ if(cbo != null){
copyValueToObjectFromBos(cbo,obj,fieldAttrMap);
}
}
@@ -1140,7 +1143,7 @@
* @param bo 涓氬姟鏁版嵁
* @param obj 瀵硅薄
*/
- public static void copyValueToObjectFromBos(com.vci.corba.omd.data.BusinessObject bo ,Object obj){
+ public static void copyValueToObjectFromBos(BusinessObject bo ,Object obj){
copyValueToObjectFromBos(bo,obj,null);
}
@@ -1150,59 +1153,63 @@
* @param obj 瀵硅薄
* @param fieldAttrMap 灞炴�ф槧灏�
*/
- public static void copyValueToObjectFromBos(com.vci.corba.omd.data.BusinessObject bo , Object obj, Map<String,String> fieldAttrMap){
- if(bo!=null && obj != null){
+ public static void copyValueToObjectFromBos(BusinessObject bo , Object obj, Map<String,String> fieldAttrMap){
+ if(bo != null && obj != null){
//鍏堟妸鎵�鏈夌殑瀛楁鏄犲皠鎵惧埌
if(fieldAttrMap == null){
fieldAttrMap = getFieldNameMap(obj.getClass());
}
- com.vci.corba.omd.data.AttributeValue[] newAList = bo.newAttrValList;
- com.vci.corba.omd.data.AttributeValue[] hisAList = bo.hisAttrValList;
+ AttributeValue[] newAList = bo.newAttrValList;
+ AttributeValue[] hisAList = bo.hisAttrValList;
//瑕佸厛鎶夿O瀵硅薄涓婄殑鍊兼嫹璐濊繃鍘�
List<Field> boFields = getAllFieldForObj(bo.getClass());
-
- if(boFields!=null){
- for(Field field :boFields){
- if(fieldAttrMap.containsKey(field.getName().toLowerCase())){
+ if(!CollectionUtils.isEmpty(boFields)){
+ for(Field field : boFields){
+ if(VciQueryWrapperForDO.BASEMODEL_CBO_FIELD_MAP.containsValue(field.getName().toLowerCase())){
//璇存槑杩欎釜灏辨槸鍦˙O瀵硅薄涓婄殑
Object value = getValueFromField(field.getName(), bo);
- if(value !=null){
- setValueForFieldFromCbo(fieldAttrMap.get(field.getName().toLowerCase()), obj, getStringValueFromObject(value));
+ if(value != null){
+ //BusinessObject鍜孊aseModel涓紝鏄惁绗竴鐗堟湰鐗堟鐨勫睘鎬э紝闇�瑕佸崟鐙鐞�
+ String fieldValue;
+ if(VciQueryWrapperForDO.BASE_MODEL_COMPATIBILITY_MAP.containsValue(field.getName().toLowerCase())){
+ fieldValue = getStringValueFromObject(value).equalsIgnoreCase("true")?"1":"0";
+ }else{
+ fieldValue = getStringValueFromObject(value);
+ }
+ setValueForFieldFromCbo(fieldAttrMap.get(field.getName().toLowerCase()), obj, fieldValue);
}
}
}
}
- if(newAList!=null&&newAList.length>0){
+ if(newAList != null && newAList.length > 0){
for(int i = 0 ; i < newAList.length;i++){
- com.vci.corba.omd.data.AttributeValue av = newAList[i];
+ AttributeValue av = newAList[i];
String attrName = av.name.toLowerCase();
if(fieldAttrMap.containsKey(attrName)) {
String fieldName = fieldAttrMap.get(attrName);
setValueForFieldFromCbo(fieldName, obj, av.value);
}else{
fieldAttrMap.forEach((cboField,fieldName)->{
- if(fieldName!=null && fieldName.equalsIgnoreCase(attrName) && cboField.contains(".")){
+ if(fieldName != null && fieldName.equalsIgnoreCase(attrName) && cboField.contains(".")){
//鍙傜収鐨勬椂鍊�
setValueForFieldFromCbo(fieldName, obj, av.value);
- return;
}
});
}
}
}
- if(hisAList!=null&&hisAList.length>0){
+ if(hisAList != null && hisAList.length > 0){
for(int i = 0 ; i < hisAList.length;i++){
- com.vci.corba.omd.data.AttributeValue av = hisAList[i];
+ AttributeValue av = hisAList[i];
String attrName = av.name.toLowerCase();
String fieldName = fieldAttrMap.get(attrName);
- if(fieldName!=null){
+ if(fieldName != null){
setValueForFieldFromCbo(fieldName, obj, av.value);
}else{
fieldAttrMap.forEach((cboField,field)->{
- if(field!=null && field.equalsIgnoreCase(attrName) && cboField.contains(".")){
+ if(field != null && field.equalsIgnoreCase(attrName) && cboField.contains(".")){
//鍙傜収鐨勬椂鍊�
setValueForFieldFromCbo(field, obj, av.value);
- return;
}
});
}
@@ -1217,7 +1224,7 @@
* @param map map
*/
public static void copyValueToMapFromCbos(BusinessObject cbo,Map<String,String> map){
- if(cbo!=null){
+ if(cbo != null){
copyValueToMapFromBos(cbo,map);
}
}
@@ -1227,21 +1234,21 @@
* @param bo 涓氬姟鏁版嵁
* @param map map
*/
- public static void copyValueToMapFromBos(com.vci.corba.omd.data.BusinessObject bo, Map<String,String> map){
+ public static void copyValueToMapFromBos(BusinessObject bo, Map<String,String> map){
if(bo!=null ){
//鍏堟妸鎵�鏈夌殑瀛楁鏄犲皠鎵惧埌
- com.vci.corba.omd.data.AttributeValue[] newAList = bo.newAttrValList;
- com.vci.corba.omd.data.AttributeValue[] hisAList = bo.hisAttrValList;
- if(hisAList!=null&&hisAList.length>0){//
+ AttributeValue[] newAList = bo.newAttrValList;
+ AttributeValue[] hisAList = bo.hisAttrValList;
+ if(hisAList != null && hisAList.length > 0){//
for(int i = 0 ; i < hisAList.length;i++){
- com.vci.corba.omd.data.AttributeValue av = hisAList[i];
+ AttributeValue av = hisAList[i];
String attrName = av.name.toLowerCase();
map.put(attrName, av.value);
}
}
- if(newAList!=null&&newAList.length>0){//NEW鐨勪紭鍏堢骇楂樹簺
+ if(newAList != null && newAList.length > 0){//NEW鐨勪紭鍏堢骇楂樹簺
for(int i = 0 ; i < newAList.length;i++){
- com.vci.corba.omd.data.AttributeValue av = newAList[i];
+ AttributeValue av = newAList[i];
String attrName = av.name.toLowerCase();
map.put(attrName, av.value);
}
@@ -1358,13 +1365,132 @@
if(value == null){
value = "";
}
- if(isDefaultField(key)){
- setValueToField(key, cbo, value);
+ if(isDefaultField(key.toLowerCase())){
+ //閲嶆柊鍗曠嫭澶勭悊銆傚洜涓築aseModel鐨勫熀纭�灞炴�у拰BusinessObject涓殑鏈夋墍宸紓
+ setValueToCboField(key.toLowerCase(), cbo, value);
}
ObjectTool.setBOAttributeValue(cbo,key.toLowerCase(), value);
}
}
}
+
+ /**
+ * 缁橞usinessObject瀵硅薄涓殑灞炴�ц缃��
+ * @param fieldName 琛ㄤ腑瀛楁鎴朌O瀵硅薄涓殑灞炴��
+ * @param bo BusinessObject
+ * @param value 灞炴�у��
+ */
+ public static void setValueToCboField(String fieldName, BusinessObject bo, String value){
+ switch (fieldName){
+ case "oid":
+ bo.oid = value;
+ break;
+ case "revisionoid":
+ bo.revoid = value;
+ break;
+ case "nameoid":
+ bo.nameoid = value;
+ break;
+ case "btmname":
+ bo.btName = value;
+ break;
+ case "lastr":
+ bo.isLastR = "1".equals(value);
+ break;
+ case "firstr":
+ bo.isFirstR = "1".equals(value);
+ break;
+ case "lastv":
+ bo.isLastV = "1".equals(value);
+ break;
+ case "firstv":
+ bo.isFirstV = "1".equals(value);
+ break;
+ case "creator":
+ bo.creator = value;
+ break;
+ case "createtime":
+ try {
+ long createTime = Long.parseLong(value);
+ bo.createTime = createTime;
+ } catch (NumberFormatException e) {
+ try {
+ bo.createTime = VciDateUtil.str2Date(value, VciDateUtil.DateTimeFormat).getTime();
+ } catch (Exception e2) {
+ //TODO
+ }
+ }
+ break;
+ case "lastmodifier":
+ bo.modifier = value;
+ break;
+ case "lastmodifytime":
+ try {
+ long lastModifyTime = Long.parseLong(value);
+ bo.modifyTime = lastModifyTime;
+ } catch (NumberFormatException e) {
+ try {
+ bo.modifyTime = VciDateUtil.str2Date(value, VciDateUtil.DateTimeFormat).getTime();
+ } catch (Exception e2) {
+ //TODO
+ }
+ }
+ break;
+ case "revisionrule":
+ bo.revisionRule = value;
+ break;
+ case "versionrule":
+ bo.versionRule = value;
+ break;
+ case "revisionseq":
+ bo.revisionSeq = Short.parseShort(value);
+ break;
+ case "revisionvalue":
+ bo.revisionValue = value;
+ break;
+ case "versionseq":
+ bo.versionSeq = Short.parseShort(value);
+ break;
+ case "versionvalue":
+ bo.versionValue = value;
+ break;
+ case "lctid":
+ bo.lctId = value;
+ break;
+ case "lcstatus":
+ bo.lcStatus = value;
+ break;
+ case "ts":
+ try {
+ long ts = Long.parseLong(value);
+ bo.ts = ts;
+ } catch (NumberFormatException e) {
+ try {
+ bo.ts = VciDateUtil.str2Date(value, VciDateUtil.DateTimeFormat).getTime();
+ } catch (Exception e2) {
+ //TODO
+ }
+ }
+ break;
+ case "id":
+ bo.id = value;
+ break;
+ case "name":
+ bo.name = value;
+ break;
+ case "description":
+ bo.description = value;
+ break;
+ case "owner":
+ bo.owner = value;
+ break;
+ case "copyfromversion":
+ bo.fromVersion = value;
+ break;
+ default:
+ break;
+ }
+ }
/**
* 鎷疯礉閾炬帴绫诲瀷鐨勫�煎埌map
@@ -1380,7 +1506,7 @@
if(value == null){
value = "";
}
- if(isDefaultField(key)){
+ if(isDefaultField(key.toLowerCase())){
setValueToField(key, clo, value);
}else {
ObjectTool.setLOAttributeValue(clo,key.toLowerCase(), value);
@@ -1420,7 +1546,7 @@
if(value==null){
value = "";
}
- if(isDefaultField(fieldName)){
+ if(isDefaultField(fieldName.toLowerCase())){
setValueToField(fieldName, cbo, value);
}
ObjectTool.setBOAttributeValue(cbo,attrName.toLowerCase(), value);
@@ -1434,8 +1560,7 @@
* @return true涓洪粯璁�
*/
public static boolean isDefaultField(String fieldNames){
- if(VciQueryWrapperForDO.BASIC_FIELD_MAP.containsKey(fieldNames) || VciQueryWrapperForDO.LIFECYCLE_MANAGE_FIELD_MAP.containsKey(fieldNames)
- || VciQueryWrapperForDO.REVISION_MANAGE_FIELD_MAP.containsKey(fieldNames) ) {
+ if(VciQueryWrapperForDO.BASEMODEL_CBO_FIELD_MAP.containsKey(fieldNames)) {
return true;
}
return false;
@@ -1729,4 +1854,20 @@
}
return BusinessObject;
}
+
+ /**
+ * 鑾峰彇瀵硅薄涓殑灞炴�ч泦鍚堛��
+ * @param tClass 瀵硅薄
+ * @return 灞炴�ч泦鍚圡ap銆俴ey锛氬睘鎬у悕绉帮紝value锛氬睘鎬�
+ */
+ public static Map<String, Field> getFieldMapForObject(Class tClass) {
+ Map<String, Field> fieldMap = new HashMap<>();
+ List<Field> allField = getAllFieldForObj(tClass);
+ if(!CollectionUtils.isEmpty(allField)){
+ for(Field field : allField){
+ fieldMap.put(field.getName(), field);
+ }
+ }
+ return fieldMap;
+ }
}
diff --git a/Source/plt-web/plt-web-parent/plt-web-permission/src/test/java/StrTest.java b/Source/plt-web/plt-web-parent/plt-web-permission/src/test/java/StrTest.java
new file mode 100644
index 0000000..4beb2c2
--- /dev/null
+++ b/Source/plt-web/plt-web-parent/plt-web-permission/src/test/java/StrTest.java
@@ -0,0 +1,32 @@
+import com.vci.web.util.WebUtil;
+
+import java.util.Locale;
+
+/**
+ * @Description
+ * @Author dangsn
+ * @Date 2024/12/3 17:07
+ */
+public class StrTest {
+ public static void main(String[] args) {
+ String sql = "select AA AS AB FROM dual";
+ String selectSql = sql.substring(sql.toLowerCase(Locale.ROOT).indexOf("select") + 6, sql.toLowerCase(Locale.ROOT).indexOf(" from")).trim();
+ String[] selectKeys = selectSql.split(",");
+ for(int j = 0 ; j < selectKeys.length; j ++){
+ String field = selectKeys[j];
+ if(WebUtil.isNotNull(field)){
+ //field = field.toLowerCase();
+ //鏈夊彲鑳芥湁as鐨勬儏鍐� 鎴栬�呯┖鏍� 鎴栬�呮湁.鐨勬儏鍐�
+ //蹇呴』浼樺厛澶勭悊as鍜岀┖鏍肩殑鎯呭喌锛屾渶鍚庡鐞�.
+ if(field.indexOf(" as ")>-1){
+ field = field.substring(field.lastIndexOf(" as ") + 4);
+ }else if(field.indexOf(" ")>-1){
+ field =field.substring(field.lastIndexOf(" ") + 1);
+ }else if(field.indexOf(".")>-1){
+ field = field.substring(field.lastIndexOf(".") + 1);
+ }
+ System.out.println(field);
+ }
+ }
+ }
+}
diff --git a/Source/plt-web/plt-web-parent/plt-web/pom.xml b/Source/plt-web/plt-web-parent/plt-web/pom.xml
index 12d5e13..58a217f 100644
--- a/Source/plt-web/plt-web-parent/plt-web/pom.xml
+++ b/Source/plt-web/plt-web-parent/plt-web/pom.xml
@@ -69,6 +69,13 @@
<artifactId>xstream</artifactId>
<version>1.4.10</version>
</dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/PlatformWebApplication.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/PlatformWebApplication.java
index 612dd98..331d2b0 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/PlatformWebApplication.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/PlatformWebApplication.java
@@ -8,6 +8,7 @@
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
+
import javax.annotation.PreDestroy;
import java.io.File;
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/test/java/BoServiceTest.java b/Source/plt-web/plt-web-parent/plt-web/src/test/java/BoServiceTest.java
new file mode 100644
index 0000000..e251203
--- /dev/null
+++ b/Source/plt-web/plt-web-parent/plt-web/src/test/java/BoServiceTest.java
@@ -0,0 +1,43 @@
+import com.vci.PlatformWebApplication;
+import com.vci.corba.omd.data.BusinessObject;
+import com.vci.starter.web.pagemodel.DataGrid;
+import com.vci.starter.web.wrapper.VciQueryWrapperForDO;
+import com.vci.web.service.WebBoServiceI;
+import com.vci.web.util.WebUtil;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description
+ * @Author dangsn
+ * @Date 2024/12/3 17:28
+ */
+@RunWith(SpringJUnit4ClassRunner.class)
+@SpringBootTest(classes = PlatformWebApplication.class)//搴旂敤鐨勪富绋嬪簭
+public class BoServiceTest {
+
+ @Resource
+ private WebBoServiceI boServiceI;
+
+ @Test
+ public void test(){
+ String sql = "select * from platformbtm_part where oid = 'E2ADEE0E-20F9-4CE2-A904-114460B01EB7'";
+ //List<BusinessObject> list = boServiceI.queryByOnlySql(sql);
+ //List<PartDO> list = boServiceI.queryByOnlySqlForObj(sql, PartDO.class);
+ Map<String, String> conditonMap = new HashMap<>();
+ conditonMap.put("oid", "E2ADEE0E-20F9-4CE2-A904-114460B01EB7");
+ List<PartDO> list = boServiceI.queryObject(PartDO.class, conditonMap);
+ //DataGrid dataGrid = boServiceI.queryGridByBo("part", conditonMap);
+ //DataGrid dataGrid = boServiceI.queryGridClass(PartDO.class, conditonMap);
+ //VciQueryWrapperForDO wrapper = new VciQueryWrapperForDO(conditonMap, PartDO.class);
+ //List<PartDO> list = boServiceI.selectByQueryWrapper(wrapper, PartDO.class);
+ System.out.println(WebUtil.getJSONStringWithDateFormat(list));
+ }
+}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/test/java/PartDO.java b/Source/plt-web/plt-web-parent/plt-web/src/test/java/PartDO.java
new file mode 100644
index 0000000..3dc8087
--- /dev/null
+++ b/Source/plt-web/plt-web-parent/plt-web/src/test/java/PartDO.java
@@ -0,0 +1,76 @@
+import com.vci.starter.web.annotation.Transient;
+import com.vci.starter.web.annotation.VciBtmType;
+import com.vci.starter.web.annotation.VciUseRefer;
+import com.vci.starter.web.constant.FrameWorkLcStatusConstant;
+import com.vci.starter.web.model.BaseModel;
+
+/**
+ * @Description
+ * @Author dangsn
+ * @Date 2024/12/9 11:05
+ */
+@VciBtmType(name = "part", lifeCycle = FrameWorkLcStatusConstant.RELEASE_LIFE_CYCLE)
+public class PartDO extends BaseModel {
+
+ private String code;
+
+ private int partType;
+
+ private double weight;
+
+ @VciUseRefer("workcontext")
+ private String ownProduct;
+
+ private double thickNess;
+
+ @Transient(referColumn = "ownProduct.name")
+ private String productName;
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ public int getPartType() {
+ return partType;
+ }
+
+ public void setPartType(int partType) {
+ this.partType = partType;
+ }
+
+ public double getWeight() {
+ return weight;
+ }
+
+ public void setWeight(double weight) {
+ this.weight = weight;
+ }
+
+ public String getOwnProduct() {
+ return ownProduct;
+ }
+
+ public void setOwnProduct(String ownProduct) {
+ this.ownProduct = ownProduct;
+ }
+
+ public double getThickNess() {
+ return thickNess;
+ }
+
+ public void setThickNess(double thickNess) {
+ this.thickNess = thickNess;
+ }
+
+ public String getProductName() {
+ return productName;
+ }
+
+ public void setProductName(String productName) {
+ this.productName = productName;
+ }
+}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/test/java/WebUtilTest.java b/Source/plt-web/plt-web-parent/plt-web/src/test/java/WebUtilTest.java
new file mode 100644
index 0000000..a1b648b
--- /dev/null
+++ b/Source/plt-web/plt-web-parent/plt-web/src/test/java/WebUtilTest.java
@@ -0,0 +1,28 @@
+import com.vci.corba.omd.data.BusinessObject;
+import com.vci.starter.web.util.VciBaseUtil;
+import com.vci.web.util.WebUtil;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description
+ * @Author dangsn
+ * @Date 2024/12/4 10:00
+ */
+public class WebUtilTest {
+ public static void main(String[] args) {
+ Map thisData = new HashMap();
+ thisData.put("btmname", "dangsn");
+ thisData.put("oid","XXXAAA");
+ thisData.put("createtime", "2024-12-09 10:10:10");
+ try {
+ Object o = VciBaseUtil.mapToBean(thisData, PartDO.class);
+ System.out.println(WebUtil.getJSONStringWithDateFormat(o));
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue b/Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue
index 6a10a70..bb493fa 100644
--- a/Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue
+++ b/Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue
@@ -119,10 +119,10 @@
// 鑾峰彇鏂囦欢鎵╁睍鍚�
const fileExtension = file.name.split(".").pop().toLowerCase(); // 杞崲涓哄皬鍐欎互閬垮厤澶у皬鍐欎笉鍖归厤鐨勯棶棰�
- if(this.paramVOS.fileType){
- if (!this.paramVOS.fileType.includes(fileExtension)) {
+ if(this.paramVOS.filetype){
+ if (!this.paramVOS.filetype.includes(fileExtension)) {
// 涓婁紶鏍煎紡涓嶇鍚堣姹傦紝鎻愮ず閿欒淇℃伅骞跺彇娑堜笂浼�
- this.$message.error(`鍙厑璁镐笂浼�${this.paramVOS.fileType.toString()}鏍煎紡鐨勬枃浠禶);
+ this.$message.error(`鍙厑璁镐笂浼�${this.paramVOS.filetype.toString()}鏍煎紡鐨勬枃浠禶);
return Promise.reject(false);
}
}
diff --git a/Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-table.vue b/Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-table.vue
index 0eba875..551742c 100644
--- a/Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-table.vue
+++ b/Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-table.vue
@@ -356,7 +356,7 @@
if (Object.keys(this.sourceData).length>0 && this.isShow) {
this.tableList = [];
this.loading = true;
- let url=''
+ let url='';
if(this.componentVO.bsCustQueryCLsOrUrl && this.componentVO.bsCustQueryCLsOrUrl.indexOf('/')!=-1){
url=this.componentVO.bsCustQueryCLsOrUrl;
}
diff --git a/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/DetailForm.vue b/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/DetailForm.vue
index b78c6e4..9e88315 100644
--- a/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/DetailForm.vue
+++ b/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/DetailForm.vue
@@ -158,7 +158,7 @@
const canvas = document.createElement('canvas')
const canvasContext = canvas.getContext('2d')
canvasContext.font = this.fontSize + 'px System'
- let label = model.label.replace('\n', '')
+ let label = model.label ? model.label.replace('\n', '') : '';
let sourceWidth = this.formModel.width
let sourceHeight = this.formModel.height
const spacing = 10
diff --git a/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/DetailPanel.vue b/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/DetailPanel.vue
index 4a616a4..849260d 100644
--- a/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/DetailPanel.vue
+++ b/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/DetailPanel.vue
@@ -8,7 +8,7 @@
label-width="80px"
size="mini"
>
- <el-form-item label="鍚嶇О" prop="id">
+ <el-form-item label="妯℃澘鍚嶇О" prop="id">
<el-input v-model.trim="newRowData.id" :disabled="!disabledBtn" :maxLength="20" clearable/>
</el-form-item>
<el-form-item label="鏍囩" prop="name">
@@ -108,9 +108,9 @@
saveEventList: []
},
rules: {
- name: [{required: true, message: "鍚嶇О涓嶈兘涓虹┖", trigger: "blur"}],
+ name: [{required: true, message: "鏍囩涓嶈兘涓虹┖", trigger: "blur"}],
id: [
- {required: true, message: "鏍囩涓嶈兘涓虹┖", trigger: "blur"},
+ {required: true, message: "鍚嶇О涓嶈兘涓虹┖", trigger: "blur"},
{
pattern: /^[A-z]+$/g,
message: "鏍囩鍙兘杈撳叆鑻辨枃",
@@ -185,7 +185,6 @@
color: #409eff;
background-color: #ecf5ff;
}
-
}
.event {
diff --git a/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/ItemPanel.vue b/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/ItemPanel.vue
index 7a76262..e7a92e8 100644
--- a/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/ItemPanel.vue
+++ b/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/ItemPanel.vue
@@ -1,29 +1,32 @@
<template>
<div class="item_panel_box">
- <el-input size="mini" placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText">
+ <el-input v-model="filterText" placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" size="mini">
</el-input>
<div class="box_item">
- <item-panel class="item-panel" v-loading="loading">
+ <item-panel v-loading="loading" class="item-panel">
<template v-for="(item, index) in nodeItems">
<item
:key="index"
- :type="item.type || 'node'"
- :size="item.size || '72*43'"
- :shape="item.shape || 'flow-rect'"
:model="{
// must have model property
color: item.color || '#1890FF',
label: item.id || '鑺傜偣'
}"
+ :shape="item.shape || 'flow-rect'"
+ :size="item.size || '72*43'"
+ :type="item.type || 'node'"
>
<template v-if="item.src">
<div class="item item-img">
- <img :src="item.src" :alt="item.id" />
+ <img :alt="item.id" :src="item.src"/>
</div>
</template>
<template v-else>
<div :class="'item item-' + (item.shape || 'flow-rect')">
- <span>{{ item.id }}</span>
+ <el-tooltip v-if="item.id.length > 9" :content="item.id" effect="light" placement="top">
+ <span class="spanValue">{{ item.id }}</span>
+ </el-tooltip>
+ <span v-else>{{ item.id }}</span>
</div>
</template>
</item>
@@ -34,16 +37,16 @@
</template>
<script>
-import { Item, ItemPanel } from 'vue-flowchart-editor'
+import {Item, ItemPanel} from 'vue-flowchart-editor'
// import { getPage } from '../../../api/omd/status'
export default {
name: 'EditorItemPanel',
- components: { ItemPanel, Item },
+ components: {ItemPanel, Item},
props: {
- nodeItems:{
- type:Array,
- default:() => [],
+ nodeItems: {
+ type: Array,
+ default: () => [],
}
},
data() {
@@ -118,4 +121,10 @@
.item-img {
max-width: 100px;
}
+
+.spanValue {
+ white-space: nowrap; // 闃叉鎹㈣
+ overflow: hidden; //闅愯棌瓒呭嚭閮ㄥ垎
+ text-overflow: ellipsis; //鏄剧ず鐪佺暐鍙�
+}
</style>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
index c044f35..5a2a9f3 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
@@ -1,6 +1,5 @@
<template>
<el-container>
-
<el-aside>
<basic-container>
<div ref="TreeBox" style="height: calc(100vh - 144px);!important;">
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Icons/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Icons/index.vue
new file mode 100644
index 0000000..8029910
--- /dev/null
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Icons/index.vue
@@ -0,0 +1,49 @@
+<template>
+ <el-container>
+ <el-main>
+ <basic-container>
+ <div class="tag-group">
+ <span class="tag-group__title">鍒嗙被</span>
+ <el-tag
+ v-for="item in types"
+ :key="item"
+ :type="checkedTypes.includes(item)?'success':'info'" size="small"
+ effect="plain" @click="changeType(item)">
+ {{ item }}
+ </el-tag>
+ </div>
+ <div>
+ </div>
+ </basic-container>
+ </el-main>
+ </el-container>
+</template>
+
+<script>
+export default {
+name: "index",
+ data() {
+ return {
+ types: ['鏍囩涓�' , '鏍囩浜�' , '鏍囩涓�' , '鏍囩鍥�','鏍囩浜�' ],
+ checkedTypes:[]
+ }
+ },
+ methods:{
+ changeType(type){
+ if(this.checkedTypes.includes(type)){
+ this.checkedTypes=this.checkedTypes.filter(item=> item!=type)
+ }else {
+ this.checkedTypes.push(type)
+ }
+ }
+ }
+}
+</script>
+
+<style scoped>
+.tag-group{font-size: 14px;}
+.el-tag{
+ margin: 0 0 10px 10px;
+ cursor: pointer;
+}
+</style>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
index f67bc3d..02ed624 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
@@ -1026,6 +1026,7 @@
],
form: {},
topForm: {
+ itemQtName:'',
columnNumber: 8,
showColumn: '3',
viName: '',
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
index c1df775..8f4a109 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
@@ -604,6 +604,7 @@
dicUrl: '/api/uiManagerController/getBtmDatasByPage?page=1&limit=-1',
filterable: true,
change: (val) => {
+ console.log('showTypeChangeFlag',this.showTypeChangeFlag)
if (val.value) {
let params = {
'conditionMap[selectBtmType]': this.form.searchTarger === '1' ? this.form.showType : this.form.linkType
@@ -916,6 +917,8 @@
// 澧炲姞鍏抽棴瀵硅瘽妗� 娓呯┖event鏁扮粍
beforeClose(done) {
this.eventData = [];
+ this.showTypeChangeFlag = false;
+ this.linkTypeChangeFlag = false;
done();
},
@@ -935,6 +938,7 @@
};
});
}
+ console.log('row',row);
this.searchTargerChangeFlag = false;
this.$refs.crud.rowEdit(row);
},
--
Gitblit v1.9.3