From 3ea117935f971b75b141fc92591c10ade8aa3c81 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期二, 18 七月 2023 16:39:56 +0800
Subject: [PATCH] 流程业务数据保存
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java | 111 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 78 insertions(+), 33 deletions(-)
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
index 493c49f..1abb780 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
@@ -11,10 +11,7 @@
import com.vci.ubcs.code.dto.CodeOrderDTO;
import com.vci.ubcs.code.dto.CodeOrderSecDTO;
import com.vci.ubcs.code.entity.*;
-import com.vci.ubcs.code.enumpack.CodeDefaultLC;
-import com.vci.ubcs.code.enumpack.CodeSecTypeEnum;
-import com.vci.ubcs.code.enumpack.SysIntegrationDataFlowTypeEnum;
-import com.vci.ubcs.code.enumpack.sysIntegrationPushTypeEnum;
+import com.vci.ubcs.code.enumpack.*;
import com.vci.ubcs.code.mapper.CommonsMapper;
import com.vci.ubcs.code.service.*;
import com.vci.ubcs.code.util.ClientBusinessObject;
@@ -39,26 +36,26 @@
import com.vci.ubcs.code.wrapper.CodeClassifyWrapper;
import com.vci.ubcs.omd.feign.IBtmTypeClient;
import com.vci.ubcs.omd.vo.BtmTypeVO;
-import com.vci.ubcs.starter.revision.model.BaseModel;
+import com.vci.ubcs.starter.exception.VciBaseException;
import com.vci.ubcs.starter.revision.model.TreeQueryObject;
import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil;
-import com.vci.ubcs.starter.web.constant.QueryOptionConstant;
+import com.vci.ubcs.starter.util.UBCSSqlKeyword;
import com.vci.ubcs.starter.web.pagemodel.SessionInfo;
import com.vci.ubcs.starter.web.util.BeanUtilForVCI;
import com.vci.ubcs.starter.web.util.VciBaseUtil;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
-import static com.vci.ubcs.code.constant.MdmDuckingConstant.DOCKING_DEFAULT_CLASSIFY;
import static com.vci.ubcs.code.constant.MdmEngineConstant.DEFAULT_SYNC_ATTR_LIST;
-import static com.vci.ubcs.code.constant.MdmEngineConstant.IMPORT_ROW_INDEX;
import static com.vci.ubcs.code.enumpack.CodeSecTypeEnum.CODE_CLASSIFY_SEC;
/***
@@ -68,7 +65,8 @@
@Slf4j
@VciWebservice(path = "/universalInterface")
public class UniversalInterfaceImpl<IDockingLogeServiceing> implements UniversalInterfaceI {
-
+ @Value("${code.universalinterface.checkSystemConfig:true}")
+ public boolean CODE_CHECKCONFIG;
@Autowired(required = false)
private AttributeMapConfig attributeMapConfig;
/**
@@ -168,7 +166,7 @@
boolean checkPass= checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_APPCODE.getValue());
if(!checkPass){
errorid="101";
- throw new Throwable("绯荤粺鏍囪瘑涓恒��"+systemId+"銆�,鐨�"+sysIntegrationPushTypeEnum.ACCPET_APPCODE.getText()+"鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
+ throw new Throwable("绯荤粺鏍囪瘑涓恒��"+systemId+"銆�,"+sysIntegrationPushTypeEnum.ACCPET_APPCODE.getText()+"鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
}
UserVO userVo = interParameterVO.getData().getUser();
List<ClassfyVO> classVOList = classfysVO.getClassify();
@@ -338,14 +336,12 @@
ClassfysVO classfysVO = interParameterVO.getData().getClassifys();
systemId = interParameterVO.getData().getSystemId();
-
//鏍¢獙鏄惁閰嶇疆
- boolean checkPass= checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getValue());
- if(!checkPass){
- errorid="101";
- throw new Throwable("绯荤粺鏍囪瘑涓恒��"+systemId+"銆�,鐨�"+sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getText()+"鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
+ boolean checkPass = checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getValue());
+ if (!checkPass) {
+ errorid = "101";
+ throw new Throwable("绯荤粺鏍囪瘑涓恒��" + systemId + "銆�," + sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getText() + "鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
}
-
UserVO userVo = interParameterVO.getData().getUser();
List<ClassfyVO> classVOList = classfysVO.getClassify();
InterParameterVO finalInterParameterVO = interParameterVO;
@@ -497,12 +493,11 @@
String libId= libraryVO.getId();
List<String> classifyIdList= libraryVO.getClassifyid();
List<CodeClassifyVO> codeClassifyVOS =new ArrayList<>();
-
- //鏍¢獙鏄惁閰嶇疆
- boolean checkPass= checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILY.getValue());
- if(!checkPass){
- errorid="101";
- throw new Throwable("绯荤粺鏍囪瘑涓恒��"+systemId+"銆�,鐨�"+sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILY.getText()+"鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
+ //鏍¢獙鏄惁閰嶇疆
+ boolean checkPass = checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILY.getValue());
+ if (!checkPass) {
+ errorid = "101";
+ throw new Throwable("绯荤粺鏍囪瘑涓恒��" + systemId + "銆�," + sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILY.getText() + "鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
}
//杩欐槸璐﹀彿淇℃伅
@@ -666,12 +661,14 @@
msg = "鎺ュ彛鍙傛暟锛歭ibrary 涓簄ull";
throw new Throwable(msg);
}
+
//鏍¢獙鏄惁閰嶇疆
- boolean checkPass= checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYDATA.getValue());
- if(!checkPass){
- errorid="101";
- throw new Throwable("绯荤粺鏍囪瘑涓恒��"+systemId+"銆�,鐨�"+sysIntegrationPushTypeEnum.ACCPET_QUERYDATA.getText()+"鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
+ boolean checkPass = checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYDATA.getValue());
+ if (!checkPass) {
+ errorid = "101";
+ throw new Throwable("绯荤粺鏍囪瘑涓恒��" + systemId + "銆�," + sysIntegrationPushTypeEnum.ACCPET_QUERYDATA.getText() + "鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
}
+
//鍏堢畝绉版槸鍚︽湁鍏宠仈妯℃澘锛屾湁妯℃澘瑕佸厛鍒犻櫎
List<CodeClassify> libIdDos =classifyService.selectByWrapper(Wrappers.<CodeClassify>query().lambda().eq(CodeClassify::getId,library));
@@ -858,11 +855,12 @@
List<CodeClassifyVO> codeClassifyVOS =new ArrayList<>();
//鏍¢獙鏄惁閰嶇疆
- boolean checkPass= checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILYRULE.getValue());
- if(!checkPass){
- errorid="101";
- throw new Throwable("绯荤粺鏍囪瘑涓恒��"+systemId+"銆�,鐨�"+sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILYRULE.getText()+"鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
+ boolean checkPass = checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILYRULE.getValue());
+ if (!checkPass) {
+ errorid = "101";
+ throw new Throwable("绯荤粺鏍囪瘑涓恒��" + systemId + "銆�," + sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILYRULE.getText() + "鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
}
+
//杩欐槸璐﹀彿淇℃伅
//杩欐槸璐﹀彿淇℃伅
if(userVo!=null) {
@@ -949,10 +947,54 @@
}else if(secType.equals("coderefersec")){//寮曠敤鐮佹
codeBasicSecVO.getReferAttributeId();
codeBasicSecVO.getReferCodeClassifyOid();
- codeBasicSecVO.getReferBtmId();
- codeBasicSecVO.getReferBtmName();
- //codeBasicSecVO.getReferValueInfo();
+ String referBtmId=codeBasicSecVO.getReferBtmId();
+ String btmName=codeBasicSecVO.getReferBtmName();
+ String referConfig= codeBasicSecVO.getReferConfig();
+ CoderefersecSearchVO coderefersecSearchVO=new CoderefersecSearchVO();
+ if(StringUtils.isNotBlank(referConfig)){
+ coderefersecSearchVO = JSONObject.toJavaObject(JSONObject.parseObject(referConfig), CoderefersecSearchVO.class);
+ }
+ String buildSqlwhere="";
+ if(coderefersecSearchVO!=null){
+ Map<String,Object> condtionMap=new HashMap<>();
+ List<CodeSrchCondConfigVO> codeSrchCondConfigVOList=coderefersecSearchVO.getCodeSrchCondConfigVOS();
+ if(!CollectionUtils.isEmpty(codeSrchCondConfigVOList)) {
+ codeSrchCondConfigVOList.stream().forEach(codeSrchCondConfigVO -> {
+ condtionMap.put(codeSrchCondConfigVO.getFilterField()+codeSrchCondConfigVO.getFilterType(),codeSrchCondConfigVO.getFilterValue());
+ });
+ buildSqlwhere= UBCSSqlKeyword.buildSqlwhere(condtionMap);
+ }
+ }
+ //浣跨敤浼犲叆鐨勪笟鍔$被鍨嬫煡璇㈣〃
+ R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referBtmId));
+ if (!listR.isSuccess() || listR.getData().size() == 0) {
+ throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+ }
+ String referTable = listR.getData().get(0).getTableName();
+ StringBuffer sb=new StringBuffer();
+ sb.append(" select * from ");
+ sb.append(referTable);
+ sb.append(" where 1=1 ");
+ if(StringUtils.isNotBlank(buildSqlwhere)){
+ sb.append( buildSqlwhere );
+ }
+ List<Map> ListMap= commonsMapper.selectBySql(sb.toString());
+ String valueField=coderefersecSearchVO.getValueField();
+ String textField=coderefersecSearchVO.getTextField();
+ final int[] num = {0};
+ if(!CollectionUtils.isEmpty(ListMap)){
+ ListMap.stream().forEach(map->{
+ num[0]++;
+ String id= map.getOrDefault("OID".toUpperCase(Locale.ROOT),"").toString();
+ String value= map.getOrDefault(valueField.toUpperCase(Locale.ROOT),"").toString();
+ String text=map.getOrDefault(textField.toUpperCase(Locale.ROOT),"").toString();
+ String description=map.getOrDefault("description".toUpperCase(Locale.ROOT),"").toString();
+ CodeSectionValueVO sectionValueVO=new CodeSectionValueVO(id, num[0]+"",value,text,"",description);
+ codeSectionValueVOList.add(sectionValueVO);
+ });
+ }
+ log.info(libId);
}else if(secType.equals("codelevelsec")) {//灞傜骇鐮佹
int level = codeBasicSecVO.getCodeLevelValue();
CodeClassifyVO levelCodeClassifyVO = new CodeClassifyVO();
@@ -1354,6 +1396,9 @@
* @return
*/
private boolean checkIspass(String systemId,String type,String operationType){
+ if(!CODE_CHECKCONFIG) {
+ return true;
+ }
//鏍规嵁绫诲瀷鍘绘煡璇㈤渶瑕侀泦鎴愮殑鍒嗙被鎴栬�呮暟鎹�
LambdaQueryWrapper<DockingSystemConfig> queryWrapper = Wrappers.<DockingSystemConfig>lambdaQuery();
queryWrapper.eq(DockingSystemConfig::getUsedFlag, MdmDuckingConstant.SEND_FLAG_TRUE);
--
Gitblit v1.9.3