| | |
| | | import cn.hutool.core.util.ZipUtil; |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.vci.common.qt.object.QTConstants; |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.atm.AttributeDef; |
| | | import com.vci.corba.omd.btm.BizType; |
| | | import com.vci.corba.omd.data.BusinessObject; |
| | | import com.vci.corba.omd.ltm.LinkType; |
| | | import com.vci.corba.omd.ltm.LinkTypeServicePrx; |
| | | import com.vci.dto.OsAttributeDTO; |
| | | import com.vci.model.OsLinkTypeDO; |
| | | import com.vci.omd.constants.AttributeConstants; |
| | | import com.vci.omd.constants.LinkTypeConstants; |
| | | import com.vci.omd.utils.ObjectTool; |
| | | import com.vci.pagemodel.*; |
| | | import com.vci.po.OsAttributePO; |
| | | import com.vci.po.OsLinkTypePO; |
| | | import com.vci.starter.poi.bo.ReadExcelOption; |
| | | import com.vci.starter.poi.bo.WriteExcelData; |
| | |
| | | import com.vci.starter.poi.constant.ExcelLangCodeConstant; |
| | | import com.vci.starter.poi.util.ExcelUtil; |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.enumpck.ResultCodeEnum; |
| | | import com.vci.starter.web.enumpck.VciFieldTypeEnum; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.util.*; |
| | | import com.vci.model.OsLinkTypeDO; |
| | | import com.vci.starter.web.util.Lcm.Func; |
| | | import com.vci.web.service.*; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import javafx.scene.shape.HLineTo; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 链接类型服务 |
| | | * @author weidy |
| | | * @date 2021-2-15 |
| | | * @date 2024-2-15 |
| | | */ |
| | | @Service |
| | | public class OsLinkTypeServiceImpl implements OsLinkTypeServiceI { |
| | |
| | | * 日志 |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | |
| | | /** |
| | | * 平台的调用工具类 |
| | |
| | | } |
| | | vo.setDescription(linkType.description); |
| | | vo.setId(linkType.name); |
| | | vo.setName(linkType.tag); |
| | | vo.setName(linkType.label); |
| | | vo.setFromBtmTypeVOS(btmService.listBtmByIds(Arrays.stream(linkType.btmItemsFrom).collect(Collectors.toSet()))); |
| | | if(!CollectionUtils.isEmpty(vo.getFromBtmTypeVOS())){ |
| | | vo.setFromBtmType(Arrays.stream(linkType.btmItemsFrom).collect(Collectors.joining(","))); |
| | |
| | | List<OsLinkTypeAttributeVO> linkTypeAttributeVOS = new ArrayList<>(); |
| | | Optional.ofNullable(attributeVOS).orElseGet(()->new ArrayList<>()).stream().forEach(attributeVO->{ |
| | | OsLinkTypeAttributeVO linkTypeAttributeVO = new OsLinkTypeAttributeVO(); |
| | | BeanUtil.convert(attributeVO,linkTypeAttributeVO); |
| | | BeanUtilForVCI.convert(attributeVO,linkTypeAttributeVO); |
| | | linkTypeAttributeVO.setPkLinkType(vo.getOid()); |
| | | if(StringUtils.isNotBlank(attributeVO.getBtmTypeId())){ |
| | | linkTypeAttributeVO.setReferFlag(true); |
| | |
| | | * @return 链接类型 |
| | | */ |
| | | @Override |
| | | public OsLinkTypeVO getLinkTypeById(String id) { |
| | | public OsLinkTypeVO getLinkTypeById(String id) throws PLException { |
| | | if(StringUtils.isBlank(id)){ |
| | | return null; |
| | | } |
| | | return self.selectAllLinkMap().getOrDefault(id.toLowerCase(),null); |
| | | LinkType linkType = platformClientUtil.getLinkTypeService().getLinkType(id); |
| | | return this.linkTypeDO2VO(linkType); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 链接类型的属性 |
| | | */ |
| | | @Override |
| | | public List<OsLinkTypeAttributeVO> listAttributeByLinkId(String linkTypeId) { |
| | | public List<OsLinkTypeAttributeVO> listAttributeByLinkId(String linkTypeId) throws PLException { |
| | | OsLinkTypeVO linkTypeVO = getLinkTypeById(linkTypeId); |
| | | return linkTypeVO.getAttributes(); |
| | | } |
| | |
| | | } |
| | | OsBtmTypeAttributeVO attributeVO = attributeVOMap.getOrDefault(attrId.toLowerCase(Locale.ROOT), null); |
| | | if(attributeVO!=null){ |
| | | String vtType = attributeVO.getAttrDataType(); |
| | | String vtType = attributeVO.getAttributeDataType(); |
| | | String attrType = ""; |
| | | VciFieldTypeEnum fieldTypeEnum = VciFieldTypeEnum.forValue(vtType); |
| | | if(fieldTypeEnum == null) { |
| | |
| | | for (String name : names.split(",")) { |
| | | LinkType lt = platformClientUtil.getLinkTypeService().getLinkType(name); |
| | | excelDataList.add(new WriteExcelData(i+1,0, lt.name)); |
| | | excelDataList.add(new WriteExcelData(i+1,1, lt.tag)); |
| | | excelDataList.add(new WriteExcelData(i+1,1, lt.label)); |
| | | excelDataList.add(new WriteExcelData(i+1,2, lt.implClass)); |
| | | excelDataList.add(new WriteExcelData(i+1,3, lt.shape)); |
| | | excelDataList.add(new WriteExcelData(i+1,4, String.join(",",lt.btmItemsFrom))); |
| | |
| | | linkType.relationTo = osLinkTypePO.getRelationTo(); |
| | | linkType.relation = osLinkTypePO.getRelationFrom() + ":" + osLinkTypePO.getRelationTo(); |
| | | linkType.description = osLinkTypePO.getDescription(); |
| | | linkType.tag = osLinkTypePO.getTag(); |
| | | linkType.label = osLinkTypePO.getTag(); |
| | | linkType.shape = osLinkTypePO.getShape(); |
| | | linkType.implClass = osLinkTypePO.getImplClass(); |
| | | linkType.modifier = WebUtil.getCurrentUserId(); |
| | |
| | | } |
| | | return links; |
| | | } |
| | | /** |
| | | * 获取设置排序字段的排序字段 |
| | | * @param linkType 链接类型的编号 |
| | | * @param btmType 业务类型的编号 |
| | | * @param direction 正/反向 |
| | | * @return 属性的信息 |
| | | */ |
| | | @Override |
| | | public List<String> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction) throws PLException, ParseException { |
| | | List<String> abNames = new ArrayList<>(Arrays.asList("OID", "Creator", "CreateTime", "LastModifier", "LASTMODIFYTIME", "F_OID", |
| | | "F_REVISIONOID", "F_NAMEOID", "F_BtwName", "T_OID", "T_REVISIONOID", "T_NAMEOID", "T_BtwName", "TS" )); |
| | | AttributeDef[] attributes = platformClientUtil.getLinkTypeService().getAttributes(linkType); |
| | | for (AttributeDef attribute : attributes) { |
| | | abNames.add(String.valueOf(attribute.name)); |
| | | } |
| | | String wrapper = "T_OID."; |
| | | if(direction.equals(QTConstants.DIRECTION_OPPOSITE)){ |
| | | wrapper = "F_OID."; |
| | | } |
| | | List<OsBtmTypeAttributeVO> bizTypeQTDs = btmService.getBizTypeQTDs(btmType); |
| | | for (OsBtmTypeAttributeVO bizTypeQTD : bizTypeQTDs) { |
| | | abNames.add(wrapper + bizTypeQTD.getId()); |
| | | } |
| | | return abNames; |
| | | } |
| | | |
| | | /** |
| | | * 修复链接类型的xml文件 |