示例#1
0
 public static MoveOrder_CE ToCE(MoveOrderEntity item)
 {
     MoveOrder_CE target = new MoveOrder_CE();
     target.ID=item.ID;
     target.OrderNum=item.OrderNum;
     target.MoveType=item.MoveType;
     target.ProductType=item.ProductType;
     target.ContractOrder=item.ContractOrder;
     target.Status=item.Status;
     target.IsDelete=item.IsDelete;
     target.Num=item.Num;
     target.Amout=item.Amout;
     target.Weight=item.Weight;
     target.CreateTime=item.CreateTime;
     target.CreateUser=item.CreateUser;
     target.AuditUser=item.AuditUser;
     target.AuditeTime=item.AuditeTime;
     target.PrintUser=item.PrintUser;
     target.PrintTime=item.PrintTime;
     target.Reason=item.Reason;
     target.OperateType=item.OperateType;
     target.EquipmentNum=item.EquipmentNum;
     target.EquipmentCode=item.EquipmentCode;
     target.Remark=item.Remark;
     return target;
 }
 public ActionResult Delete()
 {
     string orderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
     if (!orderNum.IsEmpty())
     {
         Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder();
         MoveOrderEntity entity = new MoveOrderEntity();
         entity.OrderNum = orderNum;
         string returnValue = bill.Delete(entity);
         this.ReturnJson.AddProperty("d", returnValue);
     }
     return Content(this.ReturnJson.ToString());
 }
 public ActionResult DeleteBatch([ModelBinder(typeof(JsonBinder<List<string>>))] List<string> list)
 {
     if (!list.IsNullOrEmpty())
     {
         foreach (string orderNum in list)
         {
             Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder();
             MoveOrderEntity entity = new MoveOrderEntity();
             entity.OrderNum = orderNum;
             string returnValue = bill.Delete(entity);
             this.ReturnJson.AddProperty("d", returnValue);
         }
     }
     return Content(this.ReturnJson.ToString());
 }
        public ActionResult Create()
        {
            List<MoveOrderDetailEntity> listResult = Session[CacheKey.TEMPDATA_CACHE_MOVERODUCTDETAIL] as List<MoveOrderDetailEntity>;
            if (listResult.IsNullOrEmpty())
            {
                this.ReturnJson.AddProperty("d", "1006");
                return Content(this.ReturnJson.ToString());
            }
            string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
            int MoveType = WebUtil.GetFormValue<int>("MoveType", (int)EMoveType.MoveToBad);
            int ProductType = WebUtil.GetFormValue<int>("ProductType", (int)EProductType.Goods);
            string ContractOrder = WebUtil.GetFormValue<string>("ContractOrder", string.Empty);
            DateTime OrderTime = WebUtil.GetFormValue<DateTime>("OrderTime", DateTime.Now);
            string Remark = WebUtil.GetFormValue<string>("Remark", string.Empty);
            MoveOrderEntity badEntity = new MoveOrderEntity();
            badEntity.OrderNum = OrderNum.IsEmpty() ? SequenceProvider.GetSequence(typeof(MoveOrderEntity)) : OrderNum;
            badEntity.MoveType = MoveType;
            badEntity.ProductType = ProductType;
            badEntity.ContractOrder = ContractOrder;
            badEntity.Status = (int)EAudite.Wait;
            badEntity.Num = 0;
            badEntity.IsDelete = (int)EIsDelete.NotDelete;
            badEntity.CreateTime = OrderTime;
            badEntity.CreateUser = this.LoginUser.UserCode;
            badEntity.OperateType = (int)EOpType.PC;
            badEntity.EquipmentNum = string.Empty;
            badEntity.EquipmentCode = string.Empty;
            badEntity.Remark = Remark;
            badEntity.Num = listResult.Sum(a=>a.Num);
            badEntity.Amout = listResult.Sum(a => a.Amout);
            badEntity.StorageNum = this.DefaultStore;

            Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder();
            if (OrderNum.IsEmpty())
            {
                string returnValue = bill.Create(badEntity, listResult);
                this.ReturnJson.AddProperty("d", returnValue);
                Session[CacheKey.TEMPDATA_CACHE_MOVERODUCTDETAIL] = null;
            }
            else
            {
                string returnValue = bill.EditOrder(badEntity, listResult);
                this.ReturnJson.AddProperty("d", returnValue);
            }
            return Content(this.ReturnJson.ToString());
        }
 public ActionResult Audit()
 {
     string orderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
     int status = WebUtil.GetFormValue<int>("Status", 0);
     string reason = WebUtil.GetFormValue<string>("Reason", string.Empty);
     MoveOrderEntity entity = new MoveOrderEntity();
     entity.Status = status;
     entity.OrderNum = orderNum;
     entity.AuditUser = this.LoginUserCode;
     entity.OperateType = (int)EOpType.PC;
     entity.EquipmentCode = string.Empty;
     entity.EquipmentNum = string.Empty;
     entity.Remark = string.Empty;
     entity.Reason = reason;
     Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder();
     string returnValue = bill.Audite(entity);
     this.ReturnJson.AddProperty("d", returnValue);
     return Content(this.ReturnJson.ToString());
 }
示例#6
0
        public ActionResult Detail()
        {
            string orderNum = WebUtil.GetQueryStringValue<string>("orderNum", string.Empty);
            string flag = WebUtil.GetQueryStringValue<string>("flag", string.Empty);
            Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder();
            MoveOrderEntity entity = new MoveOrderEntity();
            entity.OrderNum = orderNum;
            entity = bill.GetOrder(entity);
            entity = entity.IsNull() ? new MoveOrderEntity() : entity;
            ViewBag.BadReport = entity;
            ViewBag.Status = EnumHelper.GetEnumDesc<EAudite>(entity.Status);

            MoveOrderDetailEntity detail = new MoveOrderDetailEntity();
            detail.OrderNum = orderNum;
            List<MoveOrderDetailEntity> listResult = bill.GetOrderDetail(detail);
            listResult = listResult.IsNull() ? new List<MoveOrderDetailEntity>() : listResult;
            ViewBag.Detail = listResult;
            ViewBag.Flag = flag;
            return View();
        }
示例#7
0
        public ActionResult Edit()
        {
            string orderNum = WebUtil.GetQueryStringValue<string>("orderNum", string.Empty);
            if (orderNum.IsEmpty())
            {
                return Redirect("/Move/Product/List");
            }
            Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder();
            MoveOrderEntity entity = new MoveOrderEntity();
            entity.OrderNum = orderNum;
            entity = bill.GetOrder(entity);
            if (entity.IsNull())
            {
                return Redirect("/Move/Product/List");
            }
            ViewBag.Entity = entity;
            ViewBag.Status = EnumHelper.GetEnumDesc<EAudite>(entity.Status);
            ViewBag.MoveType = EnumHelper.GetOptions<EMoveType>(entity.MoveType, "请选择移库类型");
            ViewBag.ProductType = EnumHelper.GetOptions<EProductType>(entity.ProductType, "请选择入库产品类型");

            MoveOrderDetailEntity detail = new MoveOrderDetailEntity();
            detail.OrderNum = orderNum;
            List<MoveOrderDetailEntity> listResult = bill.GetOrderDetail(detail);
            Session[CacheKey.TEMPDATA_CACHE_MOVERODUCTDETAIL] = listResult;
            return View();
        }
 public ActionResult GetList()
 {
     int Status = WebUtil.GetFormValue<int>("Status", 0);
     string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
     string BadType = WebUtil.GetFormValue<string>("BadType", string.Empty);
     string ProductType = WebUtil.GetFormValue<string>("ProductType", string.Empty);
     string beginTime = WebUtil.GetFormValue<string>("beginTime", string.Empty);
     string endTime = WebUtil.GetFormValue<string>("endTime", string.Empty);
     int pageSize = WebUtil.GetFormValue<int>("PageSize", 10);
     int pageIndex = WebUtil.GetFormValue<int>("PageIndex", 1);
     PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize };
     MoveOrderEntity entity = new MoveOrderEntity();
     if (Status > 0)
     {
         entity.Where(a => a.Status == Status);
     }
     if (!OrderNum.IsEmpty())
     {
         entity.Where("OrderNum", ECondition.Like, "%" + OrderNum + "%");
     }
     if (!ProductType.IsEmpty())
     {
         entity.Where("ProductType", ECondition.Eth, ProductType);
     }
     if (!BadType.IsEmpty())
     {
         entity.Where("BadType", ECondition.Eth, BadType);
     }
     if (!beginTime.IsEmpty() && !endTime.IsEmpty())
     {
         entity.Where("CreateTime", ECondition.Between, ConvertHelper.ToType<DateTime>(beginTime), ConvertHelper.ToType<DateTime>(endTime));
     }
     entity.And(a => a.StorageNum == this.DefaultStore);
     Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder();
     List<MoveOrderEntity> listResult = bill.GetList(entity, ref pageInfo);
     listResult = listResult == null ? new List<MoveOrderEntity>() : listResult;
     string json = ConvertJson.ListToJson<MoveOrderEntity>(listResult, "List");
     this.ReturnJson.AddProperty("Data", json);
     this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount);
     return Content(this.ReturnJson.ToString());
 }
        public ActionResult ToExcel()
        {
            int Status = WebUtil.GetFormValue<int>("Status", 0);
            string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty);
            string BadType = WebUtil.GetFormValue<string>("BadType", string.Empty);
            string ProductType = WebUtil.GetFormValue<string>("ProductType", string.Empty);
            string beginTime = WebUtil.GetFormValue<string>("beginTime", string.Empty);
            string endTime = WebUtil.GetFormValue<string>("endTime", string.Empty);
            PageInfo pageInfo = new PageInfo() { PageIndex = 1, PageSize = int.MaxValue };
            MoveOrderEntity entity = new MoveOrderEntity();
            if (Status > 0)
            {
                entity.Where(a => a.Status == Status);
            }
            if (!OrderNum.IsEmpty())
            {
                entity.Where("OrderNum", ECondition.Like, "%" + OrderNum + "%");
            }
            if (!ProductType.IsEmpty())
            {
                entity.Where("ProductType", ECondition.Eth, ProductType);
            }
            if (!BadType.IsEmpty())
            {
                entity.Where("BadType", ECondition.Eth, BadType);
            }
            if (!beginTime.IsEmpty() && !endTime.IsEmpty())
            {
                entity.Where("CreateTime", ECondition.Between, ConvertHelper.ToType<DateTime>(beginTime), ConvertHelper.ToType<DateTime>(endTime));
            }
            entity.And(a => a.StorageNum == this.DefaultStore);
            Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder();
            List<MoveOrderEntity> listResult = bill.GetList(entity, ref pageInfo);
            if (!listResult.IsNullOrEmpty())
            {
                DataTable dt = new DataTable();
                dt.Columns.Add(new DataColumn("序号 "));
                dt.Columns.Add(new DataColumn("移库单编号 "));
                dt.Columns.Add(new DataColumn("移库类型"));
                dt.Columns.Add(new DataColumn("关联单号"));
                dt.Columns.Add(new DataColumn("移库总数"));
                dt.Columns.Add(new DataColumn("移库人"));
                dt.Columns.Add(new DataColumn("状态"));
                dt.Columns.Add(new DataColumn("创建时间"));
                int count = 1;
                foreach (MoveOrderEntity t in listResult)
                {
                    DataRow row = dt.NewRow();
                    row[0] = count;
                    row[1] = t.OrderNum;
                    row[2] = EnumHelper.GetEnumDesc<EMoveType>(t.MoveType);
                    row[3] = t.ContractOrder;
                    row[4] = t.Num;
                    row[5] = t.CreateUserName;
                    row[6] = EnumHelper.GetEnumDesc<EAudite>(t.Status);
                    row[7] = t.CreateTime.ToString("yyyy-MM-dd");
                    dt.Rows.Add(row);
                    count++;
                }

                string filePath = Server.MapPath("~/UploadFiles/");
                if (!System.IO.Directory.Exists(filePath))
                {
                    System.IO.Directory.CreateDirectory(filePath);
                }
                string filename = string.Format("移库管理{0}.xls", DateTime.Now.ToString("yyyyMMddHHmmss"));
                NPOIExcel excel = new NPOIExcel("移库管理", "移库单", System.IO.Path.Combine(filePath, filename));
                excel.ToExcel(dt);
                this.ReturnJson.AddProperty("Path", ("/UploadFiles/" + filename).Escape());
            }
            else
            {
                this.ReturnJson.AddProperty("d", "无数据导出!");
            }
            return Content(this.ReturnJson.ToString());
        }