From a3b63fbbfbf5ba059299887b9fa2ba1dd897659c Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期四, 28 九月 2023 14:15:25 +0800
Subject: [PATCH] 本地提交
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java | 60 +++++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 41 insertions(+), 19 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 cb60e19..fc00023 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
@@ -179,7 +179,7 @@
* @return excel鐨勬枃浠跺湴鍧�
*/
@Override
- public String downloadTopImportExcel(String codeClassifyOid){
+ public String downloadTopImportExcel(String codeClassifyOid){
List<CodeClassifyTemplateVO> templateVOList=new ArrayList<>();
VciBaseUtil.alertNotNull("瀵煎嚭妯℃澘","瀵煎嚭鐨勯厤缃�",codeClassifyOid,"涓婚搴撳垎绫荤殑涓婚敭");
CodeClassifyVO codeClassifyVO = classifyService.getObjectByOid(codeClassifyOid);
@@ -389,9 +389,9 @@
&& (isHistory || VciBaseUtil.getBoolean(s.getFormDisplayFlag()))
).collect(Collectors.toList());
- if (CollectionUtils.isEmpty(templateAttrVOS)) {
- throw new VciBaseException("妯℃澘娌℃湁閰嶇疆浠讳綍銆愯〃鍗曟樉绀恒�戜负銆愭槸銆戠殑灞炴��");
- }
+ if (CollectionUtils.isEmpty(templateAttrVOS)) {
+ throw new VciBaseException("妯℃澘娌℃湁閰嶇疆浠讳綍銆愯〃鍗曟樉绀恒�戜负銆愭槸銆戠殑灞炴��");
+ }
List<CodeClassifyTemplateAttrVO> idAttrVOList = codeClassifyTemplateVO.getAttributes().stream().filter(s -> s.getId().equalsIgnoreCase(CODE_FIELD)).collect(Collectors.toList());
LinkedList<WriteExcelData> excelDataList = new LinkedList<>();
@@ -2133,7 +2133,7 @@
needSaveCboList.stream().forEach(clientBusinessObject -> {
BaseModel baseModel=new BaseModel();
BeanUtil.convert(clientBusinessObject,baseModel);
- //(VciBaseUtil.objectToMapString(clientBusinessObject));
+ //(VciBaseUtil.objectToMapString(clientBusinessObject));
dataCBOList.add(baseModel);
allNeedSaveCboList.add(baseModel.getOid());
});
@@ -2327,13 +2327,19 @@
sb.append(" select * from ");
sb.append(tableName);
sb.append(" where 1=1 ");
+ sb.append(" and lastr=1 and lastv=1" );
if(isCodeOrGroupCode) {
- sb.append(" and groupcode in (");
+ sb.append(" and ( groupcode in (");
+ sb.append(VciBaseUtil.toInSql(codeDataMap.keySet().toArray(new String[0])));
+ sb.append(")");
+ sb.append(" or id in (");
+ sb.append(VciBaseUtil.toInSql(codeDataMap.keySet().toArray(new String[0])));
+ sb.append("))");
}else{
sb.append(" and id in (");
+ sb.append(VciBaseUtil.toInSql(codeDataMap.keySet().toArray(new String[0])));
+ sb.append(")");
}
- sb.append(VciBaseUtil.toInSql(codeDataMap.keySet().toArray(new String[0])));
- sb.append(")");
List<Map<String,String>> dataMapList=commonsMapper.queryByOnlySqlForMap(sb.toString());
List<ClientBusinessObject> cboList= ChangeMapTOClientBusinessObjects(dataMapList);
@@ -2423,7 +2429,7 @@
List<CodeAllCode>newCodeAllCodeList= codeAllCodeService.selectByWrapper(Wrappers.<CodeAllCode>query().lambda().eq(CodeAllCode::getCreateCodeOid, cbo.getOid()));
log.info("codeCbos size:" + newCodeAllCodeList.size());
if (!CollectionUtils.isEmpty(newCodeAllCodeList)) {
- CodeAllCode codeCbo = codeAllCodeList.get(0);
+ CodeAllCode codeCbo = newCodeAllCodeList.get(0);
log.info("codeCbos code:" + codeCbo.getId());
codeCbo.setLcStatus(CodeDefaultLC.TASK_BACK.getValue());
codeAllCodeList.add(codeCbo);
@@ -2488,6 +2494,9 @@
//鏄惁璋冪敤闆嗗洟鎺ュ彛鐢宠鎺ュ彛
if(isCodeOrGroupCode){
List<String> IdList=resultDataObjectDetailDOs.stream().filter(xMLResultDataObjectDetailDO-> com.alibaba.cloud.commons.lang.StringUtils.isNotBlank(xMLResultDataObjectDetailDO.getId())).map(XMLResultDataObjectDetailDO::getId).distinct().collect(Collectors.toList());
+
+
+
if(!CollectionUtils.isEmpty(IdList)) {
this.sendApplyGroupcode(IdList, classifyFullInfo.getTopClassifyVO().getBtmTypeId(),sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getValue());
}
@@ -2615,7 +2624,21 @@
//娌℃湁闄愬埗鍒嗙被锛屼絾鏄竴涓ā鏉垮彧鍙兘鍦ㄤ竴涓笟鍔$被鍨嬮噷闈紝鎵�浠ョ洿鎺ユ煡璇㈣繖涓笟鍔$被鍨嬪嵆鍙�
if (!CollectionUtils.isEmpty(conditionMap)) {
- final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmTypeId()) + " t where 1 = 1 "};
+ String tableName="";
+ R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(templateVO.getBtmTypeId());
+ if(r.isSuccess()) {
+ BtmTypeVO btmTypeVO = r.getData();
+ if (btmTypeVO != null) {
+ tableName = btmTypeVO.getTableName();
+
+ }
+ }
+ if (StringUtils.isBlank(tableName)) {
+ String errormsg="鏍规嵁涓氬姟绫诲瀷涓烘煡璇㈠埌鐩稿叧涓氬姟琛�";
+ errorMap.put(orderDTO.getId(),errorMap.getOrDefault(orderDTO.getId(),"")+errormsg);
+ return;
+ }
+ final String[] sql = {"select count(*) from " + tableName + " t where 1 = 1 "};
conditionMap.forEach((key, value) -> {
if(StringUtils.isBlank(value)||value.equals(QueryOptionConstant.ISNULL)){
sql[0] += " and " + key + " is null ";
@@ -2725,7 +2748,7 @@
// if (lifeCycleVO != null) {
// cbo.setLcStatus(lifeCycleVO.getStartStatus());
// } else {
- cbo.setLcStatus(CodeDefaultLC.EDITING.getValue());
+ cbo.setLcStatus(CodeDefaultLC.EDITING.getValue());
// }
} else {
cbo.setLcStatus(CodeDefaultLC.EDITING.getValue());
@@ -2835,6 +2858,9 @@
ClientBusinessObject sysDataObject= codeSystemObjectMap.get(code);
if(isCodeOrGroupCode){
code=sysDataObject.getAttributeValue("GROUPCODE");
+ if(StringUtils.isBlank(code)){
+ code=sysDataObject.getId();
+ }
}
CodeOrderDTO orderDTO = new CodeOrderDTO();
if(codeDataMap.containsKey(code)){
@@ -2843,11 +2869,7 @@
orderDTO.setCodeClassifyOid(codeClassifyVO.getOid());//鍒嗙被涓婚敭
orderDTO.setOid(sysDataObject.getOid());//鏁版嵁oid
orderDTO.setLcStatus(rowDatas.getStatus());//鐘舵��
- if(isCodeOrGroupCode){
- orderDTO.setId(sysDataObject.getId());
- }else{
- orderDTO.setId(code);
- }
+ orderDTO.setId(code);
orderDTO.setTs(sysDataObject.getTs());
orderDTO.setBtmname(codeClassifyVO.getBtmname());//涓氬姟绫诲瀷
orderDTO.setDescription("闆嗘垚璋冪敤:鏇存柊");//鏁版嵁鎻忚堪
@@ -3125,7 +3147,7 @@
String fullPath,boolean newCode){
rowDataList.stream().forEach(rowData -> {
ClientBusinessObject cbo=new ClientBusinessObject();
- DefaultAttrAssimtUtil.addDefaultAttrAssimt(cbo, classifyFullInfo.getTopClassifyVO().getBtmTypeId());
+ DefaultAttrAssimtUtil.addDefaultAttrAssimt(cbo, classifyFullInfo.getTopClassifyVO().getBtmTypeId());
rowData.getData().forEach((index,value)->{
String field = fieldIndexMap.get(index);
if (StringUtils.isBlank(field)) {
@@ -3929,7 +3951,7 @@
* @return 閲嶅鐨勮鍙�
*/
private void getSelfRepeatRowIndex(Map<String/**灞炴�х殑缂栧彿**/, CodeClassifyTemplateAttrVO> ketAttrMap,
- List<ClientBusinessObject> dataList,CodeKeyAttrRepeatVO keyRuleVO,CodeImportResultVO resultVO){
+ List<ClientBusinessObject> dataList,CodeKeyAttrRepeatVO keyRuleVO,CodeImportResultVO resultVO){
Set<String> selfRepeatRowIndexList = new CopyOnWriteArraySet<>();
Map<String,List<String>> keyAttrOkOidTORepeatOidMap=new HashMap<>();
boolean trimAll =keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnoreallspaceflag());
@@ -4454,7 +4476,7 @@
* @param idList
* @param btmName
*/
- private void sendApplyGroupcode(List<String> idList,String btmName,String operationType){
+ public void sendApplyGroupcode(List<String> idList,String btmName,String operationType){
String oids=VciBaseUtil.array2String(idList.toArray(new String[]{}));
if(operationType.equals(sysIntegrationPushTypeEnum.ACCPET_APPCODE.getValue())) {
mdmInterJtClient.applyGroupCode(oids,btmName);
--
Gitblit v1.9.3