From 336265194a47bcbdbd5f8d2274d10a6284ee1246 Mon Sep 17 00:00:00 2001
From: mamc <1428594221@qq.com>
Date: 星期三, 28 六月 2023 14:43:26 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
index b3a2929..4d865ed 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -196,7 +196,7 @@
String field=codetemplateAttr.getId();
String name=codetemplateAttr.getName();
CodeClassifyTemplateAttrVO codeBaseAttributeDTO=new CodeClassifyTemplateAttrVO();
- boolean res=codetemplateAttr.getAttributeGroup().equals(BATCHADD_EXCEPORT_ATTR_TYPE)//鍩烘湰灞炴�у瓧娈垫樉绀�
+ boolean res=(StringUtils.isNotBlank(codetemplateAttr.getAttributeGroup())&& codetemplateAttr.getAttributeGroup().equals(BATCHADD_EXCEPORT_ATTR_TYPE))//鍩烘湰灞炴�у瓧娈垫樉绀�
||(StringUtils.isNotBlank(codetemplateAttr.getKeyAttrFlag())&&Boolean.parseBoolean(codetemplateAttr.getKeyAttrFlag()))//鍏抽敭灞炴�х殑瀛樺叆
||(StringUtils.isNotBlank(codetemplateAttr.getSameRepeatAttrFlag())&&Boolean.parseBoolean(codetemplateAttr.getSameRepeatAttrFlag())) //鐩镐技灞炴�х殑瀛樺叆
||(StringUtils.isNotBlank(codetemplateAttr.getRequireFlag())&&Boolean.parseBoolean(codetemplateAttr.getRequireFlag()));
@@ -759,7 +759,7 @@
* @return 鏈夐敊璇俊鎭殑excel
*/
@Override
- public CodeImProtRusultVO batchImportHistoryData(String codeClassifyOid, String classifyAttr,File file) {
+ public CodeImProtRusultVO batchImportHistoryData(String codeClassifyOid, String classifyAttr,File file) throws Throwable{
VciBaseUtil.alertNotNull(codeClassifyOid,"鍒嗙被鐨勪富閿�");
ReadExcelOption reo = new ReadExcelOption();
reo.setReadAllSheet(true);
@@ -1895,9 +1895,30 @@
getFieldIndexMap(titleRowData, attrNameIdMap, fieldIndexMap);
Map<String, String> cboOidMap = new HashMap<>();
cboOidMap.put("id", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(codeDataMap.keySet().toArray(new String[0])) + ")");
- R<BtmTypeVO> r= btmTypeClient.getDetail(templateVO.getBtmTypeId());
- BtmTypeVO btmTypeVO =r.getData();
- String tableName=btmTypeVO.getTableName();
+ String tableName ="";
+ try {
+ R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(templateVO.getBtmTypeId());
+ if(r.getCode()!=200) {
+ throw new Throwable(r.getMsg());
+ }
+ BtmTypeVO btmTypeVO = r.getData();
+ if (btmTypeVO == null) {
+ throw new Throwable("鏍规嵁涓氬姟绫诲瀷鏈煡璇㈠埌涓氬姟绫诲瀷瀵硅薄锛�");
+ }
+ tableName = btmTypeVO.getTableName();
+ if (StringUtils.isBlank(tableName)) {
+ throw new Throwable("鏍规嵁涓氬姟绫诲瀷鏈煡璇㈠埌涓氬姟绫诲瀷鐩稿叧鑱旂殑琛�");
+ }
+ }catch (Throwable e){
+ log.error("鏌ヨ涓氬姟瀵硅薄琛�"+e);
+ XMLResultDataObjectDetailDO xmlResultDataObjectDetailDO=new XMLResultDataObjectDetailDO();
+ xmlResultDataObjectDetailDO.setErrorid("103");
+ xmlResultDataObjectDetailDO.setMsg("鏌ヨ涓氬姟瀵硅薄琛�"+e);
+ xmlResultDataObjectDetailDO.setId("");
+ xmlResultDataObjectDetailDO.setCode("");
+ resultDataObjectDetailDOs.add(xmlResultDataObjectDetailDO);
+ return;
+ }
StringBuffer sb=new StringBuffer();
sb.append(" select * from ");
@@ -2978,21 +2999,35 @@
* @param cboList 鏁版嵁鐨勫垪琛�
* @param errorMap 閿欒鐨勪俊鎭�
*/
- private void batchCheckIdExistOnOrder(CodeClassifyTemplateVO templateVO,List<ClientBusinessObject> cboList,Map<String ,String> errorMap){
+ private void batchCheckIdExistOnOrder(CodeClassifyTemplateVO templateVO,List<ClientBusinessObject> cboList,Map<String ,String> errorMap) throws Throwable{
List<String> existIds = new ArrayList<>();
+ String tableName ="";
+ try {
+ R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(templateVO.getBtmTypeId());
+ if(r.getCode()!=200) {
+ throw new Throwable(r.getMsg());
+ }
+ BtmTypeVO btmTypeVO = r.getData();
+ if (btmTypeVO == null) {
+ throw new Throwable("鏍规嵁涓氬姟绫诲瀷鏈煡璇㈠埌涓氬姟绫诲瀷瀵硅薄锛�");
+ }
+ tableName = btmTypeVO.getTableName();
+ if (StringUtils.isBlank(tableName)) {
+ throw new Throwable("鏍规嵁涓氬姟绫诲瀷鏈煡璇㈠埌涓氬姟绫诲瀷鐩稿叧鑱旂殑琛�");
+ }
+ }catch (Throwable e){
+ throw e;
+ }
+ String finalTableName = tableName;
VciBaseUtil.switchCollectionForOracleIn(cboList).stream().forEach(cbos -> {
Map<String, String> conditionMap = new HashMap<>();
conditionMap.put("id", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(cbos.stream().map(s -> s.getId()).collect(Collectors.toSet()).toArray(new String[0])) + ")");
- R<BtmTypeVO> r= btmTypeClient.getDetail(templateVO.getBtmTypeId());
- BtmTypeVO btmTypeVO =r.getData();
- String tableName=btmTypeVO.getTableName();
-
StringBuffer sb=new StringBuffer();
sb.append(" select id from ");
- sb.append(tableName);
+ sb.append(finalTableName);
sb.append(" where 1=1 ");
- sb.append(" id in (");
+ sb.append(" and id in (");
sb.append(VciBaseUtil.toInSql(cbos.stream().map(s -> s.getId()).collect(Collectors.toSet()).toArray(new String[0])));
sb.append(")");
List<String> idList= commonsMapper.selectById(sb.toString());
--
Gitblit v1.9.3