Exemplo n.º 1
0
        /// <summary>
        /// 生产订单信息
        /// </summary>
        /// <param name="pPlanStartDate">计划开工日期</param>
        /// <param name="pFormId">业务标识</param>
        /// <returns></returns>
        public DataTable GetMo(string pPlanStartDate, Model.Enum.FormID pFormId)
        {
            string strOrg;

            switch (pFormId)
            {
            case Model.Enum.FormID.PRD_PPBOM:
                strOrg = "100508";
                break;

            case Model.Enum.FormID.PRD_PPBOM_DX:
                strOrg = "492501088";
                break;

            default:
                strOrg = "100508";
                break;
            }

            _SQL  = string.Format("SELECT DISTINCT MTL.FNUMBER 物料编码, MTLL.FNAME 物料名称, DEP.FNUMBER 部门编码, DEPL.FNAME 部门 ");
            _SQL += string.Format(" FROM T_PRD_MO A ");
            _SQL += string.Format(" INNER JOIN T_PRD_MOENTRY AE ON A.FID = AE.FID ");
            _SQL += string.Format(" INNER JOIN T_PRD_MOENTRY_A AA ON AE.FENTRYID = AA.FENTRYID AND AA.FSTATUS IN({0}) ", strOrg == "100508" ? "3,4" : "4");
            _SQL += string.Format(" INNER JOIN T_BD_DEPARTMENT DEP ON AE.FWORKSHOPID = DEP.FDEPTID ");
            _SQL += string.Format(" INNER JOIN T_BD_DEPARTMENT_L DEPL ON DEP.FDEPTID = DEPL.FDEPTID AND DEPL.FLOCALEID = 2052 ");
            _SQL += string.Format(" INNER JOIN T_PRD_PPBOMENTRY PBE ON AA.FENTRYID = PBE.FMOENTRYID ");
            _SQL += string.Format(" INNER JOIN T_BD_MATERIAL MTL ON PBE.FMATERIALID = MTL.FMATERIALID AND MTL.FUSEORGID = {0} ", strOrg);
            _SQL += string.Format(" INNER JOIN T_BD_MATERIAL_L MTLL ON MTL.FMATERIALID = MTLL.FMATERIALID AND MTLL.FLOCALEID = 2052 ");
            _SQL += string.Format(" LEFT JOIN T_AUTO_MSTOCKSETTING MST ON MTL.FMATERIALID = MST.FMATERIALID AND DEP.FDEPTID = MST.FDEPTID ");
            _SQL += string.Format(" WHERE (MST.FMATERIALID IS NULL OR MST.FSTOCKID IS NULL) AND A.FDOCUMENTSTATUS = 'C' AND A.FPRDORGID = {0} AND TO_CHAR(AE.FPLANSTARTDATE,'yyyy-mm-dd') = '{1}'", strOrg, pPlanStartDate);

            return(ORAHelper.ExecuteTable(_SQL));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据日期获取入库单编号
        /// </summary>
        /// <param name="pDateTime">日期</param>
        /// <returns>DataTable</returns>
        public DataTable GetInstockBillNo(DateTime pDateTime)
        {
            _SQL  = string.Format("SELECT DISTINCT A.FBILLNO ");
            _SQL += string.Format(" FROM T_PRD_INSTOCK A ");
            _SQL += string.Format(" LEFT JOIN T_PRD_PICKMTRLDATA_A PICA ON A.FID = PICA.FSRCBIZINTERID ");
            _SQL += string.Format(" WHERE TO_CHAR(A.FDATE, 'yyyy-MM-dd') >= '{0}' AND  A.FDOCUMENTSTATUS = 'C' AND PICA.FSRCBIZBILLNO IS NULL", pDateTime.ToString("yyyy-MM-dd"));

            return(ORAHelper.ExecuteTable(_SQL));
        }