Beispiel #1
0
 /// <summary>
 /// JisPartBoxInfo -> JisCounterInfo
 /// </summary>
 /// <param name="jisPartBoxInfo"></param>
 /// <param name="jisCounterInfo"></param>
 public static void GetJisCounterInfo(JisPartBoxInfo jisPartBoxInfo, ref JisCounterInfo jisCounterInfo)
 {
     if (jisPartBoxInfo == null)
     {
         return;
     }
     ///PART_BOX_FID
     jisCounterInfo.PartBoxFid = jisPartBoxInfo.Fid;
     ///PART_BOX_CODE
     jisCounterInfo.PartBoxCode = jisPartBoxInfo.PartBoxCode;
     ///PLANT
     jisCounterInfo.Plant = jisPartBoxInfo.Plant;
     ///PLANT_ZONE
     jisCounterInfo.PlantZone = jisPartBoxInfo.PlantZone;
     ///WORKSHOP
     jisCounterInfo.Workshop = jisPartBoxInfo.Workshop;
     ///ASSEMBLY_LINE
     jisCounterInfo.AssemblyLine = jisPartBoxInfo.AssemblyLine;
     ///WORKSHOP_SECTION
     jisCounterInfo.WorkshopSection = jisPartBoxInfo.WorkshopSection;
     ///LOCATION
     jisCounterInfo.Location = jisPartBoxInfo.Location;
     ///SUPPLIER_NUM
     jisCounterInfo.SupplierNum = jisPartBoxInfo.SupplierNum;
     ///ACCUMULATIVE_TYPE
     jisCounterInfo.AccumulativeType = jisPartBoxInfo.AccumulativeType;
     ///ACCUMULATIVE_QTY
     jisCounterInfo.AccumulativeQty = jisPartBoxInfo.AccumulativeQty;
     ///PACKAGE_MODEL
     jisCounterInfo.PackageModel = jisPartBoxInfo.PackageModel;
     ///COMMENTS
     jisCounterInfo.Comments = jisPartBoxInfo.Comments;
 }
        /// <summary>
        /// JisPartBoxInfo - > jisCounterInfo
        /// </summary>
        /// <param name="jisPartBoxInfo"></param>
        /// <param name="jisCounterInfo"></param>
        private JisCounterInfo CreateJisCounterInfo(JisPartBoxInfo jisPartBoxInfo)
        {
            ///创建计数器
            JisCounterInfo jisCounterInfo = JisCounterBLL.CreateJisCounterInfo(loginUser);

            ///以物料拉动信息填充计数器
            JisCounterBLL.GetJisCounterInfo(jisPartBoxInfo, ref jisCounterInfo);
            ///
            jisCounterInfo.Id = new JisCounterBLL().InsertInfo(jisCounterInfo);
            if (jisCounterInfo.Id == 0)
            {
                throw new Exception("MC:0x00000454");///排序计数器创建失败
            }
            return(jisCounterInfo);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="jisPartBoxInfo"></param>
        /// <param name="jisCounterInfo"></param>
        /// <param name="vehiclePointStatusInfo"></param>
        /// <param name="maintainInhouseLogisticStandardInfo"></param>
        /// <param name="currentQty"></param>
        /// <returns></returns>
        private string UpdateJisCounter(JisPartBoxInfo jisPartBoxInfo, JisCounterInfo jisCounterInfo, VehiclePointStatusInfo vehiclePointStatusInfo, MaintainInhouseLogisticStandardInfo maintainInhouseLogisticStandardInfo, decimal currentQty)
        {
            ///创建计数器日志
            JisCounterLogInfo jisCounterLogInfo = JisCounterLogBLL.CreateJisCounterLogInfo(jisCounterInfo.Fid.GetValueOrDefault(), loginUser);

            ///以车辆过点信息填充计数器日志
            JisCounterLogBLL.GetJisCounterLogInfo(vehiclePointStatusInfo, ref jisCounterLogInfo);
            ///以零件类信息填充计数器日志
            JisCounterLogBLL.GetJisCounterLogInfo(jisPartBoxInfo, ref jisCounterLogInfo);
            ///以物料拉动信息填充计数器日志
            JisCounterLogBLL.GetJisCounterLogInfo(maintainInhouseLogisticStandardInfo, ref jisCounterLogInfo);
            ///PART_QTY
            jisCounterLogInfo.PartQty = currentQty;
            ///
            return(JisCounterLogDAL.GetInsertSql(jisCounterLogInfo));
        }
Beispiel #4
0
        /// <summary>
        /// 新建计数器对象
        /// </summary>
        /// <param name="loginUser"></param>
        /// <returns></returns>
        public static JisCounterInfo CreateJisCounterInfo(string loginUser)
        {
            JisCounterInfo jisCounterInfo = new JisCounterInfo();

            ///CreateUser
            jisCounterInfo.CreateUser = loginUser;
            ///CreateDate
            jisCounterInfo.CreateDate = DateTime.Now;
            ///ValidFlag
            jisCounterInfo.ValidFlag = true;
            ///Fid
            jisCounterInfo.Fid = Guid.NewGuid();
            ///STATUS
            jisCounterInfo.Status = (int)JisCounterStatusConstants.Accumulating;
            ///
            return(jisCounterInfo);
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="jisPartBoxInfo"></param>
 /// <param name="jisCounterInfo"></param>
 /// <param name="vehiclePointStatusInfo"></param>
 /// <param name="maintainInhouseLogisticStandardInfo"></param>
 /// <param name="currentQty"></param>
 /// <param name="jisCounterStatus"></param>
 /// <returns></returns>
 private string UpdateJisCounter(JisPartBoxInfo jisPartBoxInfo, JisCounterInfo jisCounterInfo, decimal currentQty, int jisCounterStatus)
 {
     return("update [LES].[TT_MPM_JIS_COUNTER] set " +
            "[PART_BOX_CODE] = N'" + jisPartBoxInfo.PartBoxCode + "'," +
            "[PLANT] = N'" + jisPartBoxInfo.Plant + "'," +
            "[PLANT_ZONE] = N'" + jisPartBoxInfo.PlantZone + "'," +
            "[WORKSHOP] = N'" + jisPartBoxInfo.Workshop + "'," +
            "[ASSEMBLY_LINE] = N'" + jisPartBoxInfo.AssemblyLine + "'," +
            "[WORKSHOP_SECTION] = N'" + jisPartBoxInfo.WorkshopSection + "'," +
            "[LOCATION] = N'" + jisPartBoxInfo.Location + "'," +
            "[SUPPLIER_NUM] = N'" + jisPartBoxInfo.SupplierNum + "'," +
            "[ACCUMULATIVE_TYPE] = " + jisPartBoxInfo.AccumulativeType.GetValueOrDefault() + "," +
            "[ACCUMULATIVE_QTY] = " + jisPartBoxInfo.AccumulativeQty.GetValueOrDefault() + "," +
            "[PACKAGE_MODEL] = N'" + jisPartBoxInfo.PackageModel + "'," +
            "[CURRENT_QTY] = isnull([CURRENT_QTY],0) + " + currentQty + "," +
            "[STATUS] = " + jisCounterStatus + "," +
            "[MODIFY_DATE] = GETDATE()," +
            "[MODIFY_USER] = N'" + loginUser + "' where " +
            "[ID] = " + jisCounterInfo.Id + ";");
 }
        /// <summary>
        /// Jis拉动
        /// </summary>
        /// <param name="jisPartBoxInfo"></param>
        /// <param name="jisCounterInfo"></param>
        /// <param name="jisCounterLogs"></param>
        /// <param name="maintainInhouseLogistics"></param>
        /// <param name="JisPullGuid"></param>
        /// <param name="orderCode"></param>
        /// <param name="pullOrdersInfos"></param>
        /// <param name="isJis"></param>
        /// <returns></returns>
        public string JisPull(JisPartBoxInfo jisPartBoxInfo, JisCounterInfo jisCounterInfo, List <JisCounterLogInfo> jisCounterLogs, List <MaintainInhouseLogisticStandardInfo> maintainInhouseLogistics, List <PullOrdersInfo> pullOrdersInfos, bool isJis)
        {
            StringBuilder stringBuilder = new StringBuilder();
            ///拉动单Guid
            Guid JisPullGuid = Guid.NewGuid();
            ///拉动单号
            string orderCode = new SeqDefineBLL().GetCurrentCode("JIS_PULL_ORDER_CODE");
            ///单据衔接
            MaterialPullingOrderInfo materialPullingOrderInfo = MaterialPullingCommonBLL.CreateMaterialPullingOrderInfo();

            ///jisPartBoxInfo -> MaterialPullingOrderInfo
            MaterialPullingCommonBLL.GetJisMaterialPullingOrderInfo(jisPartBoxInfo, ref materialPullingOrderInfo);
            ///orderCode -> MaterialPullingOrderInfo
            MaterialPullingCommonBLL.GetorderCodeMaterialPullingOrderInfo(orderCode, ref materialPullingOrderInfo);
            foreach (JisCounterLogInfo jisCounterLog in jisCounterLogs)
            {
                ///物料拉动信息
                MaintainInhouseLogisticStandardInfo maintainInhouseLogisticStandardInfo = maintainInhouseLogistics.Where(d => d.PartNo == jisCounterLog.PartNo).FirstOrDefault();
                if (maintainInhouseLogisticStandardInfo == null)
                {
                    continue;
                }
                ///生产订单信息
                PullOrdersInfo pullOrdersInfo = pullOrdersInfos.FirstOrDefault(d => d.OrderNo == jisCounterLog.SourceData);
                if (pullOrdersInfo == null)
                {
                    continue;
                }
                ///仓储衔接明细表
                MaterialPullingOrderDetailInfo detailInfo = MaterialPullingCommonBLL.CreateMaterialPullingOrderDetailInfo();
                ///maintainInhouseLogisticStandardInfo -> MaterialPullingOrderDetailInfo
                MaterialPullingCommonBLL.GetMainMaterialPullingOrderDetailInfo(maintainInhouseLogisticStandardInfo, jisCounterLog.PartQty.GetValueOrDefault(), ref detailInfo);
                ///jisPartBoxInfo-> MaterialPullingOrderDetailInfo
                MaterialPullingCommonBLL.GetJisMaterialPullingOrderDetailInfo(jisPartBoxInfo, ref detailInfo);
                ///orderCode-> MaterialPullingOrderDetailInfo
                MaterialPullingCommonBLL.GetOrderCodeMaterialPullingOrderDetailInfo(orderCode, ref detailInfo);
                ///pullOrdersInfo-> MaterialPullingOrderDetailInfo
                MaterialPullingCommonBLL.GetPullOrderMaterialPullingOrderDetailInfo(pullOrdersInfo, ref detailInfo);
                ///Add
                materialPullingOrderInfo.MaterialPullingOrderDetailInfos.Add(detailInfo);
                if (isJis)
                {
                    ///排序拉动明细
                    stringBuilder.AppendFormat(CreateJisPullOrderDetailSql(JisPullGuid, materialPullingOrderInfo.MaterialPullingOrderDetailInfos));
                }
                else
                {
                    ///物料成套拉动明细
                    stringBuilder.AppendFormat(CreateCompletePullOrderDetailSql(JisPullGuid, materialPullingOrderInfo.MaterialPullingOrderDetailInfos));
                }
                if (stringBuilder.Length == 0)
                {
                    continue;
                }
            }
            if (isJis)
            {
                ///开始车号
                materialPullingOrderInfo.StartVehicheNo = materialPullingOrderInfo.MaterialPullingOrderDetailInfos.Min(d => d.DayVehicheSeqNo.GetValueOrDefault());
                ///结束车号
                materialPullingOrderInfo.EndVehicheNo = materialPullingOrderInfo.MaterialPullingOrderDetailInfos.Max(d => d.DayVehicheSeqNo.GetValueOrDefault());
                ///排序拉动主表
                stringBuilder.AppendFormat(CreateJisPullOrderSql(JisPullGuid, materialPullingOrderInfo));
            }
            else
            {
                ///车辆编号
                materialPullingOrderInfo.VehicheModelNo = materialPullingOrderInfo.MaterialPullingOrderDetailInfos.Select(d => d.VehicheModelNo).FirstOrDefault();
                ///生产订单号
                materialPullingOrderInfo.OrderNo = materialPullingOrderInfo.MaterialPullingOrderDetailInfos.Select(d => d.OrderNo).FirstOrDefault();
                ///物料成套拉动主表
                stringBuilder.AppendFormat(CreateCompletePullOrderSql(JisPullGuid, materialPullingOrderInfo));
            }
            ///仓储衔接
            stringBuilder.AppendFormat(MaterialPullingCommonBLL.Handler(materialPullingOrderInfo, loginUser));
            return(stringBuilder.ToString());
        }
Beispiel #7
0
 /// <summary>
 /// InsertInfo
 /// </summary>
 /// <param name="info">对象</param>
 /// <returns></returns>
 public long InsertInfo(JisCounterInfo info)
 {
     return(dal.Add(info));
 }