| | |
| | | import com.vci.starter.web.annotation.bus.VciChangeDataPlugin; |
| | | import com.vci.starter.web.constant.FrameWorkLcStatusConstant; |
| | | import com.vci.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.starter.web.dto.BaseLinkModelDTO; |
| | | import com.vci.starter.web.dto.BaseLinkModelDTOList; |
| | | import com.vci.starter.web.dto.BaseModelDTO; |
| | | import com.vci.starter.web.dto.BaseModelDTOList; |
| | | import com.vci.starter.web.enumpck.VciChangeDocumentTypeEnum; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.model.BaseModel; |
| | |
| | | import com.vci.web.service.*; |
| | | import com.vci.web.service.impl.WebBoServiceImpl; |
| | | import com.vci.web.service.impl.WebLoServiceImpl; |
| | | import com.vci.web.service.uidataservice.UIDataBaseServiceI; |
| | | import com.vci.web.service.uidataservice.UIDataCommonServiceI; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | |
| | | if(Func.isNotEmpty(dataGridQuery.getSourceData())){ |
| | | dataGridQuery.setSourceData(this.convertMapValueJson2Map(dataGridQuery.getSourceData())); |
| | | } |
| | | //先判断查询模板是否配置了自定义查询类 |
| | | UIComponentVO componentVO = uiEngineService.getComponentByOid(dataGridQuery.getComponentOid(), null); |
| | | UITableDefineVO tableDefineVO = componentVO.getTableDefineVO(); |
| | | String bsCustQueryCLsOrUrl = componentVO.getBsCustQueryCLsOrUrl(); |
| | | //先判断查询模板是否配置了自定义查询类 |
| | | String bsCustQueryCLsOrUrl = componentVO.getBsDataModel() ; |
| | | // TODO: 2024/12/5 Ludc 根据UI配置的进行判断是否使用自定义类进行查询(自定义类查询方式优先级高于查询模板) |
| | | if(Func.isNotBlank(bsCustQueryCLsOrUrl) && isCustomClass(bsCustQueryCLsOrUrl)){ |
| | | //通过反射调用bsCustQueryCLsOrUrl中定义的服务类中的查询方法 |
| | |
| | | //先判断查询模板是否配置了自定义查询类 |
| | | UIComponentVO componentVO = uiEngineService.getComponentByOid(formQuery.getComponentOid(), null); |
| | | //UIFormDefineVO formDefineVO = uiEngineService.getFormById(formQuery.getBtmName(),formQuery.getFormDefineId()); |
| | | String bsCustQueryCLsOrUrl = componentVO.getBsCustQueryCLsOrUrl(); |
| | | String bsCustQueryCLsOrUrl = componentVO.getBsDataModel(); |
| | | if(Func.isNotBlank(bsCustQueryCLsOrUrl) && isCustomClass(bsCustQueryCLsOrUrl)){ |
| | | //通过反射调用bsCustQueryCLsOrUrl中定义的服务类中的查询方法 |
| | | try { |
| | |
| | | if(componentVO == null || StringUtils.isBlank(componentVO.getOid())){ |
| | | throw new VciBaseException("树的配置信息没有获取到"); |
| | | } |
| | | String bsCustQueryCLsOrUrl = componentVO.getBsCustQueryCLsOrUrl(); |
| | | String bsCustQueryCLsOrUrl = componentVO.getBsDataModel(); |
| | | if(Func.isNotBlank(bsCustQueryCLsOrUrl) && isCustomClass(bsCustQueryCLsOrUrl)){ |
| | | //通过反射调用bsCustQueryCLsOrUrl中定义的服务类中的查询方法 |
| | | try { |
| | |
| | | //TODO: 替换树定义上的正反向查询属性,因为正反向查询是由链接类型查询模板上控制的 |
| | | boolean isOrientation = false; //是否反向,使用模板上配置的 |
| | | String qtName = treeDefineVO.getQueryTemplateName(); |
| | | if(Func.isNotBlank(treeDefineVO.getLinkType()) && Func.isNotBlank(qtName)){ |
| | | QTInfo wrapper = platformClientUtil.getQTDService().getQT(qtName); |
| | | QueryTemplate qt = OQTool.getQTByDoc(DocumentHelper.parseText(wrapper.qtText), qtName); |
| | | isOrientation = qt.getDirection().equals("opposite"); |
| | | if(Func.isNotBlank(treeDefineVO.getOrientation())){ |
| | | isOrientation = treeDefineVO.getOrientation().equalsIgnoreCase("opposite"); |
| | | }else{ |
| | | if(Func.isNotBlank(treeDefineVO.getLinkType()) && Func.isNotBlank(qtName)){ |
| | | QTInfo wrapper = platformClientUtil.getQTDService().getQT(qtName); |
| | | QueryTemplate qt = OQTool.getQTByDoc(DocumentHelper.parseText(wrapper.qtText), qtName); |
| | | isOrientation = qt.getDirection().equals("opposite"); |
| | | } |
| | | } |
| | | if(treeQuery.getConditionMap() == null){ |
| | | treeQuery.setConditionMap(new HashMap<>()); |
| | |
| | | UITreeDefineVO treeDefineVO = componentVO.getTreeDefineVO(); |
| | | boolean isOrientation = false; //是否反向,使用模板上配置的 |
| | | String qtName = treeDefineVO.getQueryTemplateName(); |
| | | if(Func.isNotBlank(treeDefineVO.getLinkType()) && Func.isNotBlank(qtName)){ |
| | | QTInfo wrapper = platformClientUtil.getQTDService().getQT(qtName); |
| | | QueryTemplate qt = OQTool.getQTByDoc(DocumentHelper.parseText(wrapper.qtText), qtName); |
| | | isOrientation = qt.getDirection().equals("opposite"); |
| | | if(Func.isNotBlank(treeDefineVO.getOrientation())){ |
| | | isOrientation = treeDefineVO.getOrientation().equalsIgnoreCase("opposite"); |
| | | }else{ |
| | | if(Func.isNotBlank(treeDefineVO.getLinkType()) && Func.isNotBlank(qtName)){ |
| | | QTInfo wrapper = platformClientUtil.getQTDService().getQT(qtName); |
| | | QueryTemplate qt = OQTool.getQTByDoc(DocumentHelper.parseText(wrapper.qtText), qtName); |
| | | isOrientation = qt.getDirection().equals("opposite"); |
| | | } |
| | | } |
| | | |
| | | String queryTemplate = StringUtils.isNotBlank(treeQuery.getQueryTemplate())?treeQuery.getQueryTemplate():(!CollectionUtils.isEmpty(treeQuery.getSourceData())? (String) treeQuery.getSourceData().getOrDefault("querytemplate",treeDefineVO.getQueryTemplateName()) :treeDefineVO.getQueryTemplateName()); |
| | | Map<String, Object> replaceMap = wrapperReplaceMap(treeQuery.getSourceData()); |
| | | List<String> queryFieldList = new ArrayList<>(); |
| | |
| | | BaseModel baseModel = new BaseModel(); |
| | | baseModel.setOid(cbo.oid); |
| | | baseModel.setNameOid(cbo.nameoid); |
| | | baseModel.setRevisionOid(cbo.revisionid); |
| | | baseModel.setRevisionOid(cbo.revoid); |
| | | baseModel.setBtmName(cbo.btName); |
| | | baseModel.setLastR(String.valueOf(cbo.isLastR)); |
| | | baseModel.setLastV(String.valueOf(cbo.isLastV)); |
| | |
| | | //说明是升版 |
| | | BaseModel baseModel = cbo2BaseModel(cbo); |
| | | RevisionDataInfo revisionValueObject = getNextRevision(btmTypeVO,baseModel); |
| | | cbo.revisionid = VciBaseUtil.getPk(); |
| | | cbo.revoid = VciBaseUtil.getPk(); |
| | | cbo.revisionSeq = revisionValueObject.revisionSeq; |
| | | cbo.revisionValue = revisionValueObject.revisionVal; |
| | | cbo.isLastR = true; |
| | |
| | | if (StringUtils.isBlank(cbo.nameoid)) { |
| | | cbo.nameoid = VciBaseUtil.getPk(); |
| | | } |
| | | if (StringUtils.isBlank(cbo.revisionid)) { |
| | | cbo.revisionid = VciBaseUtil.getPk(); |
| | | if (StringUtils.isBlank(cbo.revoid)) { |
| | | cbo.revoid = VciBaseUtil.getPk(); |
| | | } |
| | | cbo.isFirstR = true; |
| | | cbo.isLastR = true; |
| | |
| | | throw new PLException("500", new String[]{"没有获取到数据的主键"}); |
| | | } |
| | | for (BusinessObject cbo : cbos) { |
| | | if(StringUtils.isBlank(cbo.revisionid)){ |
| | | String revisionoid = Arrays.stream(cbo.hisAttrValList).filter(e -> e.attrName.equals("REVISIONOID")).findFirst().map(e -> e.attrVal).orElse(""); |
| | | cbo.revisionid = revisionoid; |
| | | if(StringUtils.isBlank(cbo.revoid)){ |
| | | String revisionoid = Arrays.stream(cbo.hisAttrValList).filter(e -> e.name.equals("REVISIONOID")).findFirst().map(e -> e.value).orElse(""); |
| | | cbo.revoid = revisionoid; |
| | | } |
| | | boolean b = platformClientUtil.getBOFService().deleteBusinessObject(cbo,type); |
| | | if(!b){ |