| | |
| | | |
| | | import com.vci.client.common.providers.ServiceProvider; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.common.VCIError; |
| | | import com.vci.corba.omd.lcm.Bound; |
| | | import com.vci.corba.omd.lcm.LifeCycle; |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.util.VciDateUtil; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.web.constant.CacheKeyConstant; |
| | | import com.vci.web.model.OsLifeCycleDO; |
| | | import com.vci.web.model.OsStatusDO; |
| | | import com.vci.web.pageModel.*; |
| | | import com.vci.web.service.OsLifeCycleServiceI; |
| | | import com.vci.web.service.OsLinkTypeServiceI; |
| | | import com.vci.web.service.OsStatusServiceI; |
| | | import com.vci.web.service.WebBoServiceI; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.tools.ant.taskdefs.condition.Os; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.CachePut; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import plm.bs.bom.clientobject.ClientBusinessObject; |
| | | import plm.bs.bom.common.BusinessObject; |
| | | import plm.bs.bom.common.BusinessObjectHolder; |
| | | import plm.corba.lifecycle.Bound; |
| | | import plm.corba.lifecycle.LifeCyle; |
| | | import plm.corba.lifecycle.TransitionVO; |
| | | import plm.corba.lifecycle.TransitionVOEvent; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | * @return 数据对象 |
| | | */ |
| | | @Override |
| | | public LifeCyle lifeCycleVO2DO(OsLifeCycleVO lifeCycleVO){ |
| | | LifeCyle lifeCyle = new LifeCyle(); |
| | | public LifeCycle lifeCycleVO2DO(OsLifeCycleVO lifeCycleVO){ |
| | | LifeCycle lifeCyle = new LifeCycle(); |
| | | lifeCyle.name = lifeCycleVO.getId(); |
| | | lifeCyle.tag = lifeCycleVO.getName(); |
| | | lifeCyle.oid = lifeCycleVO.getOid(); |
| | | lifeCyle.creator = lifeCycleVO.getCreator(); |
| | | lifeCyle.description = lifeCycleVO.getDescription(); |
| | | lifeCyle.modifier = lifeCycleVO.getLastModifier(); |
| | | lifeCyle.modifyTime = VciDateUtil.date2Str(lifeCycleVO.getLastModifyTime(),VciDateUtil.DateTimeFormat); |
| | | lifeCyle.createTime = VciDateUtil.date2Str(lifeCycleVO.getCreateTime(),VciDateUtil.DateTimeFormat); |
| | | lifeCyle.modifyTime = lifeCycleVO.getLastModifyTime().getTime(); |
| | | lifeCyle.createTime = lifeCycleVO.getCreateTime().getTime(); |
| | | lifeCyle.startState =lifeCycleVO.getStartStatus(); |
| | | lifeCyle.ts = VciDateUtil.date2Str(lifeCycleVO.getTs(),VciDateUtil.DateTimeMillFormat); |
| | | if(lifeCycleVO.getBounds() !=null && lifeCycleVO.getBounds().length>0) { |
| | |
| | | try { |
| | | com.vci.corba.omd.lcm.TransitionVO transitionVO = lifeCycleLineVO2DO(lineVO); |
| | | // platformClientUtil.getBOFactoryService().transferBusinessObject(new BusinessObjectHolder(obj), transitionVO); |
| | | ServiceProvider.getBOFService().transferBusinessObject(obj, transitionVO); |
| | | ServiceProvider.getBOFService().transferBusinessObject(obj, transitionVO.destination); |
| | | } catch (PLException e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | |
| | | * @param lifeCyleList 生命周期的内容 |
| | | */ |
| | | @Override |
| | | public void batchAddLifeCycle(List<LifeCyle> lifeCyleList) { |
| | | public void batchAddLifeCycle(List<LifeCycle> lifeCyleList) { |
| | | if(!CollectionUtils.isEmpty(lifeCyleList)){ |
| | | lifeCyleList.stream().forEach(lifeCyle -> { |
| | | try { |
| | | platformClientUtil.getLifeCycleService().addLifeCyle(lifeCyle); |
| | | } catch (VCIError e) { |
| | | platformClientUtil.getLifeCycleService().addLifeCycle(lifeCyle); |
| | | } catch (PLException e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | | }); |
| | |
| | | * @param lifeCycleList 生命周期的内容 |
| | | */ |
| | | @Override |
| | | public void batchEditLifeCycle(List<LifeCyle> lifeCycleList) { |
| | | public void batchEditLifeCycle(List<LifeCycle> lifeCycleList) { |
| | | if(!CollectionUtils.isEmpty(lifeCycleList)){ |
| | | lifeCycleList.stream().forEach(lifeCyle -> { |
| | | try { |
| | | platformClientUtil.getLifeCycleService().modifyLifeCyle(lifeCyle); |
| | | } catch (VCIError e) { |
| | | platformClientUtil.getLifeCycleService().modifyLifeCycle(lifeCyle); |
| | | } catch (PLException e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | | }); |