コード例 #1
0
        private static void service_Completed(object sender, getDeptInfoCompletedEventArgs e)
        {
            string      Xmlstr = e.Result;
            XmlDocument xx     = new XmlDocument();

            xx.LoadXml(Xmlstr);                                     //加载xml
            XmlNodeList xxList = xx.GetElementsByTagName(rootname); //取得节点名为DEPTINFO的XmlNode集合

            MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
            // List<string> commandlist = new List<string>();
            foreach (XmlNode xxNode in xxList)
            {
                XmlNodeList childList = xxNode.ChildNodes; //取得DEPTINFO下的子节点集合
                int         count     = childList.Count + 1;
                if (count == seg.Length)
                {
                    string[] segvalue = new string[count];
                    for (int i = 0; i < count - 1; i++)
                    {
                        segvalue[i] = childList[i].InnerText;
                    }
                    segvalue[2] = "";
                    if (segvalue[1] == "江苏鑫源烟草薄片有限公司")
                    {
                        segvalue[count - 1] = "00700000";
                    }
                    else
                    {
                        segvalue[3] = opt.GetSegValue("select F_code from ht_svr_org_group where f_key = '" + segvalue[3] + "'", "F_CODE");
                        segvalue[4] = opt.GetSegValue("select F_code from ht_svr_org_group where f_key = '" + segvalue[0] + "'", "F_CODE");
                        if (segvalue[4] == "NoRecord")
                        {
                            string code;
                            if (segvalue[3] == "00700000")
                            {
                                code = "007" + opt.GetSegValue("select nvl(Max(substr(F_CODE,4,3))+1,1) as code from Ht_Svr_Org_Group where F_parentid = '00700000'", "CODE").PadLeft(3, '0') + "00";
                            }
                            else
                            {
                                code = segvalue[3].Substring(0, 6) + opt.GetSegValue("select nvl( Max(substr(F_CODE,7,2))+1,1) as code from Ht_Svr_Org_Group where F_parentid = '" + segvalue[3] + "'", "CODE").PadLeft(2, '0');
                            }
                            segvalue[4] = code;
                        }
                    }
                    string temp = opt.getMergeStr(seg, segvalue, 1, tablename);
                    //     commandlist.Add(temp);
                    if (opt.UpDateOra(temp) != "Success")
                    {
                        System.Diagnostics.Debug.Write(temp);
                    }
                }
            }
            //    opt.TransactionCommand(commandlist);
        }
コード例 #2
0
        /// <summary>
        /// 处理审批业务时进行的操作
        /// </summary>
        /// <param name="ID">审批流程ID号</param>
        /// <param name="keys">
        /// keys[0]:COMMENTS  意见内容
        /// keys[1]:STATUS  状态
        /// USERID  用户id,USERNAME  用户名 根据上下文自动填充
        /// </param>
        /// <returns></returns>
        public static bool authorize(string ID, string[] keys)
        {
            MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
            MSYS.Data.SysUser   user        = (MSYS.Data.SysUser)HttpContext.Current.Session["user"];
            List <String>       commandlist = new List <String>();

            //1.改变当前审批业务状态
            string[] seg   = { "USERID", "USERNAME", "OPINIONTIME", "COMMENTS", "STATUS" };
            string[] value = { user.id, user.text, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), keys[0], keys[1] };
            commandlist.Add(opt.UpdateStr(seg, value, "HT_PUB_APRV_OPINION", " where id = '" + ID + "'"));

            //2.将当前审批业务的下一环节业务置为Enable,提交给相对应的角色
            string nextID = opt.GetSegValue("select id from ht_pub_aprv_opinion where (gongwen_id,pos) in ( select gongwen_id,to_char(to_number(pos)+1) from ht_pub_aprv_opinion where id= '" + ID + "')", "ID");

            if (nextID != "NoRecord")
            {
                commandlist.Add("update HT_PUB_APRV_OPINION set ISENABLE = '1' where id = '" + nextID + "'");
            }

            //3.从审批主表中匹配审批业务详情,将审批结果在被审批业务中进行反馈
            DataSet data     = opt.CreateDataSetOra("select s.id,t.aprv_table,t.aprv_tabseg,t.BUZ_ID,s.BUSIN_ID from ht_pub_aprv_opinion r left join ht_pub_aprv_flowinfo  s on s.id = r.gongwen_id left join ht_pub_aprv_type t on t.pz_type = s.modulename  where r.id = '" + ID + "'");
            string  flowid   = data.Tables[0].Rows[0][0].ToString();
            string  table    = data.Tables[0].Rows[0][1].ToString();
            string  tableseg = data.Tables[0].Rows[0][2].ToString();
            string  busid    = data.Tables[0].Rows[0][3].ToString();
            string  busvalue = data.Tables[0].Rows[0][4].ToString();

            //如果明细审批单步被拒绝,则整个审批单状态被置为己驳回,被审批业务不通过
            if (keys[1] == "1")
            {
                commandlist.Add("Update HT_PUB_APRV_FLOWINFO set STATE = '1' where id = '" + flowid + "'");
                //将业务主表的审批字段置为己驳回
                commandlist.Add("update " + table + " set " + tableseg + " = '1' where " + busid + " = '" + busvalue + "'");
            }
            //如果明细审批单所有流程均通过,则整个审批单状态被置为己通过
            if ("Success" == opt.TransactionCommand(commandlist))
            {
                data = opt.CreateDataSetOra("select status,GONGWEN_ID from ht_pub_aprv_opinion where pos = (select Max(pos) from ht_pub_aprv_opinion where gongwen_ID = (select gongwen_ID from ht_pub_aprv_opinion where id = '" + ID + "')) and id = '" + ID + "'");
                if (data != null && data.Tables[0].Rows.Count > 0 && data.Tables[0].Rows[0][0].ToString() == "2")
                {
                    commandlist.Clear();
                    commandlist.Add("Update HT_PUB_APRV_FLOWINFO set STATE = '2' where id = '" + flowid + "'");
                    //将业务主表的审批字段置为己通过
                    commandlist.Add("update " + table + " set " + tableseg + " = '2' where " + busid + " = '" + busvalue + "'");
                    opt.TransactionCommand(commandlist);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #3
0
        protected static void getMaterFormalu_SQL(string id, string prodCode)
        {
            MSYS.Web.MateriaService.WsBaseDataInterfaceService service = new MSYS.Web.MateriaService.WsBaseDataInterfaceService();
            MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
            //   List<string> commandlist = new List<string>();
            materFormulaVO info = service.getMatFormulaById(id);
            string         temp;

            if (info != null)
            {
                string[] seg   = { "ID", "FORMULA_CODE", "FORMULA_NAME", "ADJUST", "B_DATE", "CABO_SUM", "CONTROL_STATUS", "CREATE_DATE", "CREATE_DEPT_ID", "CREATE_ID", "E_DATE", "EXECUTEBATCH", "FLOW_STATUS", "IS_DEL", "IS_VALID", "MODIFY_ID", "MODIFY_TIME", "PIECE_NUM", "PIECES_SUM", "PROD_CODE", "REMARK", "SMALLS_NUM", "STANDARD_VOL", "STEM_NUM", "STICKS_NUM" };
                string[] value = { id,            "703" + info.formulaCode, info.formulaName,         info.adjust,               info.BDate.ToString("yyyy-MM-dd HH:mm:ss"), info.caboSum.ToString(), info.controlStatus,        info.createDate,  info.createDept,         info.createId, info.EDate.ToString("yyyy-MM-dd HH:mm:ss"), info.executeBatch.ToString(), info.flowStatus, info.isDel, info.isValid,
                                   info.modifyId, info.modifyTime,          info.pieceNum.ToString(), info.piecesSum.ToString(), prodCode,                                   info.remark,             info.smallsNum.ToString(), info.standardVol, info.stemNum.ToString(), info.sticksNum.ToString() };
                temp = opt.getMergeStr(seg, value, 2, "HT_QA_MATER_FORMULA");
                //     commandlist.Add(temp);
                if (opt.UpDateOra(temp) != "Success")
                {
                    System.Diagnostics.Debug.Write(temp);
                }


                if (info.ygSubList != null && info.ygSubList.Length > 0)
                {
                    string[] subseg = { "ID", "MATER_CODE", "BATCH_SIZE", "FRONT_GROUP", "IS_DEL", "MATER_FLAG", "FORMULA_CODE", "MATER_SORT", "REMARK" };
                    foreach (tQaMaterFormulaDetail detail in info.ygSubList)
                    {
                        string[] subvalue = { detail.id.ToString(), detail.materCode, detail.batchSize.ToString(), detail.frontGroup, detail.isDel, detail.materFlag, id, detail.materSort.ToString(), detail.remark };
                        temp = opt.getMergeStr(subseg, subvalue, 2, "HT_QA_MATER_FORMULA_DETAIL");
                        //       commandlist.Add(temp);
                        if (opt.UpDateOra(temp) != "Success")
                        {
                            System.Diagnostics.Debug.Write(temp);
                        }
                    }
                }
                if (info.spSubList != null && info.spSubList.Length > 0)
                {
                    string[] subseg = { "ID", "MATER_CODE", "BATCH_SIZE", "FRONT_GROUP", "IS_DEL", "MATER_FLAG", "FORMULA_CODE", "MATER_SORT", "REMARK" };
                    foreach (tQaMaterFormulaDetail detail in info.spSubList)
                    {
                        string[] subvalue = { detail.id.ToString(), detail.materCode, detail.batchSize.ToString(), detail.frontGroup, detail.isDel, detail.materFlag, id, detail.materSort.ToString(), detail.remark };
                        temp = opt.getMergeStr(subseg, subvalue, 2, "HT_QA_MATER_FORMULA_DETAIL");
                        //         commandlist.Add(temp);
                        if (opt.UpDateOra(temp) != "Success")
                        {
                            System.Diagnostics.Debug.Write(temp);
                        }
                    }
                }
            }
        }
コード例 #4
0
        private static void service_Completed(object sender, getUserInfoCompletedEventArgs e)
        {
            string Xmlstr = e.Result;

            XmlDocument xx = new XmlDocument();

            xx.LoadXml(Xmlstr);                                     //加载xml
            XmlNodeList xxList = xx.GetElementsByTagName(rootname); //取得节点名为DEPTINFO的XmlNode集合


            MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
            //  List<string> commandlist = new List<string>();
            string temp;

            foreach (XmlNode xxNode in xxList)
            {
                XmlNodeList childList = xxNode.ChildNodes; //取得DEPTINFO下的子节点集合
                int         count     = childList.Count + 1;
                if (count == seg.Length)
                {
                    string[] segvalue = new string[count];
                    segvalue[0] = childList[2].InnerText;
                    segvalue[1] = childList[0].InnerText;
                    segvalue[2] = childList[1].InnerText;
                    segvalue[3] = childList[3].InnerText;
                    string dpno = opt.GetSegValue("select F_CODE  from Ht_Svr_Org_Group where F_KEY = '" + segvalue[3] + "'", "F_CODE");
                    if (dpno != "NoRecord")
                    {
                        segvalue[3] = dpno;
                    }
                    string psd = opt.GetSegValue("select Password from HT_SVR_USER where ID = '" + segvalue[0] + "'", "PassWord");
                    if (psd == "NoRecord" || psd == "")
                    {
                        segvalue[4] = "e10adc3949ba59abbe56e057f20f883e";
                    }
                    else
                    {
                        segvalue[4] = psd;
                    }
                    temp = opt.getMergeStr(seg, segvalue, 1, tablename);
                    //  commandlist.Add(temp);
                    if (opt.UpDateOra(temp) != "Success")
                    {
                        System.Diagnostics.Debug.Write(temp);
                    }
                }
            }

            //  return opt.TransactionCommand(commandlist);
        }
コード例 #5
0
        public void Qua_show_Click(object sender, EventArgs e)
        {
            string endtime   = Convert.ToDateTime(QuaTime.Text).AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00";
            string starttime = Convert.ToDateTime(QuaTime.Text).ToString("yyyy-MM-dd") + " 00:00:00";
            string query     = "select * from HT_QLT_DATA_RECORD where B_TIME >= '" + starttime + "' and  E_TIME <= '" + endtime + "'";

            MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
            DataSet             data = opt.CreateDataSetOra(query);

            if (data != null)
            {
                dataGridView1.DataSource = data.Tables[0];
            }
        }
コード例 #6
0
        private static void wareHouseUpdate_Completed(object sender, getMaterialWarehouseListCompletedEventArgs e)
        {
            hashMap[]           lists = e.Result;
            MSYS.DAL.DbOperator opt   = new MSYS.DAL.DbOperator();

            // string[] seg = { "ID", "MATTREE_CODE", "MATTREE_NAME", "IS_DEL", "PK_CLASS", "PK_PARENT_CLASS" };

            foreach (hashMap list in lists)
            {
                string[] value = {};
                //   string temp = opt.getMergeStr(seg, value, 1, "HT_PUB_MATTREE");
                //  commandlist.Add(temp);
                //if (opt.UpDateOra(temp) != "Success")
                //    System.Diagnostics.Debug.Write(temp);
            }
        }
コード例 #7
0
        public static void ProdRecord(DateTime datetime)
        {
            MSYS.DAL.DbOperator opt   = new MSYS.DAL.DbOperator();
            DataSet             times = opt.CreateDataSetOra("select date_begin  as time ,team_code from ht_prod_schedule where substr(date_begin,1,10) = '" + datetime.ToString("yyyy-MM-dd") + "' union select date_end as time,team_code  from ht_prod_schedule where substr(date_end,1,10) ='" + datetime.ToString("yyyy-MM-dd") + "' union select starttime  as time ,''  from ht_prod_report where substr(starttime,1,10) = '" + datetime.ToString("yyyy-MM-dd") + "' union select endtime  as time,''  from ht_prod_report where substr(endtime,1,10) = '" + datetime.ToString("yyyy-MM-dd") + "'");

            if (times != null && times.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow time in times.Tables[0].Rows)
                {
                    if (datetime - Convert.ToDateTime(time["time"].ToString()) >= new TimeSpan(0, -2, -20) && datetime - Convert.ToDateTime(time["time"].ToString()) <= new TimeSpan(0, 2, 20))
                    {
                        ProdRecord(time["time"].ToString(), time["team_code"].ToString());
                    }
                }
            }
        }
コード例 #8
0
        public override string InsertLocalFromMaster()
        {
            MSYS.Web.MateriaService.WsBaseDataInterfaceService service = new MSYS.Web.MateriaService.WsBaseDataInterfaceService();
            MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
            List <string>       commandlist = new List <string>();

            productEntity[] prods = service.getAllProductList(new productEntity());

            string[] matseg   = { "PROD_CODE", "PROD_NAME", "PACK_NAME", "HAND_MODE", "TECH_STDD_CODE", "MATER_FORMULA_CODE", "AUX_FORMULA_CODE", "COAT_FORMULA_CODE", "REMARK", "CREATEOR_ID", "CREATE_TIME", "MODIFY_ID", "MODIFY_TIME", "STANDARD_VALUE", "XY_PROD_CODE", "IS_VALID", "IS_DEL" };
            int      SucCount = 0;

            foreach (productEntity prod in prods)
            {
                if (prod.prodCode.Substring(0, 3) == "703")
                {
                    commandlist.Clear();

                    string[] value = { prod.prodCode, prod.prodName, prod.packName, prod.handMode, prod.techStddId, prod.materFormulaId, prod.auxFormulaId, prod.coatFormulaId, prod.remark, prod.createorId, prod.createTime.ToString("yyyy-MM-dd HH:mm:ss"), prod.modifyId, prod.modifyTime.ToString("yyyy-MM-dd HH:mm:ss"), prod.standardValue, prod.prodCode, prod.isValid, prod.isDel };

                    string temp = opt.getMergeStr(matseg, value, 1, "HT_PUB_PROD_DESIGN");
                    commandlist.Add(temp);
                    if (opt.UpDateOra(temp) != "Success")
                    {
                        System.Diagnostics.Debug.Write(temp);
                    }
                    // getTechstdd_SQL(prod.techStddId, prod.prodCode); // java.math.BigInteger cannot be cast to java.lang.String
                    getMaterFormalu_SQL(prod.materFormulaId, prod.prodCode);
                    // getAuxFormalu_SQL(prod.auxFormulaId, prod.prodCode); //java.math.BigDecimal cannot be cast to java.lang.Double
                    getCoatFormalu_SQL(prod.coatFormulaId, prod.prodCode);
                    if (opt.TransactionCommand(commandlist) == "Success")
                    {
                        commandlist.Clear();
                        commandlist.Add("update ht_pub_prod_design t set tech_stdd_code = (select r.tech_code from ht_tech_stdd_code r where substr(t.tech_stdd_code,0,3)<>'TCH' and  r.id = to_number( t.tech_stdd_code)),mater_formula_code = (select s.formula_code from ht_qa_mater_formula s where  t.mater_formula_code is not null and  s.id = to_number( t.mater_formula_code)),aux_formula_code = (select  q.formula_code from ht_qa_aux_formula q where  t.aux_formula_code is not null and  q.id = to_number( t.aux_formula_code)),coat_formula_code = (select p.formula_code from ht_qa_coat_formula p where  t.coat_formula_code is not null and  p.id = to_number( t.coat_formula_code)) where t.prod_code = '" + prod.prodCode + "'");
                        commandlist.Add("update ht_qa_mater_formula_detail r set formula_code = (select t.formula_code from ht_qa_mater_formula t where t.id = r.formula_code) where r.formula_code = '" + prod.materFormulaId + "'");
                        commandlist.Add("update ht_qa_aux_formula_detail r set formula_code = (select t.formula_code from ht_qa_aux_formula t where t.id = r.formula_code) where r.formula_code = '" + prod.auxFormulaId + "'");
                        commandlist.Add("update ht_qa_coat_formula_detail r set formula_code = (select t.formula_code from ht_qa_coat_formula t where t.id = r.formula_code) where r.formula_code = '" + prod.coatFormulaId + "'");
                        commandlist.Add("update ht_qa_Fla_formula_detail r set formula_code = (select t.formula_code from ht_qa_Fla_formula t where t.id = r.formula_code) where r.formula_code = '" + prod.coatFormulaId + "'");
                        commandlist.Add("update ht_tech_stdd_code_detail r set tech_code = (select t.tech_code from ht_tech_stdd_code t where t.id = r.tech_code) where r.tech_code = '" + prod.techStddId + "'");
                        commandlist.Add("update ht_qa_mater_formula_detail t set t.mater_flag = (select r.mat_type from ht_pub_materiel r  where r.material_code = t.mater_code)");
                        opt.TransactionCommand(commandlist);
                        System.Diagnostics.Debug.Write("产品更新成功" + prod.prodCode + prod.prodName);
                        SucCount++;
                    }
                }
            }
            return(SucCount.ToString() + "项产品更新成功,总记录条数:" + prods.Length);
        }
コード例 #9
0
        protected void InsertProdReportAsTime(string datetime)
        {
            MSYS.DAL.DbOperator opt   = new MSYS.DAL.DbOperator();
            DataSet             times = opt.CreateDataSetOra("select date_begin  as time ,team_code from ht_prod_schedule where substr(date_begin,1,10) = '" + datetime + "' union select date_end as time,team_code  from ht_prod_schedule where substr(date_end,1,10) ='" + datetime + "' union select starttime  as time ,''  from ht_prod_report where substr(starttime,1,10) = '" + datetime + "' union select endtime  as time,''  from ht_prod_report where substr(endtime,1,10) = '" + datetime + "'");

            if (times != null && times.Tables[0].Rows.Count > 0)
            {
                try
                {
                    foreach (DataRow time in times.Tables[0].Rows)
                    {
                        ProdRecoder.ProdRecord(time["time"].ToString(), time["team_code"].ToString());
                    }
                }
                catch
                {
                }
            }
        }
コード例 #10
0
        protected static List <PointProperty> getParaList()
        {
            List <PointProperty> readlist = new List <PointProperty>();

            MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
            DataSet             data = opt.CreateDataSetOra("select r.para_code,r.VALUE_TAG from ht_pub_tech_para r  where r.para_type like '1___0%' and r.is_del = '0' order by r.para_code ");

            if (data != null && data.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in data.Tables[0].Rows)
                {
                    PointProperty p = new PointProperty();
                    p.para_code = row["para_code"].ToString();
                    p.tag       = row["VALUE_TAG"].ToString();
                    readlist.Add(p);
                }
            }
            return(readlist);
        }
コード例 #11
0
        private static void service_Completed(object sender, materialTreeCompletedEventArgs e)
        {
            treeVO[]            mattree = e.Result;
            MSYS.DAL.DbOperator opt     = new MSYS.DAL.DbOperator();
            //   List<string> commandlist = new List<string>();
            string[] seg = { "ID", "MATTREE_CODE", "MATTREE_NAME", "IS_DEL", "PK_CLASS", "PK_PARENT_CLASS" };

            foreach (treeVO leaf in mattree)
            {
                string[] value = { leaf.id, leaf.classCode, leaf.name, "0", leaf.classCode, leaf.pId };
                string   temp  = opt.getMergeStr(seg, value, 1, "HT_PUB_MATTREE");
                //  commandlist.Add(temp);
                if (opt.UpDateOra(temp) != "Success")
                {
                    System.Diagnostics.Debug.Write(temp);
                }
            }
            opt.UpDateOra("update ht_pub_mattree t set t.parent_code = (select mattree_code from ht_pub_mattree r where r.id = t.pk_parent_class)");
            // return opt.TransactionCommand(commandlist);
        }
コード例 #12
0
        private static void service_Completed(object sender, getUnitListCompletedEventArgs e)
        {
            MSYS.DAL.DbOperator opt   = new MSYS.DAL.DbOperator();
            tPubUnit[]          units = e.Result;
            //List<string> commandlist = new List<string>();
            string[] seg = { "id",            "unitCode",   "unitName", "originCode", "unitGroupCode", "unitGroupName",
                             "unitGroupType", "xyUnitCode", "isDel",    "isValid" };

            foreach (tPubUnit unit in units)
            {
                string[] value = { unit.id.ToString(), unit.unitCode, unit.unitName, unit.originCode, unit.unitGroupCode, unit.unitGroupName, unit.unitGroupType, unit.xyUnitCode, unit.isDel, unit.isValid };
                string   temp  = opt.getMergeStr(seg, value, 1, "HT_INNER_UNIT");
                //   commandlist.Add(temp);
                if (opt.UpDateOra(temp) != "Success")
                {
                    System.Diagnostics.Debug.Write(temp);
                }
            }
            //   return opt.TransactionCommand(commandlist);
        }
コード例 #13
0
 protected static void getAuxFormalu_SQL(string id, string prodCode)
 {
     MSYS.Web.MateriaService.WsBaseDataInterfaceService service = new MSYS.Web.MateriaService.WsBaseDataInterfaceService();
     MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
     //  List<string> commandlist = new List<string>();
     try
     {
         auxFormulaVO info = service.getAuxFormulaById(id);
         string       temp;
         if (info != null)
         {
             string[] seg   = { "ID", "FORMULA_CODE", "FORMULA_NAME", "B_DATE", "CONTROL_STATUS", "CREATE_DATE", "CREATE_DEPT_ID", "CREATE_ID", "E_DATE", "IS_DEL", "IS_VALID", "MODIFY_ID", "MODIFY_TIME", "PROD_CODE", "REMARK", "STANDARD_VOL" };
             string[] value = { id, "703" + info.formulaCode, info.formulaName, info.BDate.ToString("yyyy-MM-dd HH:mm:ss"), info.controlStatus, info.createDate, info.createDept, info.createId, info.EDate.ToString("yyyy-MM-dd HH:mm:ss"), info.isDel, info.isValid, info.modifyId, info.modifyTime, prodCode, info.remark, info.standardVol };
             temp = opt.getMergeStr(seg, value, 2, "HT_QA_AUX_FORMULA");
             //    commandlist.Add(temp);
             if (opt.UpDateOra(temp) != "Success")
             {
                 System.Diagnostics.Debug.Write(temp);
             }
             if (info.auxSubList != null && info.auxSubList.Length > 0)
             {
                 string[] subseg = { "ID", "MATER_CODE", "FORMULA_CODE", "AUX_PERCENT", "AUX_SCALE", "AUX_SORT", "IS_DEL", "MATER_TYPE", "mattreeName", "REMARK" };
                 foreach (tQaAuxFormulaDetail detail in info.auxSubList)
                 {
                     string[] subvalue = { detail.id.ToString(), detail.materCode, id, detail.auxPercent.ToString(), detail.auxScale.ToString(), detail.auxSort.ToString(), detail.isDel, detail.materType, detail.mattreeName, detail.remark };
                     temp = opt.getMergeStr(subseg, subvalue, 2, "HT_QA_AUX_FORMULA_DETAIL");
                     //         commandlist.Add(temp);
                     if (opt.UpDateOra(temp) != "Success")
                     {
                         System.Diagnostics.Debug.Write(temp);
                     }
                 }
             }
         }
         // return commandlist;
     }
     catch (Exception ee)
     {
     }
 }
コード例 #14
0
        public override string InsertLocalFromMaster()
        {
            MSYS.Web.MateriaService.WsBaseDataInterfaceService service = new MSYS.Web.MateriaService.WsBaseDataInterfaceService();
            MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
            treeVO[]            mattree     = service.materialTree();
            List <string>       commandlist = new List <string>();

            string[] seg = { "ID", "MATTREE_CODE", "MATTREE_NAME", "IS_DEL", "PK_CLASS", "PK_PARENT_CLASS" };

            foreach (treeVO leaf in mattree)
            {
                string[] value = { leaf.id, leaf.classCode, leaf.name, "0", leaf.classCode, leaf.pId };
                string   temp  = opt.getMergeStr(seg, value, 1, "HT_PUB_MATTREE");
                commandlist.Add(temp);
                if (opt.UpDateOra(temp) != "Success")
                {
                    System.Diagnostics.Debug.Write(temp);
                }
            }
            commandlist.Add("update ht_pub_mattree t set t.parent_code = (select mattree_code from ht_pub_mattree r where r.id = t.pk_parent_class)");
            return(opt.TransactionCommand(commandlist));
        }
コード例 #15
0
        public override string InsertLocalFromMaster()
        {
            MSYS.Web.MateriaService.WsBaseDataInterfaceService service = new MSYS.Web.MateriaService.WsBaseDataInterfaceService();
            MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
            tPubUnit[]          units       = service.getUnitList();
            List <string>       commandlist = new List <string>();

            string[] seg = { "id",            "unitCode",   "unitName", "originCode", "unitGroupCode", "unitGroupName",
                             "unitGroupType", "xyUnitCode", "isDel",    "isValid" };

            foreach (tPubUnit unit in units)
            {
                string[] value = { unit.id.ToString(), unit.unitCode, unit.unitName, unit.originCode, unit.unitGroupCode, unit.unitGroupName, unit.unitGroupType, unit.xyUnitCode, unit.isDel, unit.isValid };
                string   temp  = opt.getMergeStr(seg, value, 1, "HT_INNER_UNIT");
                commandlist.Add(temp);
                if (opt.UpDateOra(temp) != "Success")
                {
                    System.Diagnostics.Debug.Write(temp);
                }
            }
            return(opt.TransactionCommand(commandlist));
        }
コード例 #16
0
        private static void service_Completed(object sender, getAllMaterialtListCompletedEventArgs e)
        {
            MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();

            //  List<string> commandlist = new List<string>();
            tPubMateriel[] mat = e.Result;
            // commandlist.Clear();
            string[] matseg = { "ID",        "MATERIAL_CODE",  "MATERIAL_NAME",    "TYPE_CODE",   "SPEC_VAL",         "MODEL_VAL",   "IS_VALID",       "IS_DEL",
                                "TYPE_FLAG", "UNIT_CODE",      "DATA_ORIGIN_FLAG", "PK_MATERIAL", "FACTORY",          "MAT_YEAR",    "MAT_CATEGORY",   "MAT_TYPE",
                                "MAT_LEVEL", "MAT_VARIETY",    "MAT_PACK",         "MAT_PLACE",   "REMARK",           "MAT_TYPE2",   "MAT_PLACE_NAME", "MAT_PROVINCE",
                                "MAT_CITY",  "PK_MARBASCLASS", "LAST_UPDATE_TIME", "COSTPRICE",   "XY_MATERIAL_CODE", "PK_MATTAXES", "PIECE_WEIGHT" };

            foreach (tPubMateriel materia in mat)
            {
                string[] value = { materia.id.ToString(), materia.materialCode, materia.materialName, materia.typeCode, materia.specVal, materia.modelVal, materia.isValid, materia.isDel, materia.typeFlag, materia.unitCode, materia.dataOriginFlag, materia.pkMaterial, materia.factory, materia.matYear, materia.matCategory, materia.matType, materia.matLevel, materia.matVariety, materia.matPack, materia.matPlace, materia.remark, materia.matType2, materia.matPlaceName, materia.matProvince, materia.matCity, materia.pkMarbasclass, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), materia.costprice.ToString(), materia.xyMaterialCode, materia.pkMattaxes, materia.pieceWeight };
                string   temp  = opt.getMergeStr(matseg, value, 2, "HT_PUB_MATERIEL");
                //  commandlist.Add(temp);
                if (opt.UpDateOra(temp) != "Success")
                {
                    System.Diagnostics.Debug.Write(temp);
                }
            }
            //  return opt.TransactionCommand(commandlist);
        }
コード例 #17
0
        public string InOrOut(string PZ_code, string name, string nameno)//出入库单据号及当前操作人员
        {
            MSYS.Web.StoreService.StoreServiceInterfaceService service = new MSYS.Web.StoreService.StoreServiceInterfaceService();
            MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
            string  query           = "select t.*,r.name as creator,s.name as modifier,q.formula_code  from ht_strg_materia t left join ht_svr_user r on r.id = t.creator_id left join ht_svr_user s on s.id = t.modify_id left join ht_qa_mater_formula q on q.prod_code = substr(t.monthplanno,9,7) where t.ORDER_SN = '" + PZ_code + "'";
            DataSet data            = opt.CreateDataSetOra(query);

            if (data != null && data.Tables[0].Rows.Count > 0)
            {
                DataRow         row = data.Tables[0].Rows[0];
                materInAndOutVO r   = new materInAndOutVO();
                r.loginname = nameno;
                r.loginname = row["creator_id"].ToString();
                r.name      = row["creator"].ToString();
                r.planNo    = row["MONTHPLANNO"].ToString();
                r.prodCode  = row["MONTHPLANNO"].ToString().Substring(8, 7);
                try
                {
                    string  masql = "select xy_prod_code from ht_pub_prod_design where prod_code = '" + r.prodCode + "'";
                    DataSet mads  = opt.CreateDataSetOra(masql);
                    r.prodCode = mads.Tables[0].Rows[0][0].ToString();
                }
                catch
                {
                    System.Diagnostics.Debug.WriteLine("查询xyprodcode失败");
                }
                if (row["SHIFT_CODE"].ToString() != null && row["SHIFT_CODE"].ToString() != "")
                {
                    r.shiftCode = this.shift_dic[row["SHIFT_CODE"].ToString()];
                }
                if (row["TEAM_CODE"].ToString() != null && row["TEAM_CODE"].ToString() != "")
                {
                    r.teamCode = this.team_dic[row["TEAM_CODE"].ToString()];
                }
                // if(row["FDATE"].ToString() != null && row["FDATE"].ToString() != "")
                //   r.FDate =Convert.ToDateTime( row["FDATE"].ToString());
                r.createId = row["CREATOR_ID"].ToString();
                //string sqlid = "select loginname from ht_svr_user where id = '" + r.createId + "'";
                //r.createId = opt.CreateDataSetOra(sqlid).Tables[0].Rows[0][0].ToString();
                // r.loginname = r.createId;
                r.creator    = row["creator"].ToString();
                r.modifyId   = row["Modify_ID"].ToString();
                r.modifyMan  = row["modifier"].ToString();
                r.bomType    = "1";
                r.modifyTime = row["MODIFY_TIME"].ToString();
                if (row["STRG_TYPE"].ToString() == "0")
                {
                    r.vouNo = "YLLY" + row["ORDER_SN"].ToString().Substring(2);
                }
                if (row["STRG_TYPE"].ToString() == "1")
                {
                    r.vouNo = "YLLT" + row["ORDER_SN"].ToString().Substring(2);
                }


                if (row["BATCHNUM"].ToString() != null && row["BATCHNUM"].ToString() != "")
                {
                    r.batchNumber = Convert.ToDouble(row["BATCHNUM"].ToString());
                }
                if (row["CABOSUM"].ToString() != null && row["CABOSUM"].ToString() != "")
                {
                    r.caboSum = Convert.ToDouble(row["CABOSUM"].ToString());
                }

                //if (row["PEICESSUM"].ToString() != null && row["PEICESSUM"].ToString() != "")
                //r.piecesSum = Convert.ToDouble(row["PEICESSUM"].ToString());
                r.remark = row["REMARK"].ToString();
                if (row["PEICESSUM"].ToString() != null && row["PEICESSUM"].ToString() != "")
                {
                    r.piecesSum = Convert.ToDouble(row["PEICESSUM"].ToString());
                }
                if (row["STRG_TYPE"].ToString() != null && row["STRG_TYPE"].ToString() != "")
                {
                    r.inoutType = this.MIOT[row["STRG_TYPE"].ToString()];
                }
                r.cwarehouseid = row["WARE_HOUSE_ID"].ToString();
                if (row["FORMULA_CODE"].ToString() != null && row["FORMULA_CODE"].ToString() != "")
                {
                    r.formulaId = Convert.ToInt64(row["formula_code"].ToString());
                }
                List <tShopMaterInoutSubVO> s = new List <tShopMaterInoutSubVO>();
                //DataSet details = opt.CreateDataSetOra("select t.*,r.material_name from ht_strg_mater_sub t left join ht_pub_materiel r on r.material_code = t.mater_code  where t.main_code = '" + PZ_code + "' and t.is_del = '0'");
                DataSet details = opt.CreateDataSetOra("select t.*,r.material_name from ht_strg_mater_sub t left join ht_pub_materiel r on r.material_code = t.mater_code  where t.main_code = '" + PZ_code + "' and t.is_del = '0'");
                if (details != null && details.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow drow in details.Tables[0].Rows)
                    {
                        tWaOnhand info = queryMater(drow["MATER_CODE"].ToString());

                        // if(drow["MATER_FLAG"].ToString() == "SP" ||  drow["MATER_FLAG"].ToString() == "碎片")
                        //   continue;
                        tShopMaterInoutSubVO sub = new tShopMaterInoutSubVO();
                        if (info != null)
                        {
                            sub.materName = info.mName.ToString();//接口
                            if (info.cwarehouseid != null)
                            {
                                sub.warehouseCode = info.cwarehouseid.ToString();//从接口获得
                                r.cwarehouseid    = sub.warehouseCode;
                                sub.warehouseName = info.warehouseName.ToString();
                            }
                            if (info.locationName != null)
                            {
                                sub.materLocation = info.locationName.ToString();
                            }
                            //if (row["STRG_TYPE"].ToString() == "0" && (Convert.ToDouble(info.sumonhand) < Convert.ToDouble(drow["ORIGINAL_DEMAND"].ToString())))
                            //{
                            //  return "notenough" + info.materName.ToString();
                            //}
                        }
                        sub.mainId    = drow["MAIN_CODE"].ToString();
                        sub.materCode = drow["MATER_CODE"].ToString();
                        //sub.materName = drow["material_name"].ToString();//接口
                        sub.materType = drow["MATER_FLAG"].ToString();//
                        sub.unitCode  = drow["UNIT_CODE"].ToString();
                        // sub.unitName = drow["TEAM_CODE"].ToString();
                        sub.occurQty = drow["ORIGINAL_DEMAND"].ToString();
                        sub.remark   = drow["REMARK"].ToString();
                        //sub.warehouseCode = drow["WAREHOUSECODE"].ToString();//从接口获得
                        sub.packingNumbers = drow["PACKNUM"].ToString();
                        sub.substance      = drow["SUBSTANCE"].ToString();
                        sub.oddQty         = drow["ODDQTY"].ToString();
                        sub.materName      = drow["MATERIAL_NAME"].ToString();
                        s.Add(sub);
                    }
                }
                r.subList = s.ToArray();
                DateTime d    = new DateTime();
                string   date = date = DateTime.Now.ToString("yyyy-MM-dd");
                return(service.yuanliaoInAndOut4ws_03(r, date, r.batchNumber).status);
                // return "";
            }
            else
            {
                return("Falied");
            }
        }
コード例 #18
0
        protected static void getCoatFormalu_SQL(string id, string prodCode)
        {
            MSYS.Web.MateriaService.WsBaseDataInterfaceService service = new MSYS.Web.MateriaService.WsBaseDataInterfaceService();
            MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
            List <string>       commandlist = new List <string>();

            try
            {
                coatFormulaVO info = service.getCoatFormulaById(id);
                string        temp;
                if (info != null)
                {
                    //插入回填液
                    string[] seg   = { "ID", "FORMULA_CODE", "FORMULA_NAME", "B_DATE", "CONTROL_STATUS", "CREATE_DATE", "CREATE_DEPT_ID", "CREATE_ID", "E_DATE", "IS_DEL", "IS_VALID", "MODIFY_ID", "MODIFY_TIME", "PROD_CODE", "REMARK", "STANDARD_VOL", "FORMULA_TPY", "FORMULA_XJ", "W_TOTAL" };
                    string[] value = { id, "703" + info.formulaCode, info.formulaName, info.BDate.ToString("yyyy-MM-dd HH:mm:ss"), info.controlStatus, info.createDate, info.createDept, info.createId, info.EDate.ToString("yyyy-MM-dd HH:mm:ss"), info.isDel, info.isValid, info.modifyId, info.modifyTime, prodCode, info.remark, info.standardVol, info.formulaTpy.ToString(), info.formulaXj.ToString(), info.WTotal.ToString() };
                    temp = opt.getMergeStr(seg, value, 2, "HT_QA_COAT_FORMULA");
                    commandlist.Add(temp);
                    if (opt.UpDateOra(temp) != "Success")
                    {
                        System.Diagnostics.Debug.Write(temp);
                    }

                    if (info.coatTBYSubList != null && info.coatTBYSubList.Length > 0)
                    {
                        string[] subseg = { "ID", "MATER_CODE", "CLASS_NAME", "COAT_FLAG", "FORMULA_CODE", "COAT_SCALE", "COAT_SORT", "IS_DEL", "IS_VALID", "NEED_SIZE", "REMARK" };
                        foreach (tQaCoatFormulaDetail detail in info.coatTBYSubList)
                        {
                            string[] subvalue = { detail.id.ToString(), detail.classCode, detail.className, detail.coatFlag, id, detail.coatScale, detail.coatSort.ToString(), detail.isDel, detail.isValid, detail.needSize.ToString(), detail.remark };
                            temp = opt.getMergeStr(subseg, subvalue, 2, "HT_QA_COAT_FORMULA_DETAIL");
                            commandlist.Add(temp);
                            if (opt.UpDateOra(temp) != "Success")
                            {
                                System.Diagnostics.Debug.Write(temp);
                            }
                        }
                    }
                    //插入香精香料
                    string[] segX   = { "ID", "FORMULA_CODE", "FORMULA_NAME", "B_DATE", "CONTROL_STATUS", "CREATE_DATE", "CREATE_DEPT_ID", "CREATE_ID", "E_DATE", "IS_DEL", "IS_VALID", "MODIFY_ID", "MODIFY_TIME", "PROD_CODE", "REMARK", "STANDARD_VOL", "FORMULA_TPY", "FORMULA_XJ", "W_TOTAL" };
                    string[] valueX = { id, "703" + info.formulaCode, info.formulaName, info.BDate.ToString("yyyy-MM-dd HH:mm:ss"), info.controlStatus, info.createDate, info.createDept, info.createId, info.EDate.ToString("yyyy-MM-dd HH:mm:ss"), info.isDel, info.isValid, info.modifyId, info.modifyTime, prodCode, info.remark, info.standardVol, info.formulaTpy.ToString(), info.formulaXj.ToString(), info.WTotal.ToString() };
                    temp = opt.getMergeStr(seg, value, 2, "HT_QA_Fla_FORMULA");
                    commandlist.Add(temp);
                    if (opt.UpDateOra(temp) != "Success")
                    {
                        System.Diagnostics.Debug.Write(temp);
                    }
                    if (info.coatXJSubList != null && info.coatXJSubList.Length > 0)
                    {
                        string[] subseg = { "ID", "MATER_CODE", "CLASS_NAME", "COAT_FLAG", "FORMULA_CODE", "COAT_SCALE", "COAT_SORT", "IS_DEL", "IS_VALID", "NEED_SIZE", "REMARK" };
                        foreach (tQaCoatFormulaDetail detail in info.coatXJSubList)
                        {
                            string[] subvalue = { detail.id.ToString(), detail.classCode, detail.className, detail.coatFlag, id, detail.coatScale, detail.coatSort.ToString(), detail.isDel, detail.isValid, detail.needSize.ToString(), detail.remark };
                            temp = opt.getMergeStr(subseg, subvalue, 2, "HT_QA_Fla_FORMULA_DETAIL");
                            commandlist.Add(temp);
                            if (opt.UpDateOra(temp) != "Success")
                            {
                                System.Diagnostics.Debug.Write(temp);
                            }
                        }
                    }
                }
            }
            catch (Exception ee)
            {
            }
        }
コード例 #19
0
        public override string InsertLocalFromMaster()
        {
            StringBuilder buffer = new StringBuilder();

            buffer.Append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
            buffer.Append("<request>");
            buffer.Append("</request>");
            MisMasterDataServiceInterfaceService service = new MisMasterDataServiceInterfaceService();

            string      Xmlstr = service.getDeptInfo(buffer.ToString());
            XmlDocument xx     = new XmlDocument();

            xx.LoadXml(Xmlstr);                                     //加载xml
            XmlNodeList xxList = xx.GetElementsByTagName(rootname); //取得节点名为DEPTINFO的XmlNode集合

            MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
            List <string>       commandlist = new List <string>();

            foreach (XmlNode xxNode in xxList)
            {
                XmlNodeList childList = xxNode.ChildNodes; //取得DEPTINFO下的子节点集合
                int         count     = childList.Count + 1;
                if (count == seg.Length)
                {
                    string[] segvalue = new string[count];
                    for (int i = 0; i < count - 1; i++)
                    {
                        segvalue[i] = childList[i].InnerText;
                    }
                    segvalue[2] = "";
                    if (segvalue[1] == "江苏鑫源烟草薄片有限公司")
                    {
                        segvalue[count - 1] = "00700000";
                    }
                    else
                    {
                        segvalue[3] = opt.GetSegValue("select F_code from ht_svr_org_group where f_key = '" + segvalue[3] + "'", "F_CODE");
                        segvalue[4] = opt.GetSegValue("select F_code from ht_svr_org_group where f_key = '" + segvalue[0] + "'", "F_CODE");
                        if (segvalue[4] == "NoRecord")
                        {
                            string code;
                            if (segvalue[3] == "00700000")
                            {
                                code = "007" + opt.GetSegValue("select nvl(Max(substr(F_CODE,4,3))+1,1) as code from Ht_Svr_Org_Group where F_parentid = '00700000'", "CODE").PadLeft(3, '0') + "00";
                            }
                            else
                            {
                                code = segvalue[3].Substring(0, 6) + opt.GetSegValue("select nvl( Max(substr(F_CODE,7,2))+1,1) as code from Ht_Svr_Org_Group where F_parentid = '" + segvalue[3] + "'", "CODE").PadLeft(2, '0');
                            }
                            segvalue[4] = code;
                        }
                    }
                    string temp = opt.getMergeStr(seg, segvalue, 1, tablename);
                    commandlist.Add(temp);
                    if (opt.UpDateOra(temp) != "Success")
                    {
                        System.Diagnostics.Debug.Write(temp);
                    }
                }
            }
            return(opt.TransactionCommand(commandlist));
        }