From 607ebaf27b44e0d27925715e4c2d7e2ffff257f0 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 11 七月 2023 09:49:33 +0800
Subject: [PATCH] 前端代码打包
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java | 163 ++++++++++++++++++++++++++++--------------------------
1 files changed, 84 insertions(+), 79 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 9b1cac9..43a785c 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
@@ -6,7 +6,6 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO;
import com.vci.ubcs.code.bo.CodeTemplateAttrSqlBO;
import com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant;
@@ -56,7 +55,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.cache.utils.CacheUtil;
-import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
@@ -68,7 +66,6 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
-
import javax.annotation.Resource;
import java.beans.BeanInfo;
import java.beans.Introspector;
@@ -365,6 +362,9 @@
// 鍥炴敹闇�瑕佷笟鍔℃暟鎹垹闄�
if (CodeDefaultLC.TASK_BACK.getValue().equals(baseModelDTO.getLcStatus())) {
R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(baseModelDTO.getBtmname()));
+ if (!listR.isSuccess() || listR.getData().size() == 0) {
+ throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+ }
commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(), VciBaseUtil.toInSql(baseModelDTO.getOid()));
} else {
for (BaseModel baseModel : baseModels) {
@@ -646,6 +646,9 @@
// 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());
+ if (!listR.isSuccess() || listR.getData().size() == 0) {
+ throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+ }
final String[] sql = {"select count(*) from " + listR.getData().get(0).getTableName() + " t where 1 = 1 "};
conditionMap.forEach((key, value) -> {
sql[0] += " and " + key + " = " + value;
@@ -826,7 +829,7 @@
// cbo.setCodeclsfpath(fullPath);
cbo.setTs(new Date());
if (!edit && StringUtils.isBlank(orderDTO.getLcStatus())) {
- //鍏堝啓鍥哄畾锛屽悗闈㈢敓鍛藉懆鏈熷ソ浜嗗湪缂栧啓
+ //TODO 鍏堝啓鍥哄畾锛屽悗闈㈢敓鍛藉懆鏈熷ソ浜嗗湪缂栧啓
if (StringUtils.isNotBlank(cbo.getLctid())) {
// OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(cbo.getLctid());
// if (lifeCycleVO != null) {
@@ -1221,7 +1224,8 @@
fieldVO.setTemplet(attrVO.getTableDisplayJs());
}
if (StringUtils.isBlank(fieldVO.getTemplet()) && VciFieldTypeEnum.VTBoolean.name().equalsIgnoreCase(attrVO.getAttributeDataType())) {
- fieldVO.setTemplet("function(d){return $webUtil.formateBoolean(d." + fieldVO.getField() + ");}");
+ fieldVO.setTemplet("function(row,column){return row[column.property]=='true' || row[column.property]=='1'?'鏄�':'鍚�'}");
+// fieldVO.setTemplet("function(d){return $webUtil.formateBoolean(d." + fieldVO.getField() + ");}");
}
fieldVO.setOptionJsMap(eventJsMap);
fieldVO.setStyle(attrVO.getTableDisplayStyle());
@@ -1580,7 +1584,7 @@
List<CodeClassifyTemplateAttrVO> referAttrVOs = templateVO.getAttributes().stream().filter(
s -> StringUtils.isNotBlank(s.getReferBtmId()) || StringUtils.isNotBlank(s.getReferConfig())
).collect(Collectors.toList());
- Map<String/**鍙傜収鐨勫睘鎬�**/, String/**瀹為檯鐨勫瓧娈�**/> referFieldMap = new HashMap<>();
+ Map<String/**鍙傜収鐨勫睘鎬�**/, String/**瀹為檯鐨勫瓧娈�**/> referFieldMap = new ConcurrentHashMap<>();
if (!CollectionUtils.isEmpty(referAttrVOs)) {
referAttrVOs.parallelStream().forEach(attrVO -> {
UIFormReferVO referVO = null;
@@ -1595,6 +1599,9 @@
//浣跨敤浼犲叆鐨勪笟鍔$被鍨嬫煡璇㈣〃
R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referVO.getReferType()));
// String referTable = VciBaseUtil.getTableName(referVO.getReferType());
+ if (!listR.isSuccess() || listR.getData().size() == 0) {
+ throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+ }
String referTable = listR.getData().get(0).getTableName();
// String referTable = "pl_code_classify";
String referTableNick = attrVO.getId() + "0";
@@ -1613,11 +1620,7 @@
});
}
R<BtmTypeVO> allAttributeByBtmId = btmTypeClient.getDefaultAttrByBtmId(btmType);
-// Optional.ofNullable(allAttributeByBtmId.getData()).orElseGet(allAttributeByBtmId.getData().getAttributes()).stream().forEach(attrId -> {
-// if (!selectFieldList.contains(attrId.getOid()) && !"secretgrade".equalsIgnoreCase(attrId.getOid())) {
-// selectFieldList.add(attrId.getOid());
-// }
-// });
+
if (allAttributeByBtmId.getData() != null) {
for (BtmTypeAttributeVO attribute : allAttributeByBtmId.getData().getAttributes()) {
if (!selectFieldList.contains(attribute.getId()) && !"secretgrade".equalsIgnoreCase(attribute.getId())) {
@@ -1695,6 +1698,9 @@
}
// String tableName = VciBaseUtil.getTableName(btmType);
R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType));
+ if (!listR.isSuccess() || listR.getData().size() == 0) {
+ throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+ }
// String referTable = VciBaseUtil.getTableName(referVO.getReferType());
String tableName = listR.getData().get(0).getTableName();
String sql = "select " + selectFieldList.stream().map(s -> (s.contains(".") ? s : ("t." + s))).collect(Collectors.joining(","))
@@ -1864,13 +1870,13 @@
return (field.contains(".") ? "" : "t.") + field + SPACE + "= '" + getStringValueInWhere(field, value, attrVOMap) + "'" + SPACE;
}
} else {
- if (referFieldMap.containsKey(key)) {
- //璇存槑鏄弬鐓х殑锛屾垜浠弬鐓х殑鏌ヨ閮借涓烘槸瀛楃涓诧紝濡傛灉鏄椂闂存牸寮忕殑鏌ヨ鑲畾鏈夐棶棰橈紝
- String selectKey = referFieldMap.get(key);
- return getSqlByValue(selectKey, value, null, btmType);
- } else {
- return getSqlByValue(key, value, attrVOMap, btmType);
- }
+// if (referFieldMap.containsKey(key)) {
+// //璇存槑鏄弬鐓х殑锛屾垜浠弬鐓х殑鏌ヨ閮借涓烘槸瀛楃涓诧紝濡傛灉鏄椂闂存牸寮忕殑鏌ヨ鑲畾鏈夐棶棰橈紝
+// String selectKey = referFieldMap.get(key);
+// return getSqlByValue(selectKey, value, null, btmType);
+// } else {
+ return getSqlByValue(key, value, attrVOMap, btmType);
+// }
}
}
return "";
@@ -1924,7 +1930,7 @@
}
if (field.contains(".") && attrVOMap != null && attrVOMap.containsKey(field.split("\\.")[0].toLowerCase(Locale.ROOT))) {
//鏄弬鐓�
- return value;
+ return "'" + value + "'";
} else {
return value;
}
@@ -1948,13 +1954,13 @@
|| VciFieldTypeEnum.VTInteger.equals(fieldTypeEnum)) {
return value;
} else {
- return value;
+ return "'" + value + "'";
}
} else {
if ((value.startsWith("(") && value.endsWith(")")) || (value.startsWith("'") && value.endsWith("'"))) {
return value;
}
- return value;
+ return "'" + value + "'";
}
}
@@ -2233,7 +2239,7 @@
// baseMapper.deleteBatchIds(cboList);
//浣跨敤浼犲叆鐨勪笟鍔$被鍨嬫煡璇㈣〃
R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getCurrentClassifyVO().getBtmtypeid()));
- if (listR.getData().size() == 0) {
+ if (!listR.isSuccess() || listR.getData().size() == 0) {
throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
}
commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(),
@@ -2440,20 +2446,19 @@
@Override
public R markDataPassing(String oid, String btmName, Boolean pass) {
VciBaseUtil.alertNotNull(oid, "涓氬姟鏁版嵁涓婚敭", btmName, "涓氬姟绫诲瀷", pass, "鏍囪绫诲瀷");
- boolean flag = false;
+ boolean flag = true;
try {
-// QueryWrapper<CodeWupinEntity> wrapper = new QueryWrapper<>();
-// wrapper.eq("oid",oid);
- CodeWupin data = baseMapper.selectById(oid);
- // ClientBusinessObjectOperation operation = new ClientBusinessObjectOperation();
-// ClientBusinessObject data = operation.readBusinessObjectById(oid, btmName);
- if (data == null || StringUtils.isBlank(data.getOid())) {
+ List<BaseModel> datas = selectByTypeAndOid(btmName, oid);
+ if (datas.size() == 0) {
return R.fail(DATA_OID_NOT_EXIST);
}
- data.setPassing(String.valueOf(pass));
- flag = SqlHelper.retBool(baseMapper.updateById(data));
-// flag = operation.updateBuinessObject(data);
+ datas.stream().forEach(data -> data.getData().put("PASSING", String.valueOf(pass)));
+ R r = updateBatchByBaseModel(btmName, datas);
+ if (!r.isSuccess()) {
+ flag = false;
+ }
} catch (Exception e) {
+ flag = false;
e.printStackTrace();
}
if (flag) {
@@ -2738,7 +2743,7 @@
executionId = executionId.substring(0, executionId.lastIndexOf("."));
}
String sql = "select wm_concat(distinct (t.codetempattrOidArr)) codetempattroidarr\n" +
- "from pl_code_wupin t\n" +
+ "from pl_code_clsflowtemp t\n" +
"join PLFLOWINSTANCE plfi on t.ID = plfi.PLTEMPLATEPUID\n" +
"where plfi.PLEXECUTIONID = '" + executionId + "' and t.CLASSIFYTEMPLATEOID = '" + templateOid + "' and t.CODEPROCESSUSE = '" + processUse + "'";
// List<ClientBusinessObject> tempAttrOidArr = boService.queryByOnlySql(sql);
@@ -2746,7 +2751,7 @@
if (CollectionUtils.isEmpty(tempAttrOidArr) || StringUtils.isBlank((CharSequence) tempAttrOidArr.get(0).get("codetempattroidarr"))) {
return new ArrayList<>();
}
- return VciBaseUtil.str2List(tempAttrOidArr.get(0).get("codetempattroidarr").toString());
+ return VciBaseUtil.str2List(tempAttrOidArr.get(0).get("CODETEMPATTROIDARR").toString());
}
/**
@@ -2771,39 +2776,23 @@
throw new VciBaseException("涓氬姟鏁版嵁涓婚敭涓嶈兘涓虹┖");
}
List<String> oidList = VciBaseUtil.str2List(conditionMap.get("oid"));
- Map<String, String> oidMap = new HashMap<>();
- QueryWrapper<CodeWupin> wrapper = new QueryWrapper();
- if (conditionMap.get("oid").contains(",")) {
-// oidMap.put("oid", QueryOptionConstant.IN +"("+ VciBaseUtil.toInSql(oidList.toArray(new String[0])) + ")");
- wrapper.in("oid", oidList);
- } else {
-// oidMap.put("oid", conditionMap.get("oid"));
- wrapper.in("oid", conditionMap.get("oid"));
- }
- if (CollectionUtils.isEmpty(oidMap)) {
- throw new VciBaseException("涓氬姟鏁版嵁涓婚敭涓嶈兘涓虹┖");
- }
-// List<ClientBusinessObject> cbos = boService.queryCBO(btmType, oidMap);
- List<CodeWupin> cbos = baseMapper.selectList(wrapper);
+
+ List<BaseModel> cbos = selectByTypeAndOid(btmType, conditionMap.get("oid"));
if (CollectionUtils.isEmpty(cbos)) {
throw new VciBaseException("鏈壘鍒颁笟鍔℃暟鎹�");
}
- CodeWupin cbo = cbos.get(0);
- String templateOid = cbo.getCodetemplateoid();
-// Map<String, String> templateOidMap = new HashMap<>();
-// templateOidMap.put("oid", templateOid);
+ BaseModel cbo = cbos.get(0);
+ String templateOid = cbo.getData().get("CODETEMPLATEOID");
QueryWrapper<CodeClassifyTemplate> codeClassifyTemplateWrapper = new QueryWrapper<>();
codeClassifyTemplateWrapper.eq("oid", templateOid);
List<CodeClassifyTemplate> templateDOList = templateService.list(codeClassifyTemplateWrapper);
-// List<CodeClassifyTemplate> templateDOList = boService.queryObject(CodeClassifyTemplate.class, templateOidMap);
QueryWrapper<CodeClassifyTemplateAttr> codeClassifyTemplateAttrWrapper = new QueryWrapper<>();
codeClassifyTemplateAttrWrapper.eq("CLASSIFYTEMPLATEOID", templateOid);
-// templateOidMap.clear();
-// templateOidMap.put("CLASSIFYTEMPLATEOID",templateOid);
+
List<CodeClassifyTemplateAttr> attrDOList = codeClassifyTemplateAttrService.list(codeClassifyTemplateAttrWrapper);
-// boService.queryObject(CodeClassifyTemplateAttr.class, templateOidMap);
+
if (CollectionUtils.isEmpty(templateDOList)) {
logger.error("鎵句笉鍒颁笟鍔℃暟鎹叧鑱旂殑妯℃澘锛屾ā鏉夸富閿細" + templateOid);
throw new VciBaseException("鎵句笉鍒颁笟鍔℃暟鎹叧鑱旂殑妯℃澘");
@@ -3115,12 +3104,12 @@
uiInfoVO.setLeaf(classifyService.countChildrenByClassifyOid(codeClassifyOid) == 0);
if (StringUtils.isNotBlank(functionId) && !"~".equalsIgnoreCase(functionId)) {
List<Menu> buttonVOS = iSysClient.getMenuButtonByType(uiInfoVO.getTemplateVO().getBtmTypeId()).getData();
-// List<SmOperationVO> operationVOS = operationService.listButtonByFunctionId(functionId);
-// if (operationVOS == null) {
-// operationVOS = new ArrayList<>();
-// }
-// //鏌ヨ鎵╁睍鎸夐挳
-// List<CodeButtonVO> buttonVOS = listButtonInToolbarByClassifyOid(codeClassifyOid);
+ // List<SmOperationVO> operationVOS = operationService.listButtonByFunctionId(functionId);
+ // if (operationVOS == null) {
+ // operationVOS = new ArrayList<>();
+ // }
+ // //鏌ヨ鎵╁睍鎸夐挳
+ // List<CodeButtonVO> buttonVOS = listButtonInToolbarByClassifyOid(codeClassifyOid);
List<SmOperationVO> operationVOS = new ArrayList<>();
if (!CollectionUtils.isEmpty(buttonVOS)) {
for (int i = 0; i < buttonVOS.size(); i++) {
@@ -3187,7 +3176,7 @@
public Integer insertBatchByType(String btmType, List<BaseModel> baseModels) {
//浣跨敤浼犲叆鐨勪笟鍔$被鍨嬫煡璇㈣〃
R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType));
- if (listR.getData().size() == 0) {
+ if (!listR.isSuccess() || listR.getData().size() == 0) {
throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
}
//灏哹ean杞负map,mybatis缁熶竴澶勭悊
@@ -3214,7 +3203,7 @@
//浣跨敤浼犲叆鐨勪笟鍔$被鍨嬫煡璇㈣〃
R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType));
- if (listR.getData().size() == 0) {
+ if (!listR.isSuccess() || listR.getData().size() == 0) {
throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
}
//鏌ヨ鏁版嵁
@@ -3272,7 +3261,10 @@
*/
public BaseModel createBaseModel(String boName) {
R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(boName));
- String userName = AuthUtil.getUser().getUserName();
+ if (!listR.isSuccess() || listR.getData().size() == 0) {
+ throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+ }
+ String userName = String.valueOf(AuthUtil.getUser().getUserId());
BaseModel bo = new BaseModel();
// bo.setOid(VciBaseUtil.getPk());
// bo.setRevisionid(VciBaseUtil.getPk());
@@ -3339,7 +3331,7 @@
public R updateBatchByBaseModel(String btmType, List<BaseModel> baseModels) {
//浣跨敤浼犲叆鐨勪笟鍔$被鍨嬫煡璇㈣〃
R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType));
- if (listR.getData().size() == 0) {
+ if (!listR.isSuccess() || listR.getData().size() == 0) {
throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
}
//灏哹ean杞负map,mybatis缁熶竴澶勭悊
@@ -3369,10 +3361,16 @@
* @return 鍒楄〃鏁版嵁
*/
@Override
- public IPage<BaseModel> referDataGrid(UIFormReferVO referConfigVO, BaseQueryObject baseQueryObject) {
-// checkReferConfig(referConfigVO);
+ public IPage<BaseModel> referDataGrid(UIFormReferVO referConfigVO, BaseQueryObject baseQueryObject) throws VciBaseException {
+ //checkReferConfig(referConfigVO);
//浣跨敤涓氬姟绫诲瀷鏌ヨ
R<BtmTypeVO> allAttributeByBtmId = btmTypeClient.getAllAttributeByBtmId(referConfigVO.getReferType());
+ if (allAttributeByBtmId.getCode() != 200) {
+ throw new ServiceException("涓氬姟绫诲瀷feign鎺ュ彛璋冪敤閿欒锛�");
+ }
+ if (Func.isEmpty(allAttributeByBtmId.getData())) {
+ throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+ }
BtmTypeVO btmTypeVO = allAttributeByBtmId.getData();
/**
* 鍔犱笂鏌ヨ鏈�鏂扮増娆�
@@ -3390,10 +3388,10 @@
R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referConfigVO.getReferType()));
if (listR.getCode() != 200) {
- throw new ServiceException("涓氬姟绫诲瀷feign鎺ュ彛璋冪敤閿欒");
+ throw new ServiceException(Func.isNotBlank(listR.getMsg()) ? listR.getMsg() : "涓氬姟绫诲瀷feign鎺ュ彛璋冪敤閿欒锛�");
}
- if (listR.getData().size() == 0) {
- throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+ if (listR.getData().isEmpty()) {
+ throw new VciBaseException(Func.isNotBlank(listR.getMsg()) ? listR.getMsg() : "浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
}
String namesql = "";
if (StringUtils.isNotBlank(baseQueryObject.getConditionMap().get("name"))) {
@@ -3411,15 +3409,20 @@
String lcstatusSql = "";
if (StringUtils.isNotBlank(baseQueryObject.getConditionMap().get("lcstatus"))) {
- lcstatusSql = "and lcstatus =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lcstatus"));
+ lcstatusSql = "lcstatus =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lcstatus"));
+ }
+ String where = "";
+
+ if (StringUtils.isNotBlank(codesql) || StringUtils.isNotBlank(lcstatusSql) || StringUtils.isNotBlank(namesql)) {
+ where="where ";
}
String num1 = baseQueryObject.getPage() * baseQueryObject.getLimit() + "";
String num2 = ((baseQueryObject.getPage()) - 1) * baseQueryObject.getLimit() + 1 + "";
- List<Map> maps = commonsMapper.selectBySql("select * from ( select rownum rn, t.* from (select * from " + listR.getData().get(0).getTableName()
+ List<Map> maps = commonsMapper.selectBySql("select * from ( select rownum rn, t.* from (select * from " + listR.getData().get(0).getTableName() + SPACE
+ (StringUtils.isNotBlank(listR.getData().get(0).getRevisionRuleId()) ? (" where lastr = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastr").toString())
- + "and lastv =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())):"")
+ + " and lastv =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and": where) + SPACE
+ lcstatusSql + namesql + codesql + ") t where rownum <=" + num1 + ") where rn >=" + num2
);
List<BaseModel> baseModels = new ArrayList<>();
@@ -3461,15 +3464,14 @@
} catch (Exception e) {
throw new VciBaseException("鏌ヨ澶辫触锛�" + e.getMessage());
}
- int total = commonsMapper.queryCountBySql("select count(*) from " + listR.getData().get(0).getTableName()
+ int total = commonsMapper.queryCountBySql("select count(*) from " + listR.getData().get(0).getTableName() + SPACE
+ (StringUtils.isNotBlank(listR.getData().get(0).getRevisionRuleId()) ? (" where lastr = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastr").toString())
- + "and lastv =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())):"")
+ + "and lastv = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : where) + SPACE
+ lcstatusSql + namesql + codesql
);
-
- IPage<BaseModel> objectDataGrid = new Page<>();
+ IPage<BaseModel> objectDataGrid = new Page<>();
objectDataGrid.setPages(baseQueryObject.getPage());
- objectDataGrid.setCurrent(baseQueryObject.getPage());
+ objectDataGrid.setCurrent(baseQueryObject.getPage());
objectDataGrid.setRecords(baseModels);
objectDataGrid.setSize(baseQueryObject.getLimit());
objectDataGrid.setTotal(total);
@@ -3601,6 +3603,9 @@
toBo.setVersionRule(fromBo.getVersionRule());
// RevisionValueObject rvObj = this.getNextRevision(fromBo.getBtmName(), fromBo.getNameoid(), item.revRuleName, item.revInput, revisionVal);
R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(fromBo.getBtmname()));
+ if (!listR.isSuccess() || listR.getData().size() == 0) {
+ throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+ }
Map<String, Object> nextRevision = commonsMapper.getNextRevision(listR.getData().get(0).getTableName(), fromBo.getNameOid());
toBo.setRevisionSeq(Integer.parseInt(nextRevision.get("REVISIONSEQ").toString()));
toBo.setRevisionValue(nextRevision.get("REVISIONVAL").toString());
--
Gitblit v1.9.3