Ejemplo n.º 1
0
        public IHttpActionResult SubmitProof(dynamic proof)
        {
            User           u            = SessionManage.CurrentUser;
            string         proofOrderId = (string)proof.ProofOrderId;
            ProofOrderOper poo          = new ProofOrderOper(u);
            ProofOrder     po           = poo.GetProof(proofOrderId);

            if (po.ProofStatus == ProofStatus.草拟 || po.ProofStatus == ProofStatus.退回)
            {
                NewApprove na = new NewApprove(DdOperator.GetDdApi())
                {
                    User        = u,
                    ProcessCode = Config.GetSampleConfig().ProofProcessCode
                };
                var    ApproveItems   = ProofOrderApprove.ToApprove(po);
                string DdApprovalCode = na.SendApprove(ApproveItems);
                if (DdApprovalCode != "")
                {
                    poo.SetApprove(po, DdApprovalCode);
                    poo.SaveChange();
                }
            }

            return(Ok(po));
        }
Ejemplo n.º 2
0
        public IHttpActionResult FinshProof(string id)
        {
            User           u      = SessionManage.CurrentUser;
            ProofOrderOper poo    = new ProofOrderOper(u);
            var            result = poo.FinshProof(id);

            if (result != null)
            {
                //发送交样申请
                string     ddid      = result.ProofApplyUserDdId;
                User       applyUser = SampleDataOper.DataQuery.GetSingle <User>(p => p.DdId == ddid);
                NewApprove na        = new NewApprove(DdOperator.GetDdApi())
                {
                    User        = applyUser,
                    ProcessCode = Config.GetSampleConfig().FinshProofProcessCode
                };

                List <ApproveItem> items = new List <ApproveItem>()
                {
                    new ApproveItem()
                    {
                        Name  = "单号",
                        Value = result.ProofOrderId
                    },
                    new ApproveItem()
                    {
                        Name  = "款号",
                        Value = result.ProofStyle.ClientNo
                    },
                    new ApproveItem()
                    {
                        Name  = "客户",
                        Value = result.ProofStyle.ClentName
                    },
                    new  ApproveItem {
                        Name  = "打样部门",
                        Value = "打样中心"
                    },
                };
                string DdApprovalCode = na.SendApprove(items);
                if (DdApprovalCode != "")
                {
                    poo.SetFinshApprove(result, DdApprovalCode);
                    poo.SaveChange();
                    return(Ok());
                }
                ;
            }
            return(BadRequest("订单号错误。"));
        }