Beispiel #1
0
        public FlowChartDetailGetByMasterInfo QueryBindBomByMasterId(int id)
        {
            var masterItem = flowChartMasterRepository.GetById(id);

            FlowChartDetailGetByMasterInfo detailInfo = new FlowChartDetailGetByMasterInfo();

            detailInfo.BU_D_Name     = masterItem.System_Project.System_BU_D.BU_D_Name;
            detailInfo.Project_Name  = masterItem.System_Project.Project_Name;
            detailInfo.Part_Types    = masterItem.Part_Types;
            detailInfo.Product_Phase = masterItem.System_Project.Product_Phase;

            return(detailInfo);
        }
Beispiel #2
0
        public string CheckFlowChart(FlowChartExcelImportParas parasItem)
        {
            string isValid = string.Empty;
            var    budItem = systemBUDRepository.GetMany(m => m.BU_D_Name == parasItem.BU_D_Name).FirstOrDefault();

            //如果budItem没有,说明不存在这个客户
            if (budItem != null)
            {
                if (parasItem.isEdit)
                {
                    var masterItem = flowChartMasterRepository.GetById(parasItem.FlowChart_Master_UID);
                    if (masterItem.System_Project.Project_Name == parasItem.Project_Name && masterItem.System_Project.System_BU_D.BU_D_Name == parasItem.BU_D_Name &&
                        masterItem.System_Project.Product_Phase == parasItem.Product_Phase && masterItem.Part_Types == parasItem.Part_Types)
                    {
                        isValid = string.Format("{0}_{1}_{2}_{3}", masterItem.FlowChart_Master_UID, masterItem.Project_UID, masterItem.FlowChart_Version, masterItem.System_Project.Organization_UID);
                    }
                    else
                    {
                        isValid = string.Format("客户{0},专案名称{1},部件{2},阶段{3}不匹配,不能更新", parasItem.BU_D_Name, parasItem.Project_Name, parasItem.Part_Types, parasItem.Product_Phase);
                    }
                }
                else
                {
                    var projetItem = systemProjectRepository.GetMany(m => m.BU_D_UID == budItem.BU_D_UID && m.Project_Name == parasItem.Project_Name &&
                                                                     m.Product_Phase == parasItem.Product_Phase && parasItem.Organization_UIDList.Contains(m.Organization_UID)).FirstOrDefault();
                    //如果projectUIDList没有,说明该数据不存在
                    if (projetItem != null)
                    {
                        //如果flItem为空,说明可以新导入这条数据
                        var flItem = flowChartMasterRepository.GetMany(m => m.Project_UID == projetItem.Project_UID && m.Part_Types == parasItem.Part_Types).FirstOrDefault();
                        if (flItem == null)
                        {
                            isValid = string.Format("{0}_{1}", projetItem.Project_UID.ToString(), projetItem.Organization_UID);
                        }
                        else
                        {
                            isValid = string.Format("导入的专案{0}已经存在,不能新增专案", parasItem.Project_Name);
                        }
                    }
                    else
                    {
                        isValid = string.Format("客户{0}或专案名称{1}或阶段{2}不存在,或者用户没有该专案的权限,不能导入", parasItem.BU_D_Name, parasItem.Project_Name, parasItem.Product_Phase);
                    }
                }
            }
            else
            {
                isValid = string.Format("客户名称{0}不存在", parasItem.BU_D_Name);
            }
            return(isValid);
        }
Beispiel #3
0
        public PagedListModel <FlowChartDetailGet> QueryFLDetailList(int id, int Version)
        {
            var totalCount = 0;
            var masterItem = flowChartMasterRepository.GetById(id);

            if (masterItem != null)
            {
                IList <FlowChartDetailGet> importList = new List <FlowChartDetailGet>();

                var flChartList = flowChartMasterRepository.QueryFLDetailList(id, Version, out totalCount);
                //importItem.FlowChartMasterDTO = AutoMapper.Mapper.Map<FlowChartMasterDTO>(masterItem);
                foreach (var flChartItem in flChartList)
                {
                    FlowChartDetailGet importDetailItem = new FlowChartDetailGet();
                    importDetailItem.FlowChartDetailDTO = AutoMapper.Mapper.Map <FlowChartDetailDTO>(flChartItem);
                    if (flChartItem.FatherProcess_UID != null)
                    {
                        var process = flChartList.Where(m => m.FlowChart_Detail_UID == flChartItem.FatherProcess_UID).Select(m => m.Process).First();
                        importDetailItem.FlowChartDetailDTO.FatherProcess = process;
                    }

                    switch (flChartItem.IsQAProcess)
                    {
                    case StructConstants.IsQAProcessType.InspectKey:     //IPQC全检
                        importDetailItem.FlowChartDetailDTO.IsQAProcessName = StructConstants.IsQAProcessType.InspectText;
                        break;

                    case StructConstants.IsQAProcessType.PollingKey:     //IPQC巡检
                        importDetailItem.FlowChartDetailDTO.IsQAProcessName = StructConstants.IsQAProcessType.PollingText;
                        break;

                    case StructConstants.IsQAProcessType.InspectOQCKey:     //OQC检测
                        importDetailItem.FlowChartDetailDTO.IsQAProcessName = StructConstants.IsQAProcessType.InspectOQCText;
                        break;

                    case StructConstants.IsQAProcessType.InspectAssembleKey:     //组装检测
                        importDetailItem.FlowChartDetailDTO.IsQAProcessName = StructConstants.IsQAProcessType.InspectAssembleText;
                        break;

                    case StructConstants.IsQAProcessType.AssembleOQCKey:     //组装&OQC检测
                        importDetailItem.FlowChartDetailDTO.IsQAProcessName = StructConstants.IsQAProcessType.AssembleOQCText;
                        break;

                    default:
                        importDetailItem.FlowChartDetailDTO.IsQAProcessName = string.Empty;
                        break;
                    }

                    //importDetailItem.FlowChartMgDataDTO = AutoMapper.Mapper.Map<FlowChartMgDataDTO>(flChartItem.FlowChart_MgData.FirstOrDefault());
                    importDetailItem.SystemUserDTO = AutoMapper.Mapper.Map <SystemUserDTO>(flChartItem.System_Users);
                    importDetailItem.FunPlant      = flChartItem.System_Function_Plant.FunPlant;
                    importList.Add(importDetailItem);
                }

                return(new PagedListModel <FlowChartDetailGet>(0, importList));
            }
            else
            {
                return(null);
            }
        }