| | |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.framework.data.UserInfo; |
| | | import com.vci.corba.omd.btm.BizType; |
| | | import com.vci.corba.omd.data.*; |
| | | import com.vci.corba.omd.lcm.LifeCycle; |
| | | import com.vci.dto.*; |
| | |
| | | queryFieldList.addAll(linkTypeVO.getAttributes().stream().map(OsLinkTypeAttributeVO::getId).collect(Collectors.toList())); |
| | | queryFieldList.addAll(WebLoServiceImpl.LO_BASE_FIELD_MAP.values()); |
| | | }else{ |
| | | btmTypeVO = btmService.getBtmById(dataGridQuery.getBtmname()); |
| | | //btmTypeVO = btmService.getBtmById(dataGridQuery.getBtmname()); |
| | | btmTypeVO = btmService.getBtmByName(dataGridQuery.getBtmname()); |
| | | queryFieldList.addAll(btmTypeVO.getAttributes().stream().map(OsBtmTypeAttributeVO::getId).collect(Collectors.toList())); |
| | | queryFieldList.addAll(WebBoServiceImpl.BO_BASE_FIELD_MAP.values()); |
| | | } |
| | |
| | | } |
| | | return loService.queryGridByScheme(linkTypeDataQuery); |
| | | }else { |
| | | return boService.queryGridByScheme(queryTemplate, |
| | | DataGrid dataGrid = boService.queryGridByScheme(queryTemplate, |
| | | dataGridQuery.getConditionMap(), replaceMap, dataGridQuery.getPageHelper(), queryFieldList.stream().collect(Collectors.toList())); |
| | | return dataGrid; |
| | | } |
| | | //生命周期在其中查询后就会处理 |
| | | //枚举也会被处理了 |
| | |
| | | * @throws VciBaseException 查询出错的时候会抛出异常 |
| | | */ |
| | | @Override |
| | | public UIFormDataVO getDataForForm(UIFormQuery formQuery) throws VciBaseException { |
| | | public UIFormDataVO getDataForForm(UIFormQuery formQuery) throws VciBaseException, PLException { |
| | | VciBaseUtil.alertNotNull(formQuery,"表单的查询对象",formQuery.getBtmname(),"业务类型的信息",formQuery.getOid(),"业务数据的主键",formQuery.getFormDefineId(),"表单的定义编号"); |
| | | UIFormDefineVO formDefineVO = uiEngineService.getFormById(formQuery.getBtmname(),formQuery.getFormDefineId()); |
| | | String queryTemplate = !CollectionUtils.isEmpty(formQuery.getSourceData())?formQuery.getSourceData().getOrDefault("querytemplate",formDefineVO.getQueryTemplateName()):formDefineVO.getQueryTemplateName(); |
| | |
| | | queryFieldList.addAll(linkTypeVO.getAttributes().stream().map(OsLinkTypeAttributeVO::getId).collect(Collectors.toList())); |
| | | queryFieldList.addAll(WebLoServiceImpl.LO_BASE_FIELD_MAP.values()); |
| | | }else{ |
| | | btmTypeVO = btmService.getBtmById(formQuery.getBtmname()); |
| | | btmTypeVO = btmService.getBtmByName(formQuery.getBtmname()); |
| | | queryFieldList.addAll(btmTypeVO.getAttributes().stream().map(OsBtmTypeAttributeVO::getId).collect(Collectors.toList())); |
| | | } |
| | | queryFieldList.add("creator_name"); |
| | |
| | | * @throws VciBaseException 保存出错的时候会抛出异常 |
| | | */ |
| | | @Override |
| | | public BaseResult<Map<String, Object>> addSave(FormDataDTO formDataDTO) throws VciBaseException { |
| | | public BaseResult<Map<String, Object>> addSave(FormDataDTO formDataDTO) throws VciBaseException, PLException { |
| | | //首先判断对象是否为空 |
| | | VciBaseUtil.alertNotNull(formDataDTO,"添加的数据对象",formDataDTO.getBtmname(),"业务类型的名称",formDataDTO.getFormDefineId(),"表单定义的编号"); |
| | | UIFormDefineVO formDefineVO = uiEngineService.getFormById(formDataDTO.getBtmname(), formDataDTO.getFormDefineId()); |
| | |
| | | * @param newVersion 新版次 |
| | | * @return 执行的结果 |
| | | */ |
| | | private BaseResult<BusinessObject> wrapperCbo(FormDataDTO formDataDTO,UIFormDefineVO formDefineVO,boolean editFlag,boolean newRevision,boolean newVersion){ |
| | | private BaseResult<BusinessObject> wrapperCbo(FormDataDTO formDataDTO,UIFormDefineVO formDefineVO,boolean editFlag,boolean newRevision,boolean newVersion) throws PLException { |
| | | //扩展属性的值 |
| | | Map<String, String> data = formDataDTO.getData(); |
| | | Map<String,String> dataLow = new HashMap<>(); |
| | |
| | | * @throws VciBaseException 保存出错的时候会抛出异常 |
| | | */ |
| | | @Override |
| | | public BaseResult<String> batchAddSave(FormDataDTOList formDataDTOList) throws VciBaseException { |
| | | public BaseResult<String> batchAddSave(FormDataDTOList formDataDTOList) throws VciBaseException, PLException { |
| | | VciBaseUtil.alertNotNull(formDataDTOList,"要添加的数据",formDataDTOList.getFormDataDTOS(),"要添加的数据"); |
| | | //首先判断对象是否为空 |
| | | FormDataDTO firstFormDataDTO = formDataDTOList.getFormDataDTOS().stream().findFirst().get(); |
| | |
| | | * @throws VciBaseException 保存出错的时候会抛出异常 |
| | | */ |
| | | @Override |
| | | public BaseResult<Map<String, Object>> editSave(FormDataDTO formDataDTO) throws VciBaseException { |
| | | public BaseResult<Map<String, Object>> editSave(FormDataDTO formDataDTO) throws VciBaseException, PLException { |
| | | //首先判断对象是否为空 |
| | | VciBaseUtil.alertNotNull(formDataDTO,"修改的数据对象",formDataDTO.getBtmname(),"业务类型的名称",formDataDTO.getFormDefineId(),"表单定义的编号"); |
| | | UIFormDefineVO formDefineVO = uiEngineService.getFormById(formDataDTO.getBtmname(), formDataDTO.getFormDefineId()); |
| | |
| | | * @throws VciBaseException 保存出错的时候会抛出异常 |
| | | */ |
| | | @Override |
| | | public BaseResult<String> batchEditSave(FormDataDTOList formDataDTOList) throws VciBaseException { |
| | | public BaseResult<String> batchEditSave(FormDataDTOList formDataDTOList) throws VciBaseException, PLException { |
| | | VciBaseUtil.alertNotNull(formDataDTOList,"要修改的数据",formDataDTOList.getFormDataDTOS(),"要修改的数据"); |
| | | //首先判断对象是否为空 |
| | | FormDataDTO firstFormDataDTO = formDataDTOList.getFormDataDTOS().stream().findFirst().get(); |
| | |
| | | * @throws VciBaseException 数据被引用的时候会抛出异常 |
| | | */ |
| | | @Override |
| | | public BaseResult batchDelete(DeleteDataDTO deleteDataDTO) throws VciBaseException { |
| | | public BaseResult batchDelete(DeleteDataDTO deleteDataDTO) throws VciBaseException, PLException { |
| | | VciBaseUtil.alertNotNull(deleteDataDTO,"数据传输对象",deleteDataDTO.getDataList(),"数据传输对象"); |
| | | String btmName = deleteDataDTO.getDataList().get(0).getBtmname(); |
| | | List<String> oidList = deleteDataDTO.getDataList().stream().map(BaseModelDTO::getOid).collect(Collectors.toList()); |
| | |
| | | List<BusinessObject> cbo = null; |
| | | if(deleteDataDTO.isCascade()){ |
| | | //级联删除 |
| | | OsBtmTypeVO btmTypeVO = btmService.getBtmById(btmName); |
| | | OsBtmTypeVO btmTypeVO = btmService.getBtmByName(btmName); |
| | | OsBtmTypeAttributeVO parentAttributeVO = btmTypeVO.getAttributes().stream().filter(s -> s.getReferBtmTypeId().equalsIgnoreCase(btmName)).findFirst().orElseGet(null); |
| | | if(parentAttributeVO != null){ |
| | | //页面分页不能显示超过1000 |
| | |
| | | * @throws VciBaseException 参数为空,必输项缺失 |
| | | */ |
| | | @Override |
| | | public BaseResult<String> linkAddSave(FormLinkDataDTO formLinkDataDTO) throws VciBaseException { |
| | | public BaseResult<String> linkAddSave(FormLinkDataDTO formLinkDataDTO) throws VciBaseException, PLException { |
| | | //首先判断对象是否为空 |
| | | VciBaseUtil.alertNotNull(formLinkDataDTO,"添加的数据对象",formLinkDataDTO.getLinkType(),"链接类型的名称",formLinkDataDTO.getFormDefineId(),"表单定义的编号"); |
| | | if(formLinkDataDTO.getData() ==null){ |
| | |
| | | * @param boData to的数据 |
| | | * @return 包含的对象 |
| | | */ |
| | | private BaseResult<BusinessObject> wrapperToCbo(FormLinkDataDTO formLinkDataDTO,UIFormDefineVO formDefineVO,String toOid,String toBtmName,Map<String,String> boData){ |
| | | private BaseResult<BusinessObject> wrapperToCbo(FormLinkDataDTO formLinkDataDTO,UIFormDefineVO formDefineVO,String toOid,String toBtmName,Map<String,String> boData) throws PLException { |
| | | Map<String,String> dataLow = new HashMap<>(); |
| | | boData.forEach((key,value)->{ |
| | | dataLow.put(key.toLowerCase(),value); |
| | |
| | | * @param newVersion 是否升版次 |
| | | * @return cbo对象 |
| | | */ |
| | | public BusinessObject createOrGetCbo(Map<String,String> dataLowMap,Map<String,String> baseDataMap,boolean editFlag,boolean newRevision,boolean newVersion){ |
| | | public BusinessObject createOrGetCbo(Map<String,String> dataLowMap,Map<String,String> baseDataMap,boolean editFlag,boolean newRevision,boolean newVersion) throws PLException { |
| | | String btmName = baseDataMap.get("btmname"); |
| | | String oid = baseDataMap.get("oid"); |
| | | // BusinessObject cbo = new BusinessObject(); |
| | | BusinessObject cbo = new BusinessObject(); |
| | | String copyfromversion = baseDataMap.get("copyfromversion"); |
| | | OsBtmTypeVO btmTypeVO = btmService.getBtmById(btmName); |
| | | List<String> attributeList = btmTypeVO.getAttributes().stream().map(attribute -> attribute.getId()).collect(Collectors.toList()); |
| | | //OsBtmTypeVO btmTypeVO = btmService.getBtmById(btmName); |
| | | OsBtmTypeVO btmTypeVO = btmService.getBtmByName(btmName); |
| | | //List<String> attributeList = btmTypeVO.getAttributes().stream().map(attribute -> attribute.getId()).collect(Collectors.toList()); |
| | | if(editFlag || newRevision || newVersion){ |
| | | try { |
| | | cbo = platformClientUtil.getBOFService().readBusinessObject(editFlag?oid:copyfromversion,btmName); |
| | |
| | | if(StringUtils.isBlank(cbo.btName)){ |
| | | cbo.btName = btmTypeVO.getId(); |
| | | } |
| | | |
| | | if(btmTypeVO.isRevisionFlag()){ |
| | | //要管理版本 |
| | | if(btmTypeVO.isInputRevisionFlag() && StringUtils.isNotBlank(baseDataMap.getOrDefault("revisionvalue",""))){ |
| | |
| | | // } |
| | | // } |
| | | setValueToCbo(dataLowMap,baseDataMap,cbo,editFlag); |
| | | // cbo.setName(dataLowMap.get("name")); |
| | | //TODO:默认属性需要放在cbo外层 |
| | | if(StringUtils.isNotBlank(baseDataMap.getOrDefault("id",""))){ |
| | | cbo.id = baseDataMap.getOrDefault("id",""); |
| | | } |
| | | if(StringUtils.isNotBlank(baseDataMap.getOrDefault("name",""))){ |
| | | cbo.name = baseDataMap.getOrDefault("name",""); |
| | | } |
| | | if(StringUtils.isNotBlank(baseDataMap.getOrDefault("description",""))){ |
| | | cbo.description = baseDataMap.getOrDefault("description",""); |
| | | } |
| | | return cbo; |
| | | } |
| | | |
| | |
| | | * @throws VciBaseException 参数为空,必输项缺失 |
| | | */ |
| | | @Override |
| | | public BaseResult linkEditSave(FormLinkDataDTO formLinkDataDTO) throws VciBaseException { |
| | | public BaseResult linkEditSave(FormLinkDataDTO formLinkDataDTO) throws VciBaseException, PLException { |
| | | VciBaseUtil.alertNotNull(formLinkDataDTO,"修改的数据对象",formLinkDataDTO.getLinkType(),"链接类型的名称", |
| | | formLinkDataDTO.getFormDefineId(),"表单定义的编号",formLinkDataDTO.getOid(),"主键", |
| | | formLinkDataDTO.getFoid(),"from端主键",formLinkDataDTO.getToid(),"to端主键"); |
| | |
| | | * @return 列表数据 |
| | | */ |
| | | @Override |
| | | public DataGrid referDataGrid(ReferConfigVO referConfigVO, PageHelper pageHelper) { |
| | | public DataGrid referDataGrid(ReferConfigVO referConfigVO, PageHelper pageHelper) throws PLException { |
| | | checkReferConfig(referConfigVO); |
| | | //使用业务类型查询 |
| | | OsBtmTypeVO btmById = btmService.getBtmById(referConfigVO.getReferBo()); |
| | | OsBtmTypeVO btmById = btmService.getBtmByName(referConfigVO.getReferBo()); |
| | | if(referConfigVO.getConditionMap() == null){ |
| | | referConfigVO.setConditionMap(new HashMap<>()); |
| | | } |