From cb41c6645777148f78788b369a6f66ecbdc7111a Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 03 一月 2024 16:14:10 +0800
Subject: [PATCH] 整合代码
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java | 43 ++++++++++++++++++++++++++++++++-----------
1 files changed, 32 insertions(+), 11 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 3bb6a3e..9ea8b4d 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
@@ -88,6 +88,8 @@
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
@@ -454,8 +456,14 @@
throw new VciBaseException("鏇存柊鏁版嵁鍑洪敊锛岄噸璇曪紒"+r.getMsg());
}
}
+ // 鍒氬ソ椤哄簭鏄竴鑷寸殑锛屾墍浠ョ洿鎺ユ寜鐓odeallcode鐨勯『搴忔潵鎷夸笟鍔℃暟鎹�
+ int i = -1;
for (CodeAllCode codeCbo : codeCbos) {
codeCbo.setLcStatus(baseModelDTO.getLcStatus());
+ // 濡傛灉鏄洖鏀讹紝灏遍渶瑕佸皢涓氬姟鏁版嵁瀛樺偍鍒扮爜鍊艰〃涓�
+ if(baseModelDTO.getLcStatus().equals(FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_TAKEBACK)){
+ codeCbo.setBusinessData(JSON.toJSONString(baseModels.get(++i)));
+ }
}
codeAllCodeService.updateBatchById(codeCbos);
@@ -1166,10 +1174,7 @@
"order by to_char(CREATETIME, 'mm')";
//鏌ヨ鍑洪渶瑕佸鐞嗙殑鏁版嵁
List<Map> maps = commonsMapper.selectBySql(sql);
- if(maps.size() == 0){
- throw new ServiceException("浼犲叆绫诲瀷["+ datum.getName() + ":" +
- datum.getId() +"]鏈煡鍒扮浉鍏崇粺璁℃暟鎹紝璇风‘璁�!!!!");
- }
+
//褰撳勾姣忔湀鏈堜唤涔嬪墠涔嬪拰
List<Integer> monthCount = new ArrayList<>(12);
//褰撳勾姣忔湀鐨勬湀浠芥暟鎹�
@@ -1177,12 +1182,16 @@
//鑾峰彇褰撳墠鏈堢殑鏁板瓧
Calendar instance = Calendar.getInstance();
int nowmonth = instance.get(Calendar.MONTH) + 1;
+ if(maps.size() == 0){
+ nowmonth = 0;
+ }
//浠�1鍒�12鏈堣繘琛屽鐞�
for (Integer i = 1; i <= 12; i++) {
//褰撳墠鏈堝悗鎵�鏈夋暟鎹缃负0
if(i>nowmonth){
monthCount.add(0);
month.add(0);
+ continue;
}
//褰撳墠鏈堜唤涔嬪墠涔嬪拰
Integer count = 0;
@@ -2587,12 +2596,24 @@
}
DateConverter dateConverter = new DateConverter();
if (VciFieldTypeEnum.VTDateTime.equals(fieldTypeEnum)) {
- //瀹為檯涓婏紝鏁版嵁搴撻兘鏄痶imestamp鐨勭被鍨�.
- dateConverter.setAsText(value);
- return "to_date('" + dateConverter.getAsText(VciDateUtil.DateTimeFormat) + "','" + DATETIME_FORMAT + "')";
+ //瀹為檯涓婏紝鏁版嵁搴撻兘鏄痶imestamp鐨勭被鍨�. TODO:铏界劧娌¤兘瑙e喅鏌ヨ鏃ユ湡鐨勯棶棰橈紝浣嗘槸鑳芥殏鏃惰В鍐虫姤閿欓棶棰�
+ if(value.contains("*")){
+ value = value.replace("*","%");
+ return "'" + value + "'";
+ }else{
+ value = value.replace("*","");
+ dateConverter.setAsText(value);
+ return "to_date('" + dateConverter.getAsText(VciDateUtil.DateTimeFormat) + "','" + DATETIME_FORMAT + "')";
+ }
} else if (VciFieldTypeEnum.VTDate.equals(fieldTypeEnum)) {
- dateConverter.setAsText(value);
- return "to_date('" + dateConverter.getAsText(VciDateUtil.DateFormat) + "','" + DATE_FORMAT + "')";
+ if(value.contains("*")){
+ value = value.replace("*","%");
+ return "'" + value + "'";
+ }else {
+ value = value.replace("*","");
+ dateConverter.setAsText(value);
+ return "to_date('" + dateConverter.getAsText(VciDateUtil.DateFormat) + "','" + DATE_FORMAT + "')";
+ }
} else if (VciFieldTypeEnum.VTDouble.equals(fieldTypeEnum)
|| VciFieldTypeEnum.VTLong.equals(fieldTypeEnum)
|| VciFieldTypeEnum.VTInteger.equals(fieldTypeEnum)) {
@@ -4196,7 +4217,7 @@
bo.setFirstV("1");
bo.setLastV("1");
bo.setRevisionRule(listR.getData().get(0).getRevisionRuleId());
- bo.setVersionRule("".equals(listR.getData().get(0).getVersionRule())?"0":listR.getData().get(0).getVersionRule());
+ bo.setVersionRule("".equals(listR.getData().get(0).getVersionRule())?"1":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().toLowerCase()));
@@ -4217,7 +4238,7 @@
bo.setId("");
bo.setName("");
bo.setDescription("");
- bo.setOwner("1");
+ bo.setOwner(AuthUtil.getUser().getUserId().toString());
// bo.setCheckinby(userName);
bo.setCopyFromVersion("");
// this.initTypeAttributeValue(bo,btmTypeVO);
--
Gitblit v1.9.3