From 8b34692ac1b7cf58a1e1ead92b930d9acb9f86f6 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期三, 02 八月 2023 00:18:29 +0800
Subject: [PATCH] PDM集成swing界面相关功能开发
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java | 78 ++++++++++++++++++++++++++++++++------
1 files changed, 65 insertions(+), 13 deletions(-)
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
index 8f9a618..8f93c96 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -425,6 +425,8 @@
// //璁剧疆缂栫爜闇�瑕佺殑榛樿灞炴�х殑鍐呭
copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, false);
cbo.setOid(VciBaseUtil.getPk());
+ cbo.setRevisionOid(VciBaseUtil.getPk());
+ cbo.setNameOid(VciBaseUtil.getPk());
cbo.setCreateTime(new Date());
cbo.setLastModifyTime(new Date());
cbo.setCreator(AuthUtil.getUser().getUserName());
@@ -740,7 +742,7 @@
conditionMap.put(queryKey, queryValue);
} else {
//涓虹┖鐨勬椂鍊欎笉浠h〃涓嶆牎楠岋紝鍙槸涓嶅幓闄ょ浉鍏崇殑淇℃伅
- conditionMap.put("t." + attrId, value);
+ conditionMap.put("t." + attrId, "'" +value+ "'");
}
}
}
@@ -1409,7 +1411,16 @@
public DataGrid<Map<String, String>> queryGrid(String btmType, CodeClassifyTemplateVO templateVO, Map<String, String> conditionMap, PageHelper pageHelper) {
CodeTemplateAttrSqlBO sqlBO = getSqlByTemplateVO(btmType, templateVO, conditionMap, pageHelper);
// List<Map> maps = boService.queryByOnlySqlForMap(sqlBO.getSqlHasPage());
- List<Map<String, String>> maps = commonsMapper.queryByOnlySqlForMap(sqlBO.getSqlHasPage());
+ List<Map<String, String>> maps = null;
+ try {
+ maps = commonsMapper.queryByOnlySqlForMap(sqlBO.getSqlHasPage());
+ }catch (Exception e){
+ String errorMessage = e.getMessage();
+ if (errorMessage.contains("鏃犳硶瑙f瀽鐨勬垚鍛樿闂〃杈惧紡")) {
+ throw new ServiceException("缂哄皯"+errorMessage.substring(errorMessage.indexOf("[t.") + 1, errorMessage.indexOf("]"))+"瀛楁");
+ }
+ throw new ServiceException(e.getMessage());
+ }
DataGrid<Map<String, String>> dataGrid = new DataGrid<>();
List<Map<String, String>> dataList = new ArrayList<>();
@@ -3287,7 +3298,7 @@
throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲瀛楁淇℃伅锛岃妫�鏌ワ紒");
}
Set<String> existFild = allAttributeByBtmId.getData().getAttributes().stream().map(btmTypeAttributeVO -> {
- return btmTypeAttributeVO.getId();
+ return btmTypeAttributeVO.getId().toLowerCase();
}).collect(Collectors.toSet());
//灏哹ean杞负map,mybatis缁熶竴澶勭悊
List<Map<String, String>> maps = new ArrayList<>();
@@ -3374,7 +3385,7 @@
if (!listR.isSuccess() || listR.getData().size() == 0) {
throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
}
- String userName = String.valueOf(AuthUtil.getUser().getUserId());
+// String userName = String.valueOf(AuthUtil.getUser().getUserId());
BaseModel bo = new BaseModel();
// bo.setOid(VciBaseUtil.getPk());
// bo.setRevisionid(VciBaseUtil.getPk());
@@ -3384,16 +3395,16 @@
bo.setFirstR("1");
bo.setFirstV("1");
bo.setLastV("1");
- bo.setCreator(userName);
- bo.setCreateTime(new Date());
- bo.setLastModifier(userName);
- bo.setLastModifyTime(new Date());
bo.setRevisionRule(listR.getData().get(0).getRevisionRuleId());
- bo.setVersionRule(String.valueOf(listR.getData().get(0).getVersionRule()));
+ bo.setVersionRule("".equals(listR.getData().get(0).getVersionRule())?"0":listR.getData().get(0).getVersionRule());
if (StringUtils.isNotBlank(listR.getData().get(0).getRevisionRuleId())) {
R<List<RevisionRuleVO>> revisionRuleVO = revisionRuleClient
- .selectByIdCollection(Collections.singletonList(listR.getData().get(0).getRevisionRuleId()));
- bo.setRevisionValue(revisionRuleVO.getData().get(0).getStartCode());
+ .selectByIdCollection(Collections.singletonList(listR.getData().get(0).getRevisionRuleId().toLowerCase()));
+ if(revisionRuleVO.getData().size() != 0 ){
+ bo.setRevisionValue(revisionRuleVO.getData().get(0).getStartCode());
+ }else{
+ bo.setRevisionValue("1");
+ }
}
bo.setRevisionSeq(1);
bo.setVersionSeq(1);
@@ -3406,7 +3417,7 @@
bo.setId("");
bo.setName("");
bo.setDescription("");
- bo.setOwner(userName);
+ bo.setOwner("1");
// bo.setCheckinby(userName);
bo.setCopyFromVersion("");
// this.initTypeAttributeValue(bo,btmTypeVO);
@@ -3661,7 +3672,48 @@
} else {
if (StringUtils.isNotBlank(referConfigVO.getParentFieldName()) && StringUtils.isNotBlank(queryObject.getParentOid())) {
queryObject.getConditionMap().put(referConfigVO.getParentFieldName(), queryObject.getParentOid());
- }
+ //鏌ヨ鍏ㄩ儴鐨勪俊鎭�
+ String parentOidSql = "";
+ if (StringUtils.isNotBlank(referConfigVO.getParentValue())) {
+ String temp = referConfigVO.getParentValue();
+ if (temp.startsWith(QueryOptionConstant.IN)) {
+ temp = temp.substring((QueryOptionConstant.IN).length()).trim();
+ parentOidSql = " in " + "('" + queryObject.getParentOid() + "')";
+ } else if (temp.startsWith(QueryOptionConstant.NOTIN)) {
+ parentOidSql = " not in " + "('" + queryObject.getParentOid() + "')";
+ } else if (temp.startsWith(QueryOptionConstant.NOTEQUAL)) {
+ temp = temp.substring((QueryOptionConstant.NOTEQUAL).length()).trim();
+ parentOidSql = QueryOptionConstant.NOTEQUAL + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'");
+ } else if (temp.startsWith(QueryOptionConstant.MORETHAN)) {
+ temp = temp.substring((QueryOptionConstant.MORETHAN).length()).trim();
+ parentOidSql = QueryOptionConstant.MORETHAN + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'");
+ } else if (temp.startsWith(QueryOptionConstant.MORE)) {
+ temp = temp.substring((QueryOptionConstant.MORE).length()).trim();
+ parentOidSql = QueryOptionConstant.MORE + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'");
+ } else if (temp.startsWith(QueryOptionConstant.LESSTHAN)) {
+ temp = temp.substring((QueryOptionConstant.LESSTHAN).length()).trim();
+ parentOidSql = QueryOptionConstant.LESSTHAN + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'");
+ } else if (temp.startsWith(QueryOptionConstant.LESS)) {
+ temp = temp.substring((QueryOptionConstant.LESS).length()).trim();
+ parentOidSql = QueryOptionConstant.LESS + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'");
+ } else if (temp.startsWith(QueryOptionConstant.ISNOTNULL)) {
+ parentOidSql = " is not null";
+ } else if (temp.startsWith(QueryOptionConstant.ISNULL)) {
+ parentOidSql = " is null";
+ } else if (temp.contains("*")) {
+ parentOidSql = " like " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'").replace("*", "%");
+ } else {
+ parentOidSql = " = " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'");
+ }
+
+ }
+ //鏌ヨ鍏ㄩ儴鐨勪俊鎭�
+ queryObject.getConditionMap().put("oid", QueryOptionConstant.IN + "(select oid from " +
+ getTableName(referConfigVO.getReferType()) +
+ " START WITH " + referConfigVO.getParentFieldName() + " " +
+ parentOidSql +
+ " CONNECT BY PRIOR " + oidFieldName + " = " + referConfigVO.getParentFieldName() + ")");
+ }
}
LambdaQueryWrapper<CodeClassify> lqw = new LambdaQueryWrapper<>();
String sql = queryObject.getConditionMap().get("oid").substring(3);
--
Gitblit v1.9.3