From 238121be19655f63a45fc9c9c3d864801eb4471b Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期三, 24 四月 2024 12:44:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java | 188 ++++++++++++++++++++++++++++++----------------
1 files changed, 121 insertions(+), 67 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 019b856..8da2386 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
@@ -147,6 +147,7 @@
*/
@Value("${bzApply.seriesFlow:seriesFlow}")
private String seriesFlow;
+
/***
* 鏄惁鍙樻洿绯诲垪
*/
@@ -175,6 +176,11 @@
*/
@Resource
private MdmProductCodeService productCodeService;
+
+ /**
+ * 杩戜箟璇嶈鍒欐煡璇㈡湇鍔�
+ */
+ @Autowired ICodeSynonymService codeSynonymService;
/**
* 鍙緭鍙�夌殑鏈嶅姟
@@ -253,8 +259,9 @@
*/
@Autowired
private ICodeRuleService ruleService;
+
/**
- * 缂栫爜瑙勫垯鐨勬湇鍔�
+ * 鐮佸�肩殑鏈嶅姟
*/
@Autowired
private ICodeAllCodeService codeAllCodeService;
@@ -310,6 +317,12 @@
public static final String BTM_NAME = "btm:name";
/**
+ * 閰嶇疆鐨勭敤鏉ョ敵璇烽泦鍥㈢爜鐨勭敤鎴�
+ */
+ @Value("${docking.apply.personUserAccount:28201728}")
+ public String applyCodeUserAccount;
+
+ /**
* 瀵嗙骇鐨勫瓧娈�
*/
public static final String SECRET_FILED = "secretgrade";
@@ -358,7 +371,6 @@
*/
@Autowired
private SaveLogUtil saveLogUtil;
-
/**
* 浣跨敤鍒嗙被鐨勪富閿幏鍙栧彲浠ヤ娇鐢ㄧ殑妯℃澘瀵硅薄
@@ -446,7 +458,7 @@
}
R r = updateBatchByBaseModel(baseModelDTO.getBtmname(), baseModels);
if (!r.isSuccess()) {
- throw new VciBaseException("鏇存柊鏁版嵁鍑洪敊锛岄噸璇曪紒" + r.getMsg());
+ throw new VciBaseException("鏇存柊鏁版嵁鍑洪敊锛岃閲嶈瘯锛�" + r.getMsg());
}
}
// 鍒氬ソ椤哄簭鏄竴鑷寸殑锛屾墍浠ョ洿鎺ユ寜鐓odeallcode鐨勯『搴忔潵鎷夸笟鍔℃暟鎹�
@@ -755,27 +767,36 @@
//娉ㄦ剰鐨勬槸keyRuleVO鍙兘涓虹┖锛岃〃绀轰笉浣跨敤瑙勫垯鎺у埗
//鑾峰彇鎵�鏈夌殑鍏抽敭灞炴��
Map<String, CodeClassifyTemplateAttrVO> ketAttrMap = templateVO.getAttributes().stream().filter(s -> VciBaseUtil.getBoolean(s.getKeyAttrFlag())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t));
+ // TODO:2024-02-01 鍏堣幏鍙栭厤缃簡杩戜箟璇嶆煡璇㈣鍒欑殑灞炴�э紝涓嶅悓浜庡叧閿睘鎬э紝璁剧疆浜嗚繎涔夎瘝鏌ヨ瑙勫垯鐨勫睘鎬у彲鑳芥槸澶氭潯涓嶅悓鐨勮繎涔夎瘝鏌ヨ瑙勫垯
+ Map<String, CodeClassifyTemplateAttrVO> sysonymAttrMaps = templateVO.getAttributes().stream().filter(item -> Func.isNotBlank(item.getSysonymRuleOids())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t));
+ // 鑾峰彇鏄惁鏈夐厤缃繎涔夎瘝鏌ヨ瑙勫垯灞炴��
+ Map<String, List<CodeSynonym>> codeSynonymMaps = new HashMap<>();
+ if(!sysonymAttrMaps.isEmpty()){
+ // 鏌ヨ杩戜箟璇嶈鍒欙紝瀛樺偍鏂瑰紡key锛氬睘鎬d锛寁alue杩戜箟璇嶆煡璇㈣鍒欏垪琛�
+ codeSynonymMaps = codeSynonymService.getCodeSynonymByOids(sysonymAttrMaps);
+ }
Map<String, String> conditionMap = new HashMap<>();
boolean trimAll = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnoreallspaceflag());
//鍏ㄩ儴鍘荤┖鐨勪紭鍏堢骇澶т簬鍘荤┖
boolean trim = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnorespaceflag());
boolean ignoreCase = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnorecaseflag());
boolean ignoreWidth = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnorewidthflag());
+ Map<String, List<CodeSynonym>> finalCodeSynonymMaps = codeSynonymMaps;
ketAttrMap.forEach((attrId, attrVO) -> {
String value = getValueFromOrderDTO(orderDTO, attrId);
if (value == null) {
value = "";
}
- wrapperKeyAttrConditionMap(value, keyRuleVO, attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap);
+ wrapperKeyAttrConditionMap(value, keyRuleVO, finalCodeSynonymMaps.get(attrId), attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap);
});
//娌℃湁闄愬埗鍒嗙被锛屼絾鏄竴涓ā鏉垮彧鍙兘鍦ㄤ竴涓笟鍔$被鍨嬮噷闈紝鎵�浠ョ洿鎺ユ煡璇㈣繖涓笟鍔$被鍨嬪嵆鍙�
if (!CollectionUtils.isEmpty(conditionMap)) {
// TODO: 鍚屼竴涓簱鍒ら噸涓嶉渶瑕佸尯鍒嗗垎绫籵id
// conditionMap.put("CODETEMPLATEOID","'" + orderDTO.getTemplateOid() + "'");
-// final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()) + " t where 1 = 1 "};
+ // final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()) + " t where 1 = 1 "};
R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getTopClassifyVO().getBtmTypeId()));
-// String referTable = VciBaseUtil.getTableName(referVO.getReferType());
+ // String referTable = VciBaseUtil.getTableName(referVO.getReferType());
if (!listR.isSuccess() || listR.getData().size() == 0) {
throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
}
@@ -800,7 +821,7 @@
if (Func.isNotEmpty(isParticipateCheckOids)) {
sql[0] += " and codeclsfid not in(" + isParticipateCheckOids + ")";
}
-// if (boService.queryCountBySql(sql[0], new HashMap<>()) > 0) {
+ // if (boService.queryCountBySql(sql[0], new HashMap<>()) > 0) {
List<String> repeatData = commonsMapper.selectList(sql[0]);
if (!repeatData.isEmpty()) {
String ruleInfoMsg = keyRuleVO == null ? "" : "鏌ヨ瑙勫垯锛氬幓闄ょ┖鏍�--{0},蹇界暐澶у皬鍐�--{1},蹇界暐鍏ㄥ崐瑙�--{2},蹇界暐鍏ㄩ儴绌烘牸--{3}";
@@ -825,18 +846,27 @@
//娉ㄦ剰鐨勬槸keyRuleVO鍙兘涓虹┖锛岃〃绀轰笉浣跨敤瑙勫垯鎺у埗
//鑾峰彇鎵�鏈夌殑鍏抽敭灞炴��
Map<String, CodeClassifyTemplateAttrVO> ketAttrMap = templateVO.getAttributes().stream().filter(s -> VciBaseUtil.getBoolean(s.getKeyAttrFlag())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t));
+ // TODO:2024-02-01 鍏堣幏鍙栭厤缃簡杩戜箟璇嶆煡璇㈣鍒欑殑灞炴�э紝涓嶅悓浜庡叧閿睘鎬э紝璁剧疆浜嗚繎涔夎瘝鏌ヨ瑙勫垯鐨勫睘鎬у彲鑳芥槸澶氭潯涓嶅悓鐨勮繎涔夎瘝鏌ヨ瑙勫垯
+ Map<String, CodeClassifyTemplateAttrVO> sysonymAttrMaps = templateVO.getAttributes().stream().filter(item -> Func.isNotBlank(item.getSysonymRuleOids())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t));
+ // 鑾峰彇鏄惁鏈夐厤缃繎涔夎瘝鏌ヨ瑙勫垯灞炴��
+ Map<String, List<CodeSynonym>> codeSynonymMaps = new HashMap<>();
+ if(!sysonymAttrMaps.isEmpty()){
+ // 鏌ヨ杩戜箟璇嶈鍒欙紝瀛樺偍鏂瑰紡key锛氬睘鎬d锛寁alue杩戜箟璇嶆煡璇㈣鍒欏垪琛�
+ codeSynonymMaps = codeSynonymService.getCodeSynonymByOids(sysonymAttrMaps);
+ }
Map<String, String> conditionMap = new HashMap<>();
boolean trimAll = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnoreallspaceflag());
//鍏ㄩ儴鍘荤┖鐨勪紭鍏堢骇澶т簬鍘荤┖
boolean trim = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnorespaceflag());
boolean ignoreCase = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnorecaseflag());
boolean ignoreWidth = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnorewidthflag());
+ Map<String, List<CodeSynonym>> finalCodeSynonymMaps = codeSynonymMaps;
ketAttrMap.forEach((attrId, attrVO) -> {
String value = getValueFromOrderDTO(orderDTO, attrId);
if (value == null) {
value = "";
}
- wrapperKeyAttrConditionMap(value, keyRuleVO, attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap);
+ wrapperKeyAttrConditionMap(value, keyRuleVO, finalCodeSynonymMaps.get(attrId), attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap);
});
//娌℃湁闄愬埗鍒嗙被锛屼絾鏄竴涓ā鏉垮彧鍙兘鍦ㄤ竴涓笟鍔$被鍨嬮噷闈紝鎵�浠ョ洿鎺ユ煡璇㈣繖涓笟鍔$被鍨嬪嵆鍙�
@@ -927,7 +957,7 @@
}
//鏄惁绯诲垪
if (!codeBZApplyDTO.isSeries()) {
- boolean isSeriesValue = codeBZApplyDTO.getData().get(isSeries).equals("true") ? true : false;
+ boolean isSeriesValue = Func.toBoolean(codeBZApplyDTO.getData().get(isSeries));
codeBZApplyDTO.setSeries(isSeriesValue);
}
//鍘熸爣鍑嗗彿
@@ -947,7 +977,7 @@
}
//鏄惁鍙樻洿绯诲垪
if (!codeBZApplyDTO.isEditSeries()) {
- boolean isEditSeriesValue = codeBZApplyDTO.getData().get(isEditSeries).equals("true") ? true : false;
+ boolean isEditSeriesValue = Func.toBoolean(codeBZApplyDTO.getData().get(isEditSeries));
codeBZApplyDTO.setEditSeries(isEditSeriesValue);
}
VciBaseUtil.alertNotNull(codeBZApplyDTO.getOperationType(), "鎿嶄綔绫诲瀷",
@@ -965,7 +995,7 @@
} else if (codeBZApplyDTO.getOperationType().equals(CodeBZOperationTypeEnum.CODE_BZ_DISABLE.getValue())) {//浣滃簾
code = amendmentDataBZ(codeBZApplyDTO, authUser);
createChangeOder(code, codeBZApplyDTO, authUser);
- } else if (codeBZApplyDTO.getOperationType().equals(CodeBZOperationTypeEnum.CODE_BZ_AMENDMENT.getValue())) {//澶囨煡
+ } else if (codeBZApplyDTO.getOperationType().equals(CodeBZOperationTypeEnum.CODE_BZ_FOR_REFERENCE.getValue())) {//澶囨煡
code = amendmentDataBZ(codeBZApplyDTO, authUser);
createChangeOder(code, codeBZApplyDTO, authUser);
}
@@ -1235,14 +1265,18 @@
* @param conditionMap 鏌ヨ鏉′欢
*/
@Override
- public void wrapperKeyAttrConditionMap(String value, CodeKeyAttrRepeatVO keyRuleVO, String attrId,
+ public void wrapperKeyAttrConditionMap(String value, CodeKeyAttrRepeatVO keyRuleVO,
+ List<CodeSynonym> codeSynonymMaps, String attrId,
boolean trim, boolean ignoreCase, boolean ignoreWidth,
boolean trimAll, Map<String, String> conditionMap) {
boolean ignoreSpace = trim || trimAll;
if (StringUtils.isBlank(value)) {
- //涓虹┖鐨勬椂鍊欙紝涓嶈兘鐢≦ueryOperation.ISNULL锛屽钩鍙颁笉鐭ラ亾鍟ユ椂鍊欎笉澶勭悊杩欑浜�
+ //鍊间负绌虹殑鏃跺�欙紝涓嶈兘鐢≦ueryOperation.ISNULL锛屽钩鍙颁笉鐭ラ亾鍟ユ椂鍊欎笉澶勭悊杩欑浜�
conditionMap.put("t." + attrId, QueryOptionConstant.ISNULL);
} else {
+ //杩戜箟璇嶆煡璇㈣鍒檝alu鍊艰浆鎹�
+ value = this.getValueToSynony(codeSynonymMaps, value);
+
if (keyRuleVO != null) {
String queryKey = "";
String queryValue = "";
@@ -1278,13 +1312,30 @@
conditionMap.put(queryKey, queryValue);
} else {
if (StringUtils.isNotBlank(value)) {
- //涓虹┖鐨勬椂鍊欎笉浠h〃涓嶆牎楠岋紝鍙槸涓嶅幓闄ょ浉鍏崇殑淇℃伅
+ //鍏抽敭灞炴�ф煡閲嶈鍒欎负绌虹殑鏃跺�欎笉浠h〃涓嶆牎楠岋紝鍙槸涓嶅幓闄ょ浉鍏崇殑淇℃伅
conditionMap.put("nvl(" + "t." + attrId + ",'/')", "'" + SpecialCharacterConverter.escapeSpecialCharacters(value) + "'");
} else {
conditionMap.put("t." + attrId, QueryOptionConstant.ISNULL);
}
}
}
+ }
+
+ /**
+ * 杩戜箟璇嶆煡璇㈣鍒欒浆鎹�
+ * @param codeSynonymMaps
+ * @param value
+ * @return
+ */
+ public String getValueToSynony(/*杩戜箟璇嶆煡璇㈣鍒�*/List<CodeSynonym> codeSynonymMaps,String value){
+ // 鑾峰彇骞跺垽鏂槸鍚﹂厤缃簡杩戜箟璇嶆煡璇㈣鍒�
+ // TODO锛氳繎涔夎瘝鏇挎崲鎴愭簮鍊硷紙婧愬�兼槸姝g‘鐨勫�硷紝杩戜箟璇嶆槸鐩稿綋浜庤緭閿欑瑪璇殑瀛楃锛�
+ if(Func.isNotEmpty(codeSynonymMaps)){
+ for (int i = 0; i < codeSynonymMaps.size(); i++) {
+ value = value.replace(codeSynonymMaps.get(i).getSynonymValue(),codeSynonymMaps.get(i).getSourceValue());
+ }
+ }
+ return value;
}
/**
@@ -1509,7 +1560,6 @@
wrapperResemble(templateVO, uiInfoVO);
return uiInfoVO;
}
-
/**
* 妯℃澘灞炴�ц浆鎹负琛ㄥ崟瀹氫箟鐨勪俊鎭�
@@ -2007,7 +2057,7 @@
} 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("缂哄皯" + errorMessage.substring(errorMessage.indexOf("[T.") + 1, errorMessage.indexOf("]")) + "瀛楁");
}
throw new ServiceException(e.getMessage());
}
@@ -2143,7 +2193,6 @@
}
}
-
/**
* 澶勭悊鏃堕棿鏍煎紡
*
@@ -2170,7 +2219,6 @@
});
}
}
-
/**
* 澶勭悊鏋氫妇鐨勫唴瀹癸紝濡傛灉涓嶅湪鏋氫妇涓紝浼氳繑鍥炲師鏈殑鍊�
@@ -2964,7 +3012,7 @@
conditionMap = new HashMap<>();
}
pageHelper.addDefaultDesc("createTime");
-// pageHelper.addDefaultDesc("id");
+ // pageHelper.addDefaultDesc("id");
if (!classifyService.checkHasChild(codeClassifyOid)) {
conditionMap.put("t." + CODE_CLASSIFY_OID_FIELD, codeClassifyOid);
} else {
@@ -2981,6 +3029,9 @@
conditionMap.put("t.lastr", "1");
conditionMap.put("t.lastv", "1");
DataGrid<Map<String, String>> mapDataGrid = queryGrid(btmTypeId, templateVO, conditionMap, pageHelper);
+ if(templateVO.getAttributes().isEmpty()){
+ throw new ServiceException(String.format("涓婚敭涓猴細{}鐨勬ā鏉夸笅锛屾ā鏉垮睘鎬ч厤缃负绌猴紒",templateVO.getOid()));
+ }
//澶勭悊杩斿洖鏁版嵁涓庢ā鏉挎暟鎹厤缃殑瀛楁涓嶄竴鏍烽棶棰�
templateVO.getAttributes().stream().forEach(e -> {
for (Map<String, String> datum : mapDataGrid.getData()) {
@@ -3423,17 +3474,20 @@
cbos.add(data);
});
-// List<ClientBusinessObject> cbos = boService.queryByOnlySql(sqlBO.getSqlUnPage());
+ // List<ClientBusinessObject> cbos = boService.queryByOnlySql(sqlBO.getSqlUnPage());
if (CollectionUtils.isEmpty(cbos)) {
- throw new VciBaseException("鏁版嵁鍦ㄧ郴缁熶腑涓嶅瓨鍦紝鏄惁鍥犱负淇敼杩囦笟鍔$被鍨嬶紵");
+ return R.fail("鏁版嵁鍦ㄧ郴缁熶腑涓嶅瓨鍦紝鏄惁鍥犱负淇敼杩囦笟鍔$被鍨嬶紵");
}
-// Map<String, String> data = new HashMap<>();
+ // Map<String, String> data = new HashMap<>();
Map<String, String> cbo = cbos.get(0);
-// WebUtil.copyValueToMapFromCbos(cbo, data);
+ // WebUtil.copyValueToMapFromCbos(cbo, data);
List<Map<String, String>> dataList = new ArrayList<>();
dataList.add(cbo);
wrapperData(dataList, templateVO, sqlBO.getSelectFieldList(), true);
R<List<Map<String, String>>> result = R.data(Collections.singletonList(cbo));
+ if(templateVO.getAttributes().isEmpty()){
+ return R.fail(String.format("涓婚敭涓猴細%s鐨勬ā鏉夸笅锛屾ā鏉垮睘鎬ч厤缃负绌猴紒",templateVO.getOid()));
+ }
//澶勭悊杩斿洖鏁版嵁涓庢ā鏉挎暟鎹厤缃殑瀛楁涓嶄竴鏍烽棶棰�
templateVO.getAttributes().stream().forEach(e -> {
for (Map<String, String> datum : result.getData()) {
@@ -3445,42 +3499,42 @@
});
//鎴戜滑瑕佺湅鏄惁涓嶆槸鍗囩増鐨勶紝鍗囩増鐨勮瘽锛岄渶瑕佸姣斾笉鐩哥瓑鐨勫睘鎬�
-/* String copy = cbo.get("copyfromversion");
-// if (StringUtils.isBlank(copy)) {
-// copy = cbo.getAttributeValue("copyfromversion");
-// }
- if (StringUtils.isNotBlank(copy)) {
- //璇存槑鏈夊彉鏇寸殑鍐呭
+ /* String copy = cbo.get("copyfromversion");
+ // if (StringUtils.isBlank(copy)) {
+ // copy = cbo.getAttributeValue("copyfromversion");
+ // }
+ if (StringUtils.isNotBlank(copy)) {
+ //璇存槑鏈夊彉鏇寸殑鍐呭
- CodeTemplateAttrSqlBO oldSqlBO = getSqlByTemplateVO(btmId, templateVO, WebUtil.getOidQuery(copy), new PageHelper(-1));
- //鎴戜滑浣跨敤鍜屼笟鍔$被鍨嬬殑鏉ユ煡璇�
-// List<Map> cbos = commonsMapper.selectBySql(sqlBO.getSqlUnPage());
- List<Map> oldCbos = commonsMapper.selectBySql(oldSqlBO.getSqlUnPage());
- if (!CollectionUtils.isEmpty(oldCbos)) {
-// Map<String, String> newData = new HashMap<>();
-// WebUtil.copyValueToMapFromCbos(cbo, newData);
- Map<String, String> oldData = new HashMap<>();
- oldData = oldCbos.get(0);
- Map<String, String> difFieldMap = new HashMap<>();
- Map<String, String> finalOldData = oldData;
- cbo.forEach((key, value) -> {
- // 杩欏効oldmap涓殑鍏ㄦ槸澶у啓锛岃�宑bo涓殑鍏ㄦ槸灏忓啓鎵�浠ヤ細鎷夸笉鍒板彧锛岃繖鍎跨洿鎺ュ鐞嗘垚灏忓啓鎷夸笉鍒板氨鐢ㄥぇ鍐欐嬁
- String oldValue = String.valueOf(finalOldData.getOrDefault(key.toUpperCase(Locale.ROOT), finalOldData.getOrDefault(key, "")));
- if (value == null || value == "null") {
- value = "";
- }
- if (oldValue == null || oldValue == "null") {
- oldValue = "";
- }
- if (!value.equalsIgnoreCase(oldValue)) {
- difFieldMap.put(key, oldValue);
- }
- });
- List<Map<String, String>> difFieldList = new ArrayList<>();
- difFieldList.add(difFieldMap);
- result.setData(difFieldList);
- }
- }*/
+ CodeTemplateAttrSqlBO oldSqlBO = getSqlByTemplateVO(btmId, templateVO, WebUtil.getOidQuery(copy), new PageHelper(-1));
+ //鎴戜滑浣跨敤鍜屼笟鍔$被鍨嬬殑鏉ユ煡璇�
+ // List<Map> cbos = commonsMapper.selectBySql(sqlBO.getSqlUnPage());
+ List<Map> oldCbos = commonsMapper.selectBySql(oldSqlBO.getSqlUnPage());
+ if (!CollectionUtils.isEmpty(oldCbos)) {
+ // Map<String, String> newData = new HashMap<>();
+ // WebUtil.copyValueToMapFromCbos(cbo, newData);
+ Map<String, String> oldData = new HashMap<>();
+ oldData = oldCbos.get(0);
+ Map<String, String> difFieldMap = new HashMap<>();
+ Map<String, String> finalOldData = oldData;
+ cbo.forEach((key, value) -> {
+ // 杩欏効oldmap涓殑鍏ㄦ槸澶у啓锛岃�宑bo涓殑鍏ㄦ槸灏忓啓鎵�浠ヤ細鎷夸笉鍒板彧锛岃繖鍎跨洿鎺ュ鐞嗘垚灏忓啓鎷夸笉鍒板氨鐢ㄥぇ鍐欐嬁
+ String oldValue = String.valueOf(finalOldData.getOrDefault(key.toUpperCase(Locale.ROOT), finalOldData.getOrDefault(key, "")));
+ if (value == null || value == "null") {
+ value = "";
+ }
+ if (oldValue == null || oldValue == "null") {
+ oldValue = "";
+ }
+ if (!value.equalsIgnoreCase(oldValue)) {
+ difFieldMap.put(key, oldValue);
+ }
+ });
+ List<Map<String, String>> difFieldList = new ArrayList<>();
+ difFieldList.add(difFieldMap);
+ result.setData(difFieldList);
+ }
+ }*/
return result;
}
@@ -3908,13 +3962,13 @@
MdmUIInfoVO uiInfoVO = getTableDefineByTemplateVO(getUsedTemplateByClassifyOid(codeClassifyOid));
uiInfoVO.setLeaf(classifyService.countChildrenByClassifyOid(codeClassifyOid) == 0);
if (StringUtils.isNotBlank(functionId) && !"~".equalsIgnoreCase(functionId)) {
- List<Menu> buttonVOS = iSysClient.getMenuButtonByType(codeClassifyOid, uiInfoVO.getTemplateVO().getBtmTypeId(), "data_auth").getData();
- // List<SmOperationVO> operationVOS = operationService.listButtonByFunctionId(functionId);
- // if (operationVOS == null) {
- // operationVOS = new ArrayList<>();
- // }
- // //鏌ヨ鎵╁睍鎸夐挳
- // List<CodeButtonVO> buttonVOS = listButtonInToolbarByClassifyOid(codeClassifyOid);
+ // TODO:2024-1-25 18:42妯℃澘涓婄殑btmtypeid鏈夋椂鍊欎細瀛樺湪澶у皬鍐欑殑闂锛屾寜鐞嗘潵璇磋繖鍎跨洿鎺ョ敤functionId灏辫兘婊¤冻鏌ヨ鑿滃崟鎸夐挳浜唘iInfoVO.getTemplateVO().getBtmTypeId()
+ R<List<Menu>> buttonListR = iSysClient.getMenuButtonByType(codeClassifyOid, functionId, "data_auth");
+ if(!buttonListR.isSuccess()){
+ throw new ServiceException("鑾峰彇鎸夐挳鎺堟潈鍒楄〃澶辫触锛屽師鍥狅細"+buttonListR.getMsg());
+ }
+ List<Menu> buttonVOS = buttonListR.getData();
+
List<SmOperationVO> operationVOS = new ArrayList<>();
if (!CollectionUtils.isEmpty(buttonVOS)) {
for (int i = 0; i < buttonVOS.size(); i++) {
@@ -4351,8 +4405,8 @@
if (cboMap.containsKey(oid)) {
CodeAllCode codeAllCode = cboMap.get(oid);
codeAllCode.setId(baseModel.getId());
- // codeAllCode.setLastModifier(AuthUtil.getUser().getUserName());
- codeAllCode.setLastModifier(AuthUtil.getUser().getAccount());
+ // 涓绘暟鎹帹閫佸舰寮忥紝鏄嬁涓嶅埌鐢ㄦ埛淇℃伅鐨�
+ codeAllCode.setLastModifier(Func.isBlank(AuthUtil.getUserAccount()) ? applyCodeUserAccount:AuthUtil.getUserAccount());
codeAllCode.setLastModifyTime(new Date());
codeAllCode.setLcStatus(baseModel.getLcStatus());
newCodeAllCodeList.add(codeAllCode);
--
Gitblit v1.9.3