| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Text;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using CoreFS.CA06;
- using System.Net;
- using Core.StlMes.Client.SaleOrder.Control;
- using CoreFS.SA06;
- using Core.Mes.Client.Comm.Control;
- namespace Core.StlMes.Client.SaleOrder.BLL
- {
- public class CraftOrdDesignBLL
- {
- private OpeBase _ob;
- public CraftOrdDesignBLL(OpeBase ob)
- {
- _ob = ob;
- }
- /// <summary>
- /// 查询工艺评审主表
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- /// <returns></returns>
- public List<CraftOrdDesignEntity> Query(CraftOrdDesignEntity craftOrdDesignEntity, string[] DataPurviewIds, string userId)
- {
- List<CraftOrdDesignEntity> listCraftOrdDesignEntity = EntityHelper.GetData<CraftOrdDesignEntity>(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.query", new object[] {
- JSONFormat.Format(craftOrdDesignEntity), DataPurviewIds, userId}, _ob);
- return listCraftOrdDesignEntity;
- }
- /// <summary>
- /// 查询工艺评审主表(审核审批专用)
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- /// <returns></returns>
- public List<CraftOrdDesignAuditEntity> QueryAudit(CraftOrdDesignEntity craftOrdDesignEntity, string[] DataPurviewIds, string userId)
- {
- List<CraftOrdDesignAuditEntity> listCraftOrdDesignEntity = EntityHelper.GetData<CraftOrdDesignAuditEntity>(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.queryAudit", new object[] {
- JSONFormat.Format(craftOrdDesignEntity), DataPurviewIds, userId}, _ob);
- return listCraftOrdDesignEntity;
- }
- public List<CraftOrdDesignEntityChoiceCraftLv2> QueryCraftLv2(string craftNo, string orderNo,
- string planStatus, string maintenanceStatus, string customInfo)
- {
- List<CraftOrdDesignEntityChoiceCraftLv2> listCraftOrdDesignEntity = EntityHelper.GetData<CraftOrdDesignEntityChoiceCraftLv2>(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.queryCraftLv2",
- new object[] { craftNo, orderNo, planStatus, maintenanceStatus, customInfo }, _ob);
- return listCraftOrdDesignEntity;
- }
- public List<ChoiceCraftFileLv2Entity> QueryCraftLv2New(string craftNo, string orderNo,
- string planStatus, string maintenanceStatus, string customInfo, string exeStatus,List<String> AllPline )
- {
- List<ChoiceCraftFileLv2Entity> listCraftOrdDesignEntity = EntityHelper.GetData<ChoiceCraftFileLv2Entity>(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.queryCraftLv2New",
- new object[] { craftNo, orderNo, planStatus, maintenanceStatus, customInfo, exeStatus, AllPline }, _ob);
- return listCraftOrdDesignEntity;
- }
- public List<ChoiceCraftFileLv2Entity> QueryCraftLv2New(string craftNo, string orderNo,
- string planStatus, string maintenanceStatus, string customInfo, string[] exeStatus, List<String> AllPline)
- {
- List<ChoiceCraftFileLv2Entity> listCraftOrdDesignEntity = EntityHelper.GetData<ChoiceCraftFileLv2Entity>(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.queryCraftLv2New",
- new object[] { craftNo, orderNo, planStatus, maintenanceStatus, customInfo, exeStatus, AllPline }, _ob);
- return listCraftOrdDesignEntity;
- }
- /// <summary>
- /// 获取工艺评审工序点类型
- /// </summary>
- /// <param name="designKey"></param>
- /// <param name="processCode"></param>
- /// <returns></returns>
- public DataTable GetCraftStationType(string designKey, string processCode)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getCraftStationType",
- new object[] { designKey, processCode }, _ob);
- return dt;
- }
- public DataTable QueryUnfinishTimeZg()
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.queryUnfinishTimeZg",
- new object[]{ }, _ob);
- return dt;
- }
- /// <summary>
- /// 通过主键查询工艺评审主表
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- /// <returns></returns>
- public CraftOrdDesignEntity QueryByPk(CraftOrdDesignEntity craftOrdDesignEntity)
- {
- List<CraftOrdDesignEntity> listCraftOrdDesignEntity = EntityHelper.GetData<CraftOrdDesignEntity>(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.queryByPk", new object[] { JSONFormat.Format(craftOrdDesignEntity) }, _ob);
- if (listCraftOrdDesignEntity.Count > 0)
- {
- return listCraftOrdDesignEntity[0];
- }
- else
- {
- return null;
- }
- }
- /// <summary>
- /// 科室审核
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- public void Audit(List<CraftOrdDesignEntity> craftOrdDesignList)
- {
- ArrayList list = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesgin in craftOrdDesignList)
- {
- list.Add(JSONFormat.Format(craftOrdDesgin));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.audit",
- new object[] { list }, _ob);
- }
- /// <summary>
- /// 相关科室审核
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- public void Audit1(List<CraftOrdDesignEntity> craftOrdDesignList)
- {
- ArrayList list = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesgin in craftOrdDesignList)
- {
- list.Add(JSONFormat.Format(craftOrdDesgin));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.audit1",
- new object[] { list }, _ob);
- }
- /// <summary>
- /// 审批
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- public void Approval(List<CraftOrdDesignEntity> craftOrdDesignList)
- {
- ArrayList list = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesgin in craftOrdDesignList)
- {
- list.Add(JSONFormat.Format(craftOrdDesgin));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.approval",
- new object[] { list }, _ob);
- }
- /// <summary>
- /// 人工创建工艺文件
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- public void CreateCraft(List<CraftOrdDesignEntity> craftOrdDesignList, bool autoBacklog,
- bool autoMaterial, string userId)
- {
- ArrayList list = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesgin in craftOrdDesignList)
- {
- list.Add(JSONFormat.Format(craftOrdDesgin));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.createCraft",
- new object[] { list, autoBacklog, autoMaterial, userId }, _ob);
- }
- /// <summary>
- /// 修改审批人
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- public void UpdateApproveName(List<CraftOrdDesignEntity> craftOrdDesignList)
- {
- ArrayList list = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesgin in craftOrdDesignList)
- {
- list.Add(JSONFormat.Format(craftOrdDesgin));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.updateApproveName",
- new object[] { list }, _ob);
- }
- /// <summary>
- /// 修改批准人
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- public void UpdateApprove1Name(List<CraftOrdDesignEntity> craftOrdDesignList)
- {
- ArrayList list = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesgin in craftOrdDesignList)
- {
- list.Add(JSONFormat.Format(craftOrdDesgin));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.updateApprove1Name",
- new object[] { list }, _ob);
- }
- /// <summary>
- /// 批准
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- public void Approval1(List<CraftOrdDesignEntity> craftOrdDesignList)
- {
- ArrayList list = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesgin in craftOrdDesignList)
- {
- list.Add(JSONFormat.Format(craftOrdDesgin));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.approval1",
- new object[] { list }, _ob);
- }
- /// <summary>
- /// 解锁
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- public void UnLock(List<CraftOrdDesignEntity> craftOrdDesignList)
- {
- ArrayList list = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesign in craftOrdDesignList)
- {
- list.Add(JSONFormat.Format(craftOrdDesign));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.unLock",
- new object[] { list }, _ob);
- }
- /// <summary>
- /// 封锁
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- public void Lock(List<CraftOrdDesignEntity> craftOrdDesignList)
- {
- ArrayList list = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesign in craftOrdDesignList)
- {
- list.Add(JSONFormat.Format(craftOrdDesign));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.lock",
- new object[] { list }, _ob);
- }
- /// <summary>
- /// 修改备注
- /// </summary>
- /// <param name="craftOrdDesignList"></param>
- public void SetMemo(List<CraftOrdDesignEntity> craftOrdDesignList)
- {
- ArrayList list = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesign in craftOrdDesignList)
- {
- list.Add(JSONFormat.Format(craftOrdDesign));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.setMemo",
- new object[] { list }, _ob);
- }
- /// <summary>
- /// 保存二级工艺文件
- /// </summary>
- /// <param name="craftOrdDesign"></param>
- public void SaveCraftLv2(List<CraftOrdDesignEntity> craftOrdDesignList)
- {
- ArrayList parms = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesignEntity in craftOrdDesignList)
- {
- parms.Add(JSONFormat.Format(craftOrdDesignEntity));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.SaveCraftLv2",
- new object[] { parms }, _ob);
- }
- /// <summary>
- /// 修改有效标志
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- public void UpdateCraftNo(List<CraftOrdDesignEntity> craftOrdDesignList, ArrayList list)
- {
- ArrayList Craftlist = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesignEntity in craftOrdDesignList)
- {
- Craftlist.Add(JSONFormat.Format(craftOrdDesignEntity));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.updateCraftNo",
- new object[] { Craftlist, list }, _ob);
- }
- /// <summary>
- /// 通过合同行主键查询工艺评审记录
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- /// <returns></returns>
- public CraftOrdDesignEntity QueryCraftByOrLnPk(CraftOrdDesignEntity craftOrdDesignEntity)
- {
- List<CraftOrdDesignEntity> craftOrdDesingList = EntityHelper.GetData<CraftOrdDesignEntity>(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.queryCraftByOrLnPk"
- , new object[] { JSONFormat.Format(craftOrdDesignEntity) }, _ob);
- if(craftOrdDesingList.Count > 0)
- {
- return craftOrdDesingList[0];
- }
- else
- {
- return null;
- }
- }
- /// <summary>
- /// 修改工艺文件路径
- /// </summary>
- /// <param name="craftOrdDesignEntity"></param>
- public void UpdateCraftPath(CraftOrdDesignEntity craftOrdDesignEntity, string isMultiUse, string isCraftPath)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.updateCraftPath",
- new object[] { JSONFormat.Format(craftOrdDesignEntity), isMultiUse, isCraftPath }, _ob);
- }
- /// <summary>
- /// 获取工艺主表中的工艺文件号数目
- /// </summary>
- /// <param name="craftNo"></param>
- /// <returns></returns>
- public int GetCraftCraftNoCnt(string craftNo)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getCraftNoCnt",
- new object[] { craftNo }, _ob);
- return int.Parse(dt.Rows[0][0].ToString());
- }
- /// <summary>
- /// 获取工艺主表中的引用工艺文件号数目
- /// </summary>
- /// <param name="craftNo"></param>
- /// <returns></returns>
- public int GetRefCraftCraftNoCnt(string craftNo, string ordLnPk, string craftSeq)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getRefCraftNoCnt",
- new object[] { craftNo, ordLnPk, craftSeq }, _ob);
- return int.Parse(dt.Rows[0][0].ToString());
- }
- /// <summary>
- /// 获取工艺主表中的最大工艺版本号。
- /// </summary>
- /// <param name="craftNo"></param>
- /// <returns></returns>
- public string GetCraftMaxCraftNoV(string craftNo)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getCraftMaxCraftNoV",
- new object[] { craftNo }, _ob);
- return dt.Rows[0][0].ToString();
- }
- /// <summary>
- /// 通过合同行主键查询有效数目
- /// </summary>
- /// <param name="ordLnPk"></param>
- /// <returns></returns>
- public int GetCraftValidCntByOrdLnPk(string ordLnPk)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getCraftValidCntByOrLnPk",
- new object[] { ordLnPk }, _ob);
- return int.Parse(dt.Rows[0][0].ToString());
- }
- /// <summary>
- /// 匹配工艺文件
- /// </summary>
- public void MatchCraftFile(List<CraftOrdDesignEntity> craftOrdDesignList)
- {
- ArrayList list = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesign in craftOrdDesignList)
- {
- list.Add(JSONFormat.Format(craftOrdDesign));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.matchCraftFile",
- new object[] { list }, _ob);
- }
- /// <summary>
- /// 查询最大的工艺号并且有效的。
- /// </summary>
- /// <param name="ordLnPk"></param>
- /// <returns></returns>
- public CraftOrdDesignEntity GetNewValidCraft(string ordLnPk)
- {
- List<CraftOrdDesignEntity> list = EntityHelper.GetData<CraftOrdDesignEntity>(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getNewValidCraft",
- new object[] { ordLnPk }, _ob);
- if (list.Count > 0)
- {
- return list[0];
- }
- else
- {
- return null;
- }
- }
- /// <summary>
- /// 设置最大的工艺序号生效
- /// </summary>
- /// <param name="ordLnPk"></param>
- public void SetCraftOrDesignValid(string ordLnPk)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.setCraftOrDesignValid",
- new object[] { ordLnPk }, _ob);
- }
- /// <summary>
- /// 获取排除合同行的工艺文件数目
- /// </summary>
- /// <param name="craftNo"></param>
- /// <param name="craftNoV"></param>
- /// <param name="ordLnPk"></param>
- /// <returns></returns>
- public int GetCraftNoCntOutLn(string craftNo, string craftNoV, string ordLnPk)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getCraftNoCntOutLn",
- new object[]{ craftNo, craftNoV, ordLnPk}, _ob);
- return int.Parse(dt.Rows[0][0].ToString());
- }
- /// <summary>
- /// 获取DESIGN_KEY数目
- /// </summary>
- /// <returns></returns>
- public int GetDesignKeyCnt(string designKey)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getDesignKeyCnt",
- new object[] { designKey }, _ob);
- return int.Parse(dt.Rows[0][0].ToString());
- }
- public int GetCntByDesignKeyProcess(string designKey, string processCode)
- {
- DataTable dt = ServerHelper.GetData(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getCntByDesignKeyProcess",
- new object[] { designKey, processCode }, _ob);
- return int.Parse(dt.Rows[0][0].ToString());
- }
- /// <summary>
- /// 复制二级工艺文件
- /// </summary>
- /// <param name="ordLnPk"></param>
- /// <param name="craftSeq"></param>
- public void CopyCraftFileLv2(string ordLnPk, string craftSeq, string craftSeq2)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.CopyCraftFileLv2",
- new object[] { ordLnPk, craftSeq, craftSeq2 }, _ob);
- }
- /// <summary>
- /// 获取上一个二级工艺文件
- /// </summary>
- /// <param name="ordLnPk"></param>
- /// <param name="craftSeq"></param>
- public DataTable GetPreviousCraftLv2(string ordLnPk, string craftSeq)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.GetPreviousCraftLv2",
- new object[]{ordLnPk, craftSeq}, _ob);
- return dt;
- }
- /// <summary>
- /// 删除工艺文件
- /// </summary>
- /// <param name="craftOrdDesignList"></param>
- public void DeleteCraftFile(List<CraftOrdDesignEntity> craftOrdDesignList)
- {
- ArrayList list = new ArrayList();
- foreach (CraftOrdDesignEntity craftOrdDesign in craftOrdDesignList)
- {
- list.Add(JSONFormat.Format(craftOrdDesign));
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.DeleteCraftFile",
- new object[] { list }, _ob);
- }
- public string GetMaxCraftSeq(string ordLnPk)
- {
- return ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.GetMaxCraftSeq",
- new object[] { ordLnPk }, _ob).Rows[0][0].ToString();
- }
- public bool GetMaterialAutoCraft(string ordLnPk)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.GetMaterialAutoCraft",
- new object[] { ordLnPk }, _ob);
- if (dt.Rows[0][0].ToString() == "1")
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- public bool GetBacklogAutoCraft(string ordLnPk)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.GetBacklogAutoCraft",
- new object[] { ordLnPk }, _ob);
- if (dt.Rows[0][0].ToString() == "0")
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- public bool AutoCreateCraft(string ordLnPk, string designStyle)
- {
- string[] results = (string[])ServerHelper.SetDataReturnObj(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.GetAutoCreateCraftParms",
- new object[] { ordLnPk }, _ob);
- if (designStyle != "2" && (!GetMaterialAutoCraft(ordLnPk) || !GetBacklogAutoCraft(ordLnPk)))//只有物料和所有制程都为自动生成,才进行自动生成工艺文件。
- {
- return false;
- }
- WaitingForm2 wf;
- if (designStyle == "2") //备料处理
- {
- wf = new WaitingForm2("正在生成工艺文件....");
- }
- else
- {
- wf = new WaitingForm2("正在自动生成工艺文件....");
- }
- CraftOrdDesignEntity craftOrdDesign = new CraftOrdDesignEntity();
- craftOrdDesign.OrdLnPk = ordLnPk;
- craftOrdDesign.CraftSeq = decimal.Parse(results[0]);
- craftOrdDesign.CraftNo = results[1];
- craftOrdDesign.DesginKey = results[2];
- string craftPath = "Qcm/Craft/" + craftOrdDesign.OrdLnPk + "/" +
- craftOrdDesign.CraftSeq + "/" + results[3] + ".pdf";
- ServerHelper.SetDataReturnObj(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.AutoCreateCraft",
- new object[] { ordLnPk, results[0], results[1], craftPath, CoreUserInfo.UserInfo.GetUserName(), designStyle }, _ob);
- if (!CreatePdfToFtp(craftOrdDesign, results[3]))
- {
- MessageUtil.ShowError("系统生成PDF失败,请稍后再试!");
- return false;
- }
- string validflag = "1";
- if (craftOrdDesign.CraftSeq > 1)
- {
- validflag = "8";
- }
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.SetValidflagByPk",
- new object[] { validflag, ordLnPk, results[0] }, _ob);
- wf.Close();
- return true;
- }
- public void SetMaterialAutoCraft(string ordLnPk)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.SetMaterialAutoCraft",
- new object[]{ordLnPk}, _ob);
- }
- public void SetBacklogAutoCraft(string ordLnPk)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.SetBacklogAutoCraft",
- new object[] { ordLnPk }, _ob);
- }
- public void SetCraftOrdDesignMaterial(string ordLnPk)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.SetCraftOrdDesignMaterial",
- new object[] { ordLnPk }, _ob);
- }
- public void SetCraftOrdDesignBacklog(string ordLnPk)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.SetCraftOrdDesignBacklog",
- new object[] { ordLnPk }, _ob);
- }
- public DataRow GetMscByOrdLnPk(string ordLnPk)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.GetMscByOrdLnPk",
- new object[] { ordLnPk }, _ob);
- if (dt.Rows.Count > 0)
- {
- return dt.Rows[0];
- }
- else
- {
- return null;
- }
- }
- public DataRow GetCraftDesignSts(string ordLnPk)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.ReviewForm.CoreOrderReviewTechnology.getCraftDesignSts",
- new object[] { ordLnPk }, _ob);
- if (dt.Rows.Count > 0)
- {
- return dt.Rows[0];
- }
- else
- {
- return null;
- }
- }
- /// <summary>
- /// 调用报表服务器生成PDF并上传到FTP服务器。
- /// </summary>
- /// <param name="craftOrdDesignList"></param>
- /// <returns></returns>
- public bool CreatePdfToFtp(CraftOrdDesignEntity craftOrdDesign, string pdfName)
- {
- WebClient webClient = new WebClient();
- List<FileBean> listPdf = new List<FileBean>();
- string filePathNew = "Qcm/Craft/" + craftOrdDesign.OrdLnPk + "/" + craftOrdDesign.CraftSeq + "/";
-
- craftOrdDesign.CraftPath = filePathNew + pdfName + ".pdf";
- DataTable dtComMsc = CraftOrdDesignCtrl.GetComMscByOrdLnPk(craftOrdDesign.OrdLnPk, _ob);
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepTechOrderLineCraft.cpt&bypagesize=false&format=pdf&embed=true"
- + "&desgin_key=" + craftOrdDesign.DesginKey + "&lnpk=" + craftOrdDesign.OrdLnPk;
- if (dtComMsc.Rows[0]["DEPARTMENT_CODE"].ToString() == "002001007")
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepTechOrderLineCraftCenter.cpt&bypagesize=false&format=pdf&embed=true"
- + "&desgin_key=" + craftOrdDesign.DesginKey + "&lnpk=" + craftOrdDesign.OrdLnPk;
- }
- byte[] pdf = webClient.DownloadData(strurl);
- if (pdf.Length <= 10000)
- {
- MessageUtil.ShowError("生成PDF出错,请重新生成!");
- return false;
- }
- FileBean fileBean = new FileBean();
- fileBean.setFile(pdf);
- fileBean.setFileName(pdfName + ".pdf");
- fileBean.setPathName(filePathNew);
- listPdf.Add(fileBean);
- webClient.Dispose();
- return FileHelper.Upload(listPdf);
- }
- public void SetProcessFlag(string processCode, string flag,
- string ordLnPk, string craftSeq)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.SetProcessFlag",
- new object[] { processCode, flag, ordLnPk, craftSeq }, _ob);
- }
- public void SetProcessFlag(List<object> para, string flag)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.SetProcessFlag",
- new object[] { para, flag }, _ob);
- }
- public void SetProcessJhFlag(List<object> para, string flag)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.SetProcessJhFlag",
- new object[] { para, flag }, _ob);
- }
- public void SetProcessFlag(string processCode, string flag,string craftno)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.SetProcessFlag",
- new object[] { processCode, flag, craftno }, _ob);
- }
- /// <summary>
- /// 获取工艺评审取样要求
- /// </summary>
- /// <param name="designKey"></param>
- /// <param name="processCode"></param>
- /// <returns></returns>
- public DataTable GetCraftPicSmp(string designKey, string processCode)
- {
- return ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getCraftPicSmp",
- new object[] { designKey, processCode }, _ob);
- }
- /// <summary>
- /// 获取工艺评审取样要求分组
- /// </summary>
- /// <param name="designKey"></param>
- /// <param name="processCode"></param>
- /// <returns></returns>
- public DataTable GetCraftPicSmpGroup(string designKey, string processCode)
- {
- return ServerHelper.GetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getCraftPicSmpGroup",
- new object[] { designKey, processCode }, _ob);
- }
- /// <summary>
- /// 获取工艺评审取样要求分组
- /// </summary>
- /// <param name="designKey"></param>
- /// <param name="processCode"></param>
- /// <returns></returns>
- public List<CraftOrdDesignStdPicSmpDetailEntity> GetCraftPicSmpGroup(string LnPk, string CraftSeq, string CraftNo, string designKey, string Msc, string processCode, string Cic,int Cut)
- {
- List<CraftOrdDesignStdPicSmpDetailEntity> listCraftOrdDesignStdPicSmpDetailEntity = EntityHelper.GetData<CraftOrdDesignStdPicSmpDetailEntity>(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getCraftSamplingDetaill",
- new object[] { LnPk, CraftSeq, processCode }, _ob);
- if (!listCraftOrdDesignStdPicSmpDetailEntity.Any())
- {
- listCraftOrdDesignStdPicSmpDetailEntity = EntityHelper
- .GetData<CraftOrdDesignStdPicSmpDetailEntity>(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getCraftPicSmpGroup",
- new object[] {designKey, Msc, processCode, Cic, CraftNo}, _ob);
- listCraftOrdDesignStdPicSmpDetailEntity.ForEach(p =>
- {
- p.OrdLnPk = LnPk;
- p.CraftSeq = CraftSeq;
- if (p.BatchCnt.TryParseInt())
- {
- p.BatchCnt = int.Parse(p.BatchCnt)*Cut + "";
- }
- });
- }
-
- return listCraftOrdDesignStdPicSmpDetailEntity;
- }
- /// <summary>
- /// 获取工艺评审取样要求汇总
- /// </summary>
- /// <param name="designKey"></param>
- /// <param name="processCode"></param>
- /// <returns></returns>
- public List<CraftOrdDesignStdPicSmpTotalEntity> GetCraftSamplingTotal(string LnPk, string CraftSeq, string CraftNo, string processCode)
- {
- List<CraftOrdDesignStdPicSmpTotalEntity> CraftOrdDesignStdPicSmpTotalEntity = EntityHelper.GetData<CraftOrdDesignStdPicSmpTotalEntity>(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getCraftSamplingTotal",
- new object[] { LnPk,CraftSeq, processCode }, _ob);
- return CraftOrdDesignStdPicSmpTotalEntity;
- }
- /// <summary>
- /// 获取工艺评审取样要求汇总
- /// </summary>
- /// <param name="designKey"></param>
- /// <param name="processCode"></param>
- /// <returns></returns>
- public void SaveCraftSampling(List<CraftOrdDesignStdPicSmpTotalEntity> CraftOrdDesignStdPicSmpTotalEntity, List<CraftOrdDesignStdPicSmpDetailEntity> CraftOrdDesignStdPicSmpDetailEntity)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.SaveCraftSampling",
- new object[] { CraftOrdDesignStdPicSmpTotalEntity.Select(JSONFormat.Format).ToList(), CraftOrdDesignStdPicSmpDetailEntity.Select(JSONFormat.Format).ToList() }, _ob);
- }
- /// <summary>
- /// 获取工艺评审取样要求汇总
- /// </summary>
- /// <param name="designKey"></param>
- /// <param name="processCode"></param>
- /// <returns></returns>
- public void CancelCraftSampling(CraftOrdDesignStdPicSmpTotalEntity CraftOrdDesignStdPicSmpTotalEntity)
- {
- ServerHelper.SetData("com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.DeleteCraftSampling",
- new object[] { JSONFormat.Format(CraftOrdDesignStdPicSmpTotalEntity) }, _ob);
- }
- /// <summary>
- /// 获取工艺评审取样要求汇总
- /// </summary>
- /// <param name="designKey"></param>
- /// <param name="processCode"></param>
- /// <returns></returns>
- public List<CraftOrdDesignStdPicEntity> getSampleDetail(string designKey, string processCode)
- {
- List<CraftOrdDesignStdPicEntity> CraftOrdDesignStdPicEntity = EntityHelper.GetData<CraftOrdDesignStdPicEntity>(
- "com.steering.pss.sale.order.DAL.CraftOrdDesignDAL.getSampleDetail",
- new object[] { designKey, processCode }, _ob);
- return CraftOrdDesignStdPicEntity;
- }
- }
- }
|