Пример #1
0
        public ActionResult CopyFileListDetail(string borrowId)
        {
            var copyRecordList = ApplyCopyFileListService
                                 .GetByWhere(" where BorrowID=@BorrowID", new { BorrowID = borrowId }).Select(item => item.RecordID)
                                 .ToList();

            var html = "";

            foreach (var recordId in copyRecordList)
            {
                var record        = recordService.GetRecord(recordId);
                var typeList      = ContractFileType.GetListByRecordId(recordId);
                var fileList      = recordService.GetRecordListByRecordId(recordId);
                var otherFileList = recordService.GetOtherFileListByRecordId(recordId);

                html += "<fieldset class='layui-elem-field layui-field-title' style='margin-top:20px;'>" +
                        "<legend>" + record.RecordUserName + "</legend>" +
                        "</fieldset><div style='padding: 20px; background-color: #F2F2F2;'>";
                foreach (var type in typeList)
                {
                    html += "<div class=\"layui-card\">" +
                            "<div class=\"layui-card-header\">" + type.RecordTypeName + " " + type.HoldingCell + "</div>" +
                            "<div class=\"layui-card-body\">" +
                            "<div class=\"layui-fluid\">";

                    foreach (var temp in fileList.Where(item => item.RecordType == type.ID))
                    {
                        var time = temp.ExpirationTime == null
                            ? "无过期时间"
                            : temp.ExpirationTime.GetValueOrDefault().ToString("yyyy-MM-dd");
                        html += "<div class=\"layui-row\" style=\"text-align: center;\">" +
                                "<div class=\"layui-col-xs4\">" + temp.RecordFileName + "</div>" +
                                "<div class=\"layui-col-xs4\">" + time + "</div>" +
                                "<div class=\"layui-col-xs4\">x" + temp.Amount + "</div>" +
                                "</div>";
                    }

                    foreach (var temp in otherFileList.Where(item => item.RecordFileType == type.ID))
                    {
                        var time = temp.ExpirationTime == null
                            ? "无过期时间"
                            : temp.ExpirationTime.GetValueOrDefault().ToString("yyyy-MM-dd");
                        html += "<div class=\"layui-row\" style=\"text-align: center;\">" +
                                "<div class=\"layui-col-xs4\">" + temp.FileName + "</div>" +
                                "<div class=\"layui-col-xs4\">" + time + "</div>" +
                                "<div class=\"layui-col-xs4\">x" + temp.Amount + "</div>" +
                                "</div>";
                    }

                    html += "</div></div></div>";
                }

                html += "</div>";
            }

            ViewBag.html = html;
            return(View("RecordReturn"));
        }
Пример #2
0
        public ActionResult ApplyCopyAgree(string borrowId)
        {
            try
            {
                var applyCopy = ApplyCopyService.GetByWhere(" where BorrowID=@BorrowID", new { BorrowID = borrowId })
                                .First();
                applyCopy.ApplyState = 2;
                var result = ApplyCopyService.UpdateModel(applyCopy);

                if (result)
                {
                    var applyRecordList = ApplyCopyFileListService
                                          .GetByWhere(" where BorrowID=@BorrowID", new { BorrowID = borrowId }).ToList();

                    foreach (var record in applyRecordList)
                    {
                        var operate = new OperateLog()
                        {
                            OperateTime   = DateTime.Now,
                            OperateType   = "审批调阅",
                            OperatePeople = Operator.RealName,
                            RecordId      = record.RecordID
                        };
                        operate.OperateInfo += $"档案编号:{record.RecordID} 申请调阅审核通过";
                        OperateLogService.CreateModel(operate);
                    }

                    return(Json(SuccessTip("申请调阅审核成功!")));
                }
                else
                {
                    return(Json(ErrorTip("申请调阅审核失败!")));
                }
            }
            catch (InvalidOperationException ex)
            {
                Log.WriteFatal(ex);
                return(Json(ErrorTip("获取不到申请调阅记录,出现数据一致性错误!")));
            }
        }