Пример #1
0
 /// <summary>
 /// 檢查繳費截止日期是否未填
 /// </summary>
 /// <param name="payEndDate"></param>
 /// <param name="customer"></param>
 /// <returns></returns>
 private static void CheckPayEndDate(SysMessageLog message, BillModel bill)
 {
     if ((bill.BizCustomer.MarketEnable || bill.BizCustomer.PostEnable) && (bill.PayEndDate == null || bill.PayEndDate.Equals(DateTime.MinValue)))
     {
         message.AddCustErrorMessage(MessageCode.Code0001, ResxManage.GetDescription <BillModel>(p => p.PayEndDate));
     }
 }
Пример #2
0
 /// <summary>
 /// 檢查繳款人是否為約定扣款帳號
 /// </summary>
 /// <param name="message"></param>
 /// <param name="payer"></param>
 private static void CheckPayerType(SysMessageLog message, PayerModel payer)
 {
     if (payer.PayerType != PayerType.Account)
     {
         message.AddCustErrorMessage(MessageCode.Code1017, payer.PayerName, ResxManage.GetDescription(PayerType.Account));
     }
 }
Пример #3
0
 /// <summary>
 /// 檢查超商代收項目
 /// </summary>
 /// <param name="payEndDate"></param>
 /// <param name="customer"></param>
 /// <returns></returns>
 private static void CheckCollectionTypeId(SysMessageLog message, ApplicationDbContext dataAccess, BillModel bill)
 {
     if (bill.BizCustomer.MarketEnable)
     {
         if (bill.CollectionTypeId.IsNullOrEmpty())
         {
             message.AddCustErrorMessage(MessageCode.Code0001, ResxManage.GetDescription <BillModel>(p => p.CollectionTypeId));
         }
         else
         {
             if (!bill.BizCustomer.CollectionTypeIds.Split(',').Contains(bill.CollectionTypeId))
             {
                 message.AddCustErrorMessage(MessageCode.Code1015, bill.CollectionTypeId);
             }
             else
             {
                 CollectionTypeDetailModel colDet = dataAccess.Set <CollectionTypeDetailModel>().FirstOrDefault(p => p.CollectionTypeId.Equals(bill.CollectionTypeId) && p.SRange <= bill.PayAmount && p.ERange >= bill.PayAmount);
                 if (null == colDet)
                 {
                     message.AddCustErrorMessage(MessageCode.Code1016, bill.CollectionTypeId);
                 }
             }
         }
     }
 }
Пример #4
0
 /// <summary>
 /// 檢查「繳款人編號」是否皆為數字
 /// </summary>
 /// <param name="payerNo"></param>
 /// <returns></returns>
 private static void CheckPayerNoIsNotNum(SysMessageLog message, string payerNo)
 {
     if (!payerNo.IsNumberString())
     {
         message.AddCustErrorMessage(MessageCode.Code1006, ResxManage.GetDescription <PayerModel>(p => p.PayerNo));
     }
 }
Пример #5
0
        /// <summary>
        /// 檢查銷帳編號長度
        /// </summary>
        /// <param name="message"></param>
        /// <param name="bizCustomer"></param>
        private static void CheckVirtualAccountLength(SysMessageLog message, BizCustomerModel bizCustomer)
        {
            int len = bizCustomer.CustomerCode.Length;

            if (bizCustomer.VirtualAccount1 != VirtualAccount1.Empty)
            {
                len += bizCustomer.BillTermLen;
            }
            if (bizCustomer.VirtualAccount2 != VirtualAccount2.Empty)
            {
                len += bizCustomer.PayerNoLen;
            }
            if (bizCustomer.VirtualAccount3.In(VirtualAccount3.SeqPayEndDate, VirtualAccount3.SeqAmountPayEndDate))
            {
                len += 4;
            }
            if (bizCustomer.VirtualAccount3 != VirtualAccount3.NoverifyCode)
            {
                len += 1;
            }
            if ((int)bizCustomer.VirtualAccountLen != len)
            {
                message.AddCustErrorMessage(MessageCode.Code1007, (int)bizCustomer.VirtualAccountLen, len);
            }
        }
 /// <summary>
 /// 檢查「期別編號」是否為數字
 /// </summary>
 /// <param name="payer"></param>
 private static void CheckTermNo(SysMessageLog message, BillTermModel billTerm)
 {
     if (!billTerm.BillTermNo.IsNumberString())
     {
         message.AddCustErrorMessage(MessageCode.Code1006, ResxManage.GetDescription <BillTermModel>(p => p.BillTermNo));
     }
 }
Пример #7
0
 /// <summary>
 /// 檢查「繳款人編號」長度
 /// </summary>
 /// <param name="payer"></param>
 private static void CheckPayerNoLen(SysMessageLog message, PayerModel payer)
 {
     if (payer.PayerNo.Length != payer.BizCustomer.PayerNoLen)
     {
         message.AddCustErrorMessage(MessageCode.Code1005, ResxManage.GetDescription <PayerModel>(p => p.PayerNo), payer.BizCustomer.PayerNoLen);
     }
 }
 /// <summary>
 /// 檢查期別編號長度
 /// </summary>
 /// <param name="billTerm"></param>
 /// <returns></returns>
 private static void CheckTermNoLen(SysMessageLog message, BillTermModel billTerm)
 {
     if (billTerm.BizCustomer.BillTermLen != billTerm.BillTermNo.Length)
     {
         message.AddCustErrorMessage(MessageCode.Code1005, ResxManage.GetDescription <BillTermModel>(p => p.BillTermNo), billTerm.BizCustomer.BillTermLen);
     }
 }
 /// <summary>
 /// 檢查資料
 /// </summary>
 /// <param name="set"></param>
 public static void CheckData(DepositBillSet set, SysMessageLog message, ApplicationDbContext dataAccess)
 {
     if (BizVirtualAccountCode.CheckBankCodeExist(dataAccess, set.DepositBill.VirtualAccountCode, out _))
     {
         message.AddCustErrorMessage(MessageCode.Code1008, ResxManage.GetDescription <DepositBillModel>(p => p.VirtualAccountCode), set.DepositBill.VirtualAccountCode);
     }
 }
Пример #10
0
        /// <summary>
        /// 匯款檔
        /// </summary>
        public static List <RemitInfoModel> RemitInfoData(SysMessageLog Message)
        {
            List <RemitInfoModel> rts = new List <RemitInfoModel>()
            {
                new RemitInfoModel()
                {
                    RemitDate = "20190910", RemitTime = "145833", Channel = "03", CollectionType = "6V1", Amount = "90000", BatchNo = "03030", Empty = ""
                },
                //new RemitInfoModel() { RemitDate="", RemitTime="", Channel="", CollectionType="", Amount="", BatchNo=""},
                //new RemitInfoModel() { RemitDate="", RemitTime="", Channel="", CollectionType="", Amount="", BatchNo=""},
            };
            bool err = false;

            rts.ForEach(p => { if (p.Source != new RemitInfoModel()
                {
                    Source = p.Source
                }.Source)
                               {
                                   err = true; return;
                               }
                        });
            if (err)
            {
                Message.AddCustErrorMessage(MessageCode.Code0000, "匯款檔Source拆分組合異常"); return(null);
            }
            string path = $@"D:\ibankRoot\Ftp_SKGPortalCore\TransactionListDaily\"; Directory.CreateDirectory(path);

            using StreamWriter sw = new StreamWriter($@"{path}SKG_RT.{DateTime.Now.ToString("yyyyMMdd")}", false, Encoding.GetEncoding(950));
            rts.ForEach(p => sw.WriteLine(p.Source));
            sw.Close();
            return(rts);
        }
Пример #11
0
 /// <summary>
 /// 檢查期別編號是否重複
 /// </summary>
 /// <param name="dataAccess"></param>
 /// <param name="billTerm"></param>
 /// <returns></returns>
 private static void CheckTermNoExist(SysMessageLog message, ApplicationDbContext dataAccess, BillTermModel billTerm)
 {
     if (dataAccess.Set <BillTermModel>().Any(p => p.InternalId != billTerm.InternalId && p.CustomerCode == billTerm.CustomerCode &&
                                              p.BillTermNo == billTerm.BillTermNo && (p.FormStatus == FormStatus.Saved || p.FormStatus == FormStatus.Approved)))
     {
         message.AddCustErrorMessage(MessageCode.Code1008, ResxManage.GetDescription <BillTermModel>(p => p.BillTermNo), billTerm.BillTermNo);
     }
 }
 public ReceiptInfoImportBANK(ApplicationDbContext dataAccess, SysMessageLog messageLog = null)
 {
     DataAccess = dataAccess;
     Message    = messageLog ?? new SysMessageLog(SystemOperator.SysOperator);
     Directory.CreateDirectory(SrcPath);
     Directory.CreateDirectory(SuccessPath);
     Directory.CreateDirectory(FailPath);
 }
Пример #13
0
 /// <summary>
 /// 檢查資料
 /// </summary>
 /// <param name="set"></param>
 public static void CheckData(BillSet set, SysMessageLog message, ApplicationDbContext dataAccess)
 {
     if (BizVirtualAccountCode.CheckBankCodeExist(dataAccess, set.Bill.VirtualAccountCode, out _))
     {
         message.AddCustErrorMessage(MessageCode.Code1008, ResxManage.GetDescription <BillModel>(p => p.VirtualAccountCode), set.Bill.VirtualAccountCode);
     }
     CalcTotalPayAmount(set);
     CheckPayEndDate(message, set.Bill);
     CheckCollectionTypeId(message, dataAccess, set.Bill);
 }
Пример #14
0
 /// <summary>
 /// 檢查繳款人編號是否重複
 /// </summary>
 /// <param name="dataAccess"></param>
 /// <param name="payer"></param>
 /// <returns></returns>
 private static void CheckPayerNoExist(SysMessageLog message, ApplicationDbContext dataAccess, PayerModel payer)
 {
     if (dataAccess.Set <PayerModel>().Any(p =>
                                           !p.InternalId.Equals(payer.InternalId) &&
                                           p.CustomerCode.Equals(payer.CustomerCode) &&
                                           p.PayerNo.Equals(payer.PayerNo) &&
                                           (p.FormStatus == FormStatus.Saved) || p.FormStatus == FormStatus.Approved))
     {
         message.AddCustErrorMessage(MessageCode.Code1008, ResxManage.GetDescription <PayerModel>(p => p.PayerNo), payer.PayerNo);
     }
 }
Пример #15
0
 /// <summary>
 /// 新增「繳款人」-初始資料
 /// </summary>
 /// <param name="db"></param>
 public static void CreatePayer(SysMessageLog Message, ApplicationDbContext dataAccess)
 {
     try
     {
         Message.Prefix             = "新增「繳款人」-初始資料:";
         using PayerRepository repo = new PayerRepository(dataAccess)
               {
                   User = SystemOperator.SysOperator, Message = Message
               };
         List <PayerSet> payers = new List <PayerSet>()
         {
             new PayerSet()
             {
                 Payer = new PayerModel()
                 {
                     CustomerCode = "992086", PayerId = "1", PayerName = "測試繳款人1", PayerType = PayerType.Normal, PayerNo = "8462"
                 }
             },
             new PayerSet()
             {
                 Payer = new PayerModel()
                 {
                     CustomerCode = "2143", PayerId = "1", PayerName = "測試繳款人2", PayerType = PayerType.Normal, PayerNo = "183729"
                 }
             },
             new PayerSet()
             {
                 Payer = new PayerModel()
                 {
                     CustomerCode = "805", PayerId = "1", PayerName = "測試繳款人3", PayerType = PayerType.Normal, PayerNo = "729183"
                 }
             },
             new PayerSet()
             {
                 Payer = new PayerModel()
                 {
                     CustomerCode = "993586", PayerId = "1", PayerName = "測試繳款人4", PayerType = PayerType.Normal, PayerNo = "76194"
                 }
             },
         };
         payers.ForEach(payer =>
         {
             if (null == repo.QueryData(new[] { payer.Payer.CustomerCode, payer.Payer.PayerId }))
             {
                 repo.Create(payer);
             }
         });
         repo.CommitData(FuncAction.Create);
     }
     finally
     {
         Message.Prefix = string.Empty;
     }
 }
        /// <summary>
        /// 資訊流-郵局
        /// </summary>
        public static List <ReceiptInfoBillPostModel> ReceiptInfoPostData(SysMessageLog Message)
        {
            List <ReceiptInfoBillPostModel> posts = new List <ReceiptInfoBillPostModel>()
            {
                new ReceiptInfoBillPostModel()
                {
                    Channel = "0587", Amount = "1331", CompareCode = "0009920868538462"
                },
                new ReceiptInfoBillPostModel()
                {
                    Channel = "0587", Amount = "2222", CompareCode = "0009935862576194"
                },
                new ReceiptInfoBillPostModel()
                {
                    Channel = "0587", Amount = "3313", CompareCode = "0080587749729183"
                },
                new ReceiptInfoBillPostModel()
                {
                    Channel = "0587", Amount = "4124", CompareCode = "2143751953183729"
                },
                new ReceiptInfoBillPostModel()
                {
                    Channel = "0587", Amount = "5565", CompareCode = "0000992086100001"
                },
                new ReceiptInfoBillPostModel()
                {
                    Channel = "0587", Amount = "6236", CompareCode = "0009935862576194"
                },
                new ReceiptInfoBillPostModel()
                {
                    Channel = "0587", Amount = "767", CompareCode = "2143751953183729"
                },
            };
            bool err = false;

            posts.ForEach(p => { if (p.Source != new ReceiptInfoBillPostModel()
                {
                    Source = p.Source
                }.Source)
                                 {
                                     err = true; return;
                                 }
                          });
            if (err)
            {
                Message.AddCustErrorMessage(MessageCode.Code0000, "資訊流-郵局Source拆分組合異常"); return(null);
            }
            string path = $@"D:\ibankRoot\Ftp_SKGPortalCore\TransactionListDaily\"; Directory.CreateDirectory(path);

            using StreamWriter sw = new StreamWriter($@"{path}SKG_POST.{DateTime.Now.ToString("yyyyMMdd")}", false, Encoding.GetEncoding(950));
            posts.ForEach(p => sw.WriteLine(p.Source));
            sw.Close();
            return(posts);
        }
Пример #17
0
        /// <summary>
        /// 資訊流-銀行
        /// </summary>
        public static List <ReceiptInfoBillBankModel> ReceiptInfoBankData(SysMessageLog Message)
        {
            List <ReceiptInfoBillBankModel> banks = new List <ReceiptInfoBillBankModel>()
            {
                new ReceiptInfoBillBankModel()
                {
                    CompareCode = "0009920868538462", PN = "+", Amount = "350", Channel = "00"
                },
                new ReceiptInfoBillBankModel()
                {
                    CompareCode = "0009920868538462", PN = "+", Amount = "370", Channel = "00"
                },
                new ReceiptInfoBillBankModel()
                {
                    CompareCode = "0009935862576194", PN = "+", Amount = "390", Channel = "00"
                },
                new ReceiptInfoBillBankModel()
                {
                    CompareCode = "0080587749729183", PN = "+", Amount = "410", Channel = "00"
                },
                new ReceiptInfoBillBankModel()
                {
                    CompareCode = "2143751953183729", PN = "+", Amount = "730", Channel = "00"
                },
                new ReceiptInfoBillBankModel()
                {
                    CompareCode = "0000992086100001", PN = "+", Amount = "430", Channel = "00"
                },
            };

            bool err = false;

            banks.ForEach(p => { if (p.Source != new ReceiptInfoBillBankModel()
                {
                    Source = p.Source
                }.Src)
                                 {
                                     err = true; return;
                                 }
                          });
            if (err)
            {
                Message.AddCustErrorMessage(MessageCode.Code0000, "資訊流-銀行Source拆分組合異常"); return(null);
            }
            string path = $@"D:\ibankRoot\Ftp_SKGPortalCore\TransactionListDaily\"; Directory.CreateDirectory(path);

            using StreamWriter sw = new StreamWriter($@"{path}SKG_BANK.{DateTime.Now.ToString("yyyyMMdd")}", false, Encoding.GetEncoding(950));
            banks.ForEach(p => sw.WriteLine(p.Source));
            sw.Close();
            return(banks);
        }
        /// <summary>
        /// 檢查是否有通路尚未填寫核銷規則
        /// </summary>
        /// <returns></returns>
        private static void CheckChannelVerifyPeriod(SysMessageLog message, CollectionTypeSet set)
        {
            Dictionary <string, string> detail = set.CollectionTypeDetail.Select(p => p.Channel).Distinct().ToDictionary(p => p.ChannelId, q => q.ChannelName);
            Dictionary <string, CollectionTypeVerifyPeriodModel> period = set.CollectionTypeVerifyPeriod.ToDictionary(p => p.ChannelId, q => q);
            List <string> detailExpectChannels = detail.Keys.Except(period.Keys).ToList();

            string[] notWriteChannels = detail?.Where(p => p.Key.In(detailExpectChannels.ToArray())).Select(p => p.Value).Distinct().ToArray();
            string   channelName      = LibData.Merge(",", false, notWriteChannels);

            if (!channelName.IsNullOrEmpty())
            {
                message.AddCustErrorMessage(MessageCode.Code1014, channelName);
            }
        }
        /// <summary>
        /// 檢查收款區間是否重疊
        /// </summary>
        /// <param name="detail"></param>
        /// <returns></returns>
        private static void CheckIsOverlap(SysMessageLog message, List <CollectionTypeDetailModel> detail)
        {
            List <CollectionTypeDetailModel> dt = detail.Where(p => detail.Where(q =>
                                                                                 q.RowState != RowState.Delete &&
                                                                                 p.RowId != q.RowId &&
                                                                                 p.ChannelId.Equals(q.ChannelId) &&
                                                                                 (p.SRange >= q.SRange && p.SRange <= q.ERange || p.ERange >= q.SRange && p.ERange <= q.ERange)
                                                                                 ).Any()).ToList();
            string channelName = LibData.Merge(",", false, dt?.Select(p => p.Channel.ChannelName).Distinct().ToArray());

            if (!channelName.IsNullOrEmpty())
            {
                message.AddCustErrorMessage(MessageCode.Code1013, channelName);
            }
        }
Пример #20
0
 /// <summary>
 /// 新增「角色權限」-初始資料
 /// </summary>
 /// <param name="dataAccess"></param>
 public static void CreateRole(SysMessageLog Message, ApplicationDbContext DataAccess)
 {
     try
     {
         Message.Prefix            = "新增「角色權限」-初始資料:";
         using RoleRepository repo = new RoleRepository(DataAccess)
               {
                   User = SystemOperator.SysOperator, Message = Message
               };;
         List <RoleSet> roles = new List <RoleSet>()
         {
             new RoleSet()
             {
                 Role = new RoleModel()
                 {
                     RoleId = "BackEndAdmin", RoleName = "後台管理員", EndType = EndType.Frontend, IsAdmin = true
                 },
                 RolePermission = new List <RolePermissionModel>()
                 {
                     new RolePermissionModel()
                     {
                         RoleId = "BackEndAdmin", FuncName = "Bill", FuncAction = (int)FuncAction.All
                     }
                 }
             },
             new RoleSet()
             {
                 Role = new RoleModel()
                 {
                     RoleId = "FrontEndAdmin", RoleName = "前台管理員", EndType = EndType.Backend, IsAdmin = true
                 }
             },
         };
         roles.ForEach(role =>
         {
             if (null == repo.QueryData(new object[] { role.Role.RoleId }))
             {
                 repo.Create(role);
             }
         });
         repo.CommitData(FuncAction.Create);
     }
     finally
     {
         Message.Prefix = string.Empty;
     }
 }
Пример #21
0
 /// <summary>
 /// 檢查介紹商企業代號是否有選擇
 /// </summary>
 /// <param name="set"></param>
 private static void CheckBizCustType(SysMessageLog message, BizCustomerSet set)
 {
     if (set.BizCustomerFeeDetail.Any(p => p.BankFeeType == BankFeeType.Hitrust_ClearFee_CurMonth || p.BankFeeType == BankFeeType.Hitrust_ClearFee_NextMonth))
     {
         if (set.BizCustomer.IntroCustomerCode.IsNullOrEmpty() || set.BizCustomer.IntroCustomer.BizCustType != BizCustType.Hitrust)
         {
             message.AddCustErrorMessage(MessageCode.Code1019, ResxManage.GetDescription(BizCustType.Hitrust));
         }
     }
     if (set.BizCustomerFeeDetail.Any(p => p.BankFeeType == BankFeeType.TotalFee && p.IntroPercent > 0m))
     {
         if (set.BizCustomer.IntroCustomerCode.IsNullOrEmpty() || set.BizCustomer.IntroCustomer.BizCustType != BizCustType.Introducer)
         {
             message.AddCustErrorMessage(MessageCode.Code1019, ResxManage.GetDescription(BizCustType.Introducer));
         }
     }
 }
Пример #22
0
        /// <summary>
        /// 檢查介紹商與Hitrust商是否衝突
        /// </summary>
        /// <param name="message"></param>
        /// <param name="detail"></param>
        private static void CheckIntroduceType(SysMessageLog message, List <BizCustomerFeeDetailModel> detail)
        {
            bool introducer = false, hitrust = false;

            detail.ForEach(p =>
            {
                if (p.BankFeeType == BankFeeType.TotalFee)
                {
                    introducer = true;
                }
                if (p.BankFeeType == BankFeeType.Hitrust_ClearFee_CurMonth || p.BankFeeType == BankFeeType.Hitrust_ClearFee_NextMonth)
                {
                    hitrust = true;
                }
            });
            if (introducer && hitrust)
            {
                message.AddCustErrorMessage(MessageCode.Code1018);
            }
        }
Пример #23
0
        private static void Customer(SysMessageLog Message, ApplicationDbContext DataAccess)
        {
            try
            {
                Message.Prefix = "新增「客戶」-初始資料:";
                using CustomerRepository repo = new CustomerRepository(DataAccess)
                      {
                          User = SystemOperator.SysOperator, Message = Message
                      };
                List <CustomerSet> custs = new List <CustomerSet>()
                {
                    new CustomerSet()
                    {
                        Customer = new CustomerModel()
                        {
                            CustomerId = "64487252", CustomerName = "單元測試用客戶", Address = "台北市", Tel = "02-23659193", Fax = "02-23659193", ZipCode = "740", ZipUnit = "294", ZipNum = "852"
                        }
                    },
                    new CustomerSet()
                    {
                        Customer = new CustomerModel()
                        {
                            CustomerId = "30262944", CustomerName = "新榮天然氣股份有限公司", Address = "台北市", Tel = "02-23659193", Fax = "02-23659193", ZipCode = "740", ZipUnit = "294", ZipNum = "852"
                        }
                    },
                    new CustomerSet()
                    {
                        Customer = new CustomerModel()
                        {
                            CustomerId = "00146877", CustomerName = "人壽保險", Address = "台中市", Tel = "05-88422913", Fax = "05-88422913", ZipCode = "310", ZipUnit = "848", ZipNum = "145"
                        }
                    },
                    new CustomerSet()
                    {
                        Customer = new CustomerModel()
                        {
                            CustomerId = "01031142", CustomerName = "台北市女子第一高級中學", Address = "台北市", Tel = "02-77428894", Fax = "02-77428894", ZipCode = "361", ZipUnit = "221", ZipNum = "543"
                        }
                    },
                    new CustomerSet()
                    {
                        Customer = new CustomerModel()
                        {
                            CustomerId = "00973171", CustomerName = "美喜劇場", Address = "桃園市", Tel = "03-12577633", Fax = "03-12341124", ZipCode = "056", ZipUnit = "357", ZipNum = "221"
                        }
                    },
                    new CustomerSet()
                    {
                        Customer = new CustomerModel()
                        {
                            CustomerId = "48297921", CustomerName = "中正管理委員會", Address = "台南市", Tel = "07-55712513", Fax = "07-55712513", ZipCode = "561", ZipUnit = "885", ZipNum = "631"
                        }
                    },
                    new CustomerSet()
                    {
                        Customer = new CustomerModel()
                        {
                            CustomerId = "48577921", CustomerName = "玉明科技", Address = "台南市", Tel = "07-55712513", Fax = "07-55712513", ZipCode = "561", ZipUnit = "885", ZipNum = "631"
                        }
                    },
                    new CustomerSet()
                    {
                        Customer = new CustomerModel()
                        {
                            CustomerId = "77494941", CustomerName = "Hitrust", Address = "台南市", Tel = "07-55712513", Fax = "07-55712513", ZipCode = "561", ZipUnit = "885", ZipNum = "631"
                        }
                    },
                };

                custs.ForEach(cust =>
                {
                    if (null == repo.QueryData(new[] { cust.Customer.CustomerId }))
                    {
                        repo.Create(cust);
                    }
                });
            }
            finally
            {
                Message.Prefix = string.Empty;
            }
        }
Пример #24
0
 /// <summary>
 /// 新增「商戶」-初始資料
 /// </summary>
 /// <param name="db"></param>
 public static void CreateCustomer(SysMessageLog Message, ApplicationDbContext DataAccess)
 {
     Customer(Message, DataAccess);
     BizCustomer(Message, DataAccess);
 }
Пример #25
0
        private static void BizCustomer(SysMessageLog Message, ApplicationDbContext DataAccess)
        {
            try
            {
                Message.Prefix = "新增「商戶」-初始資料:";
                using BizCustomerRepository repo = new BizCustomerRepository(DataAccess)
                      {
                          User = SystemOperator.SysOperator, Message = Message
                      };
                List <BizCustomerSet> custs = new List <BizCustomerSet>()
                {
                    new BizCustomerSet()
                    {
                        BizCustomer = new BizCustomerModel()
                        {
                            CustomerCode = "445235", CustomerId = "48577921", AccountDeptId = "0019", RealAccount = "7714815486840", VirtualAccountLen = VirtualAccountLen.Len13,
                            BillTermLen  = 2, PayerNoLen = 5, VirtualAccount1 = VirtualAccount1.BillTerm, VirtualAccount2 = VirtualAccount2.PayerNo, VirtualAccount3 = VirtualAccount3.NoverifyCode, BizCustType = BizCustType.Introducer,
                            ChannelIds   = "00,01,02,03,04,05,12,13,14", CollectionTypeIds = LibData.Merge(",", false, SystemCP.BankCollectionTypeId, SystemCP.PostCollectionTypeId, "6V1,6V2,6V3"), AccountStatus = AccountStatus.Enable, ImportBatchNo = "BeginData"
                        },
                        BizCustomerFeeDetail = new List <BizCustomerFeeDetailModel>()
                        {
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "445235", ChannelGroupType = ChannelGroupType.Bank, BankFeeType = BankFeeType.ClearFee_CurMonth, Fee = 15, IntroPercent = 0
                            },
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "445235", ChannelGroupType = ChannelGroupType.Market, BankFeeType = BankFeeType.ClearFee_CurMonth, Fee = 15, IntroPercent = 0
                            },
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "445235", ChannelGroupType = ChannelGroupType.Post, BankFeeType = BankFeeType.ClearFee_CurMonth, Fee = 15, IntroPercent = 0
                            },
                        }
                    },
                    new BizCustomerSet()
                    {
                        BizCustomer = new BizCustomerModel()
                        {
                            CustomerCode = "774336", CustomerId = "77494941", AccountDeptId = "0019", RealAccount = "7714815486840", VirtualAccountLen = VirtualAccountLen.Len13,
                            BillTermLen  = 2, PayerNoLen = 5, VirtualAccount1 = VirtualAccount1.BillTerm, VirtualAccount2 = VirtualAccount2.PayerNo, VirtualAccount3 = VirtualAccount3.NoverifyCode, BizCustType = BizCustType.Hitrust,
                            ChannelIds   = "00,01,02,03,04,05,12,13,14", CollectionTypeIds = LibData.Merge(",", false, SystemCP.BankCollectionTypeId, SystemCP.PostCollectionTypeId, "6V1,6V2,6V3"), AccountStatus = AccountStatus.Enable, ImportBatchNo = "BeginData"
                        },
                        BizCustomerFeeDetail = new List <BizCustomerFeeDetailModel>()
                        {
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "774336", ChannelGroupType = ChannelGroupType.Bank, BankFeeType = BankFeeType.ClearFee_CurMonth, Fee = 15, IntroPercent = 0
                            },
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "774336", ChannelGroupType = ChannelGroupType.Market, BankFeeType = BankFeeType.ClearFee_CurMonth, Fee = 15, IntroPercent = 0
                            },
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "774336", ChannelGroupType = ChannelGroupType.Post, BankFeeType = BankFeeType.ClearFee_CurMonth, Fee = 15, IntroPercent = 0
                            },
                        }
                    },
                    new BizCustomerSet()
                    {
                        BizCustomer = new BizCustomerModel()
                        {
                            CustomerCode = "992086", CustomerId = "30262944", AccountDeptId = "0019", RealAccount = "0514101002570", VirtualAccountLen = VirtualAccountLen.Len13,
                            BillTermLen  = 3, PayerNoLen = 4, VirtualAccount1 = VirtualAccount1.BillTerm, VirtualAccount2 = VirtualAccount2.PayerNo, VirtualAccount3 = VirtualAccount3.NoverifyCode,
                            ChannelIds   = "00,01,02,03,04,05,12,13,14", CollectionTypeIds = LibData.Merge(",", false, SystemCP.BankCollectionTypeId, SystemCP.PostCollectionTypeId, "6V1,6V2,6V3"), BizCustType = BizCustType.Cust, AccountStatus = AccountStatus.Enable, ImportBatchNo = "BeginData"
                        },
                        BizCustomerFeeDetail = new List <BizCustomerFeeDetailModel>()
                        {
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "992086", ChannelGroupType = ChannelGroupType.Bank, BankFeeType = BankFeeType.ClearFee_NextMonth, Fee = 15, IntroPercent = 0
                            },
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "992086", ChannelGroupType = ChannelGroupType.Market, BankFeeType = BankFeeType.ClearFee_NextMonth, Fee = 15, IntroPercent = 0
                            },
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "992086", ChannelGroupType = ChannelGroupType.Post, BankFeeType = BankFeeType.ClearFee_NextMonth, Fee = 15, IntroPercent = 0
                            },
                        }
                    },
                    new BizCustomerSet()
                    {
                        BizCustomer = new BizCustomerModel()
                        {
                            CustomerCode = "2143", CustomerId = "00146877", AccountDeptId = "0019", RealAccount = "0518425007840", VirtualAccountLen = VirtualAccountLen.Len16,
                            BillTermLen  = 6, PayerNoLen = 6, VirtualAccount1 = VirtualAccount1.BillTerm, VirtualAccount2 = VirtualAccount2.PayerNo, VirtualAccount3 = VirtualAccount3.NoverifyCode, IntroCustomerCode = "445235",
                            ChannelIds   = "00,01,02,03,04,05,12,13,14", CollectionTypeIds = LibData.Merge(",", false, SystemCP.BankCollectionTypeId, SystemCP.PostCollectionTypeId, "6V1,6V2,6V3"), BizCustType = BizCustType.Cust, AccountStatus = AccountStatus.Enable, ImportBatchNo = "BeginData"
                        },
                        BizCustomerFeeDetail = new List <BizCustomerFeeDetailModel>()
                        {
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "2143", ChannelGroupType = ChannelGroupType.Bank, BankFeeType = BankFeeType.TotalFee, Fee = 35, IntroPercent = 0
                            },
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "2143", ChannelGroupType = ChannelGroupType.Market, BankFeeType = BankFeeType.TotalFee, Fee = 35, IntroPercent = 0
                            },
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "2143", ChannelGroupType = ChannelGroupType.Post, BankFeeType = BankFeeType.TotalFee, Fee = 35, IntroPercent = 0
                            },
                        }
                    },
                    new BizCustomerSet()
                    {
                        BizCustomer = new BizCustomerModel()
                        {
                            CustomerCode      = "805", CustomerId = "01031142", AccountDeptId = "0019", RealAccount = "7714815486840", VirtualAccountLen = VirtualAccountLen.Len14,
                            BillTermLen       = 5, PayerNoLen = 6, VirtualAccount1 = VirtualAccount1.BillTerm, VirtualAccount2 = VirtualAccount2.PayerNo, VirtualAccount3 = VirtualAccount3.NoverifyCode, BizCustType = BizCustType.Cust,
                            IntroCustomerCode = "445235",
                            ChannelIds        = "00,01,02,03,04,05,12,13,14", CollectionTypeIds = LibData.Merge(",", false, SystemCP.BankCollectionTypeId, SystemCP.PostCollectionTypeId, "6V1,6V2,6V3"), AccountStatus = AccountStatus.Enable, ImportBatchNo = "BeginData"
                        },
                        BizCustomerFeeDetail = new List <BizCustomerFeeDetailModel>()
                        {
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "805", ChannelGroupType = ChannelGroupType.Bank, BankFeeType = BankFeeType.TotalFee, Fee = 28, IntroPercent = 50
                            },
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "805", ChannelGroupType = ChannelGroupType.Market, BankFeeType = BankFeeType.TotalFee, Fee = 28, IntroPercent = 50
                            },
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "805", ChannelGroupType = ChannelGroupType.Post, BankFeeType = BankFeeType.TotalFee, Fee = 28, IntroPercent = 50
                            },
                        }
                    },
                    new BizCustomerSet()
                    {
                        BizCustomer = new BizCustomerModel()
                        {
                            CustomerCode = "993586", CustomerId = "00973171", AccountDeptId = "0019", RealAccount = "7714815486840", VirtualAccountLen = VirtualAccountLen.Len13,
                            BillTermLen  = 2, PayerNoLen = 5, VirtualAccount1 = VirtualAccount1.BillTerm, VirtualAccount2 = VirtualAccount2.PayerNo, VirtualAccount3 = VirtualAccount3.NoverifyCode, BizCustType = BizCustType.Cust,
                            ChannelIds   = "00,01,02,03,04,05,12,13,14", CollectionTypeIds = LibData.Merge(",", false, SystemCP.BankCollectionTypeId, SystemCP.PostCollectionTypeId, "6V1,6V2,6V3"), AccountStatus = AccountStatus.Enable, ImportBatchNo = "BeginData"
                        },
                        BizCustomerFeeDetail = new List <BizCustomerFeeDetailModel>()
                        {
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "993586", ChannelGroupType = ChannelGroupType.Bank, BankFeeType = BankFeeType.ClearFee_CurMonth, Fee = 15, IntroPercent = 0
                            },
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "993586", ChannelGroupType = ChannelGroupType.Market, BankFeeType = BankFeeType.ClearFee_CurMonth, Fee = 15, IntroPercent = 0
                            },
                            new BizCustomerFeeDetailModel()
                            {
                                CustomerCode = "993586", ChannelGroupType = ChannelGroupType.Post, BankFeeType = BankFeeType.ClearFee_CurMonth, Fee = 15, IntroPercent = 0
                            },
                        }
                    },
                };

                custs.ForEach(cust =>
                {
                    if (null == repo.QueryData(new[] { cust.BizCustomer.CustomerCode }))
                    {
                        repo.Create(cust);
                    }
                });
                repo.CommitData(FuncAction.Create);
            }
            finally
            {
                Message.Prefix = string.Empty;
            }
        }
Пример #26
0
        /// <summary>
        /// 新增「帳單」-初始資料
        /// </summary>
        /// <param name="db"></param>
        public static void CreateBill(SysMessageLog Message, ApplicationDbContext DataAccess)
        {
            try
            {
                Message.Prefix             = "新增「帳單」-初始資料:";
                using IBillRepository repo = new BillRepository(DataAccess)
                      {
                          User = SystemOperator.SysOperator, Message = Message
                      };
                List <BillSet> bills = new List <BillSet>()
                {
                    new BillSet()
                    {
                        Bill = new BillModel()
                        {
                            BillTermId = "100", CustomerCode = "992086", PayerId = "1", ImportBatchNo = "BeginData", PayEndDate = DateTime.Now, CollectionTypeId = "6V1"
                        },
                        BillDetail = new List <BillDetailModel>()
                        {
                            new BillDetailModel()
                            {
                                FeeName = "停車費", PayAmount = 2000
                            }, new BillDetailModel()
                            {
                                FeeName = "管理費", PayAmount = 75
                            }
                        }
                    },
                    new BillSet()
                    {
                        Bill = new BillModel()
                        {
                            BillTermId = "101", CustomerCode = "2143", PayerId = "1", ImportBatchNo = "BeginData", PayEndDate = DateTime.Now, CollectionTypeId = "6V1"
                        },
                        BillDetail = new List <BillDetailModel>()
                        {
                            new BillDetailModel()
                            {
                                FeeName = "停車費", PayAmount = 2000
                            }, new BillDetailModel()
                            {
                                FeeName = "管理費", PayAmount = 75
                            }
                        }
                    },
                    new BillSet()
                    {
                        Bill = new BillModel()
                        {
                            BillTermId = "102", CustomerCode = "805", PayerId = "1", ImportBatchNo = "BeginData", PayEndDate = DateTime.Now, CollectionTypeId = "6V1"
                        },
                        BillDetail = new List <BillDetailModel>()
                        {
                            new BillDetailModel()
                            {
                                FeeName = "停車費", PayAmount = 2000
                            }, new BillDetailModel()
                            {
                                FeeName = "管理費", PayAmount = 75
                            }
                        }
                    },
                    new BillSet()
                    {
                        Bill = new BillModel()
                        {
                            BillTermId = "103", CustomerCode = "993586", PayerId = "1", ImportBatchNo = "BeginData", PayEndDate = DateTime.Now, CollectionTypeId = "6V1"
                        },
                        BillDetail = new List <BillDetailModel>()
                        {
                            new BillDetailModel()
                            {
                                FeeName = "停車費", PayAmount = 2000
                            }, new BillDetailModel()
                            {
                                FeeName = "管理費", PayAmount = 75
                            }
                        }
                    },
                };

                bills.ForEach(bill =>
                {
                    if (null == repo.QueryData(new[] { bill.Bill.BillNo }))
                    {
                        repo.Create(bill);
                    }
                });
                repo.CommitData(FuncAction.Create);
            }
            finally
            {
                Message.Prefix = string.Empty;
            }
        }
Пример #27
0
        /// <summary>
        /// 服務申請書
        /// </summary>
        public static void ACCFTTData(SysMessageLog Message)
        {
            List <ACCFTT> accftts = new List <ACCFTT>()
            {
                //每筆總手續費-有分潤
                new ACCFTT()
                {
                    KEYNO = "992091", ACCIDNO = "0620101011288", CUSTNAME = "每筆總手續費-有分潤", APPBECODE = "0620", BRCODE = "0620", IDCODE = "53272487", APPLYDATE = DateTime.Now.ToString("yyyyMMdd"), CHGDATE = "", APPLYSTAT = "0", CHKNUMFLAG = "Y", CHKAMTFLAG = "N", DUETERM = "0", CHANNEL = "9", FEE = "010", RSTORE1 = "0", RSTORE2 = "0", RSTORE3 = "0", RSTORE4 = "0", RECVITEM1 = "", RECVITEM2 = "", RECVITEM3 = "", RECVITEM4 = "", RECVITEM5 = "", ACTFEE = "00", MARTFEE1 = "00", MARTFEE2 = "00", MARTFEE3 = "00", POSTFLAG = "0", ACTFEEPT = "00", POSTFEE = "00", HIFLAG = "0", HIFARE = "000", NETDATE = "20190815", AUTOFLAG = "0", EBFLAG = "0", EBDATE = "00000000", EBFEEFLAG = "0", EBFEE = "0", EBACTTYPE = "2", CHKDUPPAY = "0", CUSTID = "1234567", FUNC = "0", MAFARE = "0", NOFARE = "0", CTBCFLAG = "0", SHAREBNFTFLG = "1", SHAREBEFTPERCENT = "20", ACTFEEBEFT = "50", ACTFEEMART = "15", SHAREACTFLG = "1", ACTPERCENT = "50", CLEARFEEMART1 = "0", CLEARFEEMART2 = "0", CLEARFEEMART3 = "0", CLEARFEEMART4 = "0", CLEARFEEMART5 = "0", PAYKINDPOST = "0", ACTFEEPOST = "15", SHAREPOSTFLG = "1", POSTPERCENT = "50", AGRIFLAG = "1", AGRIFEE = "25", FILLER = ""
                },
                new ACCFTT()
                {
                    KEYNO = "992099", ACCIDNO = "0204101004373", CUSTNAME = "每筆總手續費-有分潤", APPBECODE = "0204", BRCODE = "0204", IDCODE = "76336687", APPLYDATE = DateTime.Now.ToString("yyyyMMdd"), CHGDATE = DateTime.Now.ToString("yyyyMMdd"), APPLYSTAT = "0", CHKNUMFLAG = "Y", CHKAMTFLAG = "N", DUETERM = "0", CHANNEL = "9", FEE = "010", RSTORE1 = "1", RSTORE2 = "1", RSTORE3 = "1", RSTORE4 = "1", RECVITEM1 = "6V6", RECVITEM2 = "6V7", RECVITEM3 = "6RN", RECVITEM4 = "", RECVITEM5 = "", ACTFEE = "10", MARTFEE1 = "00", MARTFEE2 = "00", MARTFEE3 = "00", POSTFLAG = "1", ACTFEEPT = "10", POSTFEE = "00", HIFLAG = "0", HIFARE = "000", NETDATE = "20190829", AUTOFLAG = "1", EBFLAG = "0", EBDATE = "00000000", EBFEEFLAG = "0", EBFEE = "0", EBACTTYPE = "2", CHKDUPPAY = "0", CUSTID = "1234567", FUNC = "0", MAFARE = "0", NOFARE = "0", CTBCFLAG = "0", SHAREBNFTFLG = "1", SHAREBEFTPERCENT = "20", ACTFEEBEFT = "50", ACTFEEMART = "15", SHAREACTFLG = "1", ACTPERCENT = "50", CLEARFEEMART1 = "0", CLEARFEEMART2 = "0", CLEARFEEMART3 = "0", CLEARFEEMART4 = "0", CLEARFEEMART5 = "0", PAYKINDPOST = "0", ACTFEEPOST = "15", SHAREPOSTFLG = "1", POSTPERCENT = "50", AGRIFLAG = "1", AGRIFEE = "25", FILLER = ""
                },
                new ACCFTT()
                {
                    KEYNO = "992079", ACCIDNO = "0833100024118", CUSTNAME = "每筆總手續費-有分潤", APPBECODE = "0921", BRCODE = "0921", IDCODE = "53976248", APPLYDATE = DateTime.Now.ToString("yyyyMMdd"), CHGDATE = "", APPLYSTAT = "0", CHKNUMFLAG = "Y", CHKAMTFLAG = "N", DUETERM = "0", CHANNEL = "9", FEE = "010", RSTORE1 = "1", RSTORE2 = "1", RSTORE3 = "1", RSTORE4 = "1", RECVITEM1 = "6V1", RECVITEM2 = "6V2", RECVITEM3 = "6RM", RECVITEM4 = "", RECVITEM5 = "", ACTFEE = "10", MARTFEE1 = "00", MARTFEE2 = "00", MARTFEE3 = "00", POSTFLAG = "1", ACTFEEPT = "10", POSTFEE = "00", HIFLAG = "0", HIFARE = "000", NETDATE = "20190819", AUTOFLAG = "0", EBFLAG = "0", EBDATE = "00000000", EBFEEFLAG = "0", EBFEE = "0", EBACTTYPE = "2", CHKDUPPAY = "0", CUSTID = "1234567", FUNC = "0", MAFARE = "0", NOFARE = "0", CTBCFLAG = "0", SHAREBNFTFLG = "1", SHAREBEFTPERCENT = "20", ACTFEEBEFT = "50", ACTFEEMART = "15", SHAREACTFLG = "1", ACTPERCENT = "50", CLEARFEEMART1 = "0", CLEARFEEMART2 = "0", CLEARFEEMART3 = "0", CLEARFEEMART4 = "0", CLEARFEEMART5 = "0", PAYKINDPOST = "0", ACTFEEPOST = "15", SHAREPOSTFLG = "1", POSTPERCENT = "50", AGRIFLAG = "1", AGRIFEE = "25", FILLER = ""
                },
                new ACCFTT()
                {
                    KEYNO = "992080", ACCIDNO = "0833100331983", CUSTNAME = "每筆總手續費-有分潤", APPBECODE = "0921", BRCODE = "0921", IDCODE = "05379410", APPLYDATE = DateTime.Now.ToString("yyyyMMdd"), CHGDATE = "", APPLYSTAT = "0", CHKNUMFLAG = "Y", CHKAMTFLAG = "N", DUETERM = "0", CHANNEL = "9", FEE = "010", RSTORE1 = "1", RSTORE2 = "1", RSTORE3 = "1", RSTORE4 = "1", RECVITEM1 = "6V1", RECVITEM2 = "6V2", RECVITEM3 = "6RM", RECVITEM4 = "", RECVITEM5 = "", ACTFEE = "10", MARTFEE1 = "00", MARTFEE2 = "00", MARTFEE3 = "00", POSTFLAG = "1", ACTFEEPT = "10", POSTFEE = "00", HIFLAG = "0", HIFARE = "000", NETDATE = "20190819", AUTOFLAG = "0", EBFLAG = "0", EBDATE = "00000000", EBFEEFLAG = "0", EBFEE = "0", EBACTTYPE = "2", CHKDUPPAY = "0", CUSTID = "1234567", FUNC = "0", MAFARE = "0", NOFARE = "0", CTBCFLAG = "0", SHAREBNFTFLG = "1", SHAREBEFTPERCENT = "20", ACTFEEBEFT = "50", ACTFEEMART = "15", SHAREACTFLG = "1", ACTPERCENT = "50", CLEARFEEMART1 = "0", CLEARFEEMART2 = "0", CLEARFEEMART3 = "0", CLEARFEEMART4 = "0", CLEARFEEMART5 = "0", PAYKINDPOST = "0", ACTFEEPOST = "15", SHAREPOSTFLG = "1", POSTPERCENT = "50", AGRIFLAG = "1", AGRIFEE = "25", FILLER = ""
                },
                new ACCFTT()
                {
                    KEYNO = "992076", ACCIDNO = "0310101006026", CUSTNAME = "每筆總手續費-有分潤", APPBECODE = "0310", BRCODE = "0310", IDCODE = "31723190", APPLYDATE = DateTime.Now.ToString("yyyyMMdd"), CHGDATE = "", APPLYSTAT = "0", CHKNUMFLAG = "Y", CHKAMTFLAG = "N", DUETERM = "0", CHANNEL = "9", FEE = "010", RSTORE1 = "1", RSTORE2 = "1", RSTORE3 = "1", RSTORE4 = "1", RECVITEM1 = "6V6", RECVITEM2 = "6V7", RECVITEM3 = "6RN", RECVITEM4 = "", RECVITEM5 = "", ACTFEE = "10", MARTFEE1 = "00", MARTFEE2 = "00", MARTFEE3 = "00", POSTFLAG = "0", ACTFEEPT = "00", POSTFEE = "00", HIFLAG = "0", HIFARE = "000", NETDATE = "20190902", AUTOFLAG = "0", EBFLAG = "0", EBDATE = "00000000", EBFEEFLAG = "0", EBFEE = "0", EBACTTYPE = "2", CHKDUPPAY = "0", CUSTID = "1234567", FUNC = "0", MAFARE = "0", NOFARE = "0", CTBCFLAG = "0", SHAREBNFTFLG = "1", SHAREBEFTPERCENT = "20", ACTFEEBEFT = "50", ACTFEEMART = "15", SHAREACTFLG = "1", ACTPERCENT = "50", CLEARFEEMART1 = "0", CLEARFEEMART2 = "0", CLEARFEEMART3 = "0", CLEARFEEMART4 = "0", CLEARFEEMART5 = "0", PAYKINDPOST = "0", ACTFEEPOST = "15", SHAREPOSTFLG = "1", POSTPERCENT = "50", AGRIFLAG = "1", AGRIFEE = "25", FILLER = ""
                },
                new ACCFTT()
                {
                    KEYNO = "992074", ACCIDNO = "0417101007830", CUSTNAME = "每筆總手續費-有分潤", APPBECODE = "1049", BRCODE = "1049", IDCODE = "99590035", APPLYDATE = DateTime.Now.ToString("yyyyMMdd"), CHGDATE = DateTime.Now.ToString("yyyyMMdd"), APPLYSTAT = "0", CHKNUMFLAG = "Y", CHKAMTFLAG = "N", DUETERM = "0", CHANNEL = "9", FEE = "010", RSTORE1 = "1", RSTORE2 = "1", RSTORE3 = "1", RSTORE4 = "1", RECVITEM1 = "6V6", RECVITEM2 = "6V7", RECVITEM3 = "", RECVITEM4 = "", RECVITEM5 = "", ACTFEE = "00", MARTFEE1 = "00", MARTFEE2 = "00", MARTFEE3 = "00", POSTFLAG = "0", ACTFEEPT = "00", POSTFEE = "00", HIFLAG = "0", HIFARE = "000", NETDATE = "20190627", AUTOFLAG = "0", EBFLAG = "0", EBDATE = "00000000", EBFEEFLAG = "0", EBFEE = "0", EBACTTYPE = "2", CHKDUPPAY = "0", CUSTID = "1234567", FUNC = "0", MAFARE = "0", NOFARE = "0", CTBCFLAG = "0", SHAREBNFTFLG = "1", SHAREBEFTPERCENT = "20", ACTFEEBEFT = "50", ACTFEEMART = "15", SHAREACTFLG = "1", ACTPERCENT = "50", CLEARFEEMART1 = "0", CLEARFEEMART2 = "0", CLEARFEEMART3 = "0", CLEARFEEMART4 = "0", CLEARFEEMART5 = "0", PAYKINDPOST = "0", ACTFEEPOST = "15", SHAREPOSTFLG = "1", POSTPERCENT = "50", AGRIFLAG = "1", AGRIFEE = "25", FILLER = ""
                },
                new ACCFTT()
                {
                    KEYNO = "992108", ACCIDNO = "0435101082576", CUSTNAME = "每筆總手續費-有分潤", APPBECODE = "0435", BRCODE = "0435", IDCODE = "72452571", APPLYDATE = DateTime.Now.ToString("yyyyMMdd"), CHGDATE = "", APPLYSTAT = "0", CHKNUMFLAG = "Y", CHKAMTFLAG = "N", DUETERM = "0", CHANNEL = "9", FEE = "010", RSTORE1 = "1", RSTORE2 = "1", RSTORE3 = "1", RSTORE4 = "1", RECVITEM1 = "6V1", RECVITEM2 = "6V2", RECVITEM3 = "6RM", RECVITEM4 = "", RECVITEM5 = "", ACTFEE = "10", MARTFEE1 = "00", MARTFEE2 = "00", MARTFEE3 = "00", POSTFLAG = "0", ACTFEEPT = "00", POSTFEE = "00", HIFLAG = "0", HIFARE = "000", NETDATE = "20190917", AUTOFLAG = "0", EBFLAG = "0", EBDATE = "00000000", EBFEEFLAG = "0", EBFEE = "0", EBACTTYPE = "2", CHKDUPPAY = "0", CUSTID = "1234567", FUNC = "0", MAFARE = "0", NOFARE = "0", CTBCFLAG = "0", SHAREBNFTFLG = "1", SHAREBEFTPERCENT = "20", ACTFEEBEFT = "50", ACTFEEMART = "15", SHAREACTFLG = "1", ACTPERCENT = "50", CLEARFEEMART1 = "0", CLEARFEEMART2 = "0", CLEARFEEMART3 = "0", CLEARFEEMART4 = "0", CLEARFEEMART5 = "0", PAYKINDPOST = "0", ACTFEEPOST = "15", SHAREPOSTFLG = "1", POSTPERCENT = "50", AGRIFLAG = "1", AGRIFEE = "25", FILLER = ""
                },
                new ACCFTT()
                {
                    KEYNO = "990128", ACCIDNO = "0462101005054", CUSTNAME = "每筆總手續費-有分潤", APPBECODE = "0462", BRCODE = "0462", IDCODE = "31753898", APPLYDATE = DateTime.Now.ToString("yyyyMMdd"), CHGDATE = "", APPLYSTAT = "0", CHKNUMFLAG = "Y", CHKAMTFLAG = "N", DUETERM = "0", CHANNEL = "9", FEE = "010", RSTORE1 = "1", RSTORE2 = "1", RSTORE3 = "1", RSTORE4 = "1", RECVITEM1 = "6V1", RECVITEM2 = "6V2", RECVITEM3 = "", RECVITEM4 = "", RECVITEM5 = "", ACTFEE = "00", MARTFEE1 = "00", MARTFEE2 = "00", MARTFEE3 = "00", POSTFLAG = "0", ACTFEEPT = "00", POSTFEE = "00", HIFLAG = "0", HIFARE = "000", NETDATE = "20190919", AUTOFLAG = "0", EBFLAG = "0", EBDATE = "00000000", EBFEEFLAG = "0", EBFEE = "0", EBACTTYPE = "2", CHKDUPPAY = "0", CUSTID = "1234567", FUNC = "0", MAFARE = "0", NOFARE = "0", CTBCFLAG = "0", SHAREBNFTFLG = "1", SHAREBEFTPERCENT = "20", ACTFEEBEFT = "50", ACTFEEMART = "15", SHAREACTFLG = "1", ACTPERCENT = "50", CLEARFEEMART1 = "0", CLEARFEEMART2 = "0", CLEARFEEMART3 = "0", CLEARFEEMART4 = "0", CLEARFEEMART5 = "0", PAYKINDPOST = "0", ACTFEEPOST = "15", SHAREPOSTFLG = "1", POSTPERCENT = "50", AGRIFLAG = "1", AGRIFEE = "25", FILLER = ""
                },
                new ACCFTT()
                {
                    KEYNO = "102400", ACCIDNO = "1058108889999", CUSTNAME = "每筆總手續費-有分潤", APPBECODE = "1058", BRCODE = "1058", IDCODE = "85283063", APPLYDATE = DateTime.Now.ToString("yyyyMMdd"), CHGDATE = "", APPLYSTAT = "0", CHKNUMFLAG = "Y", CHKAMTFLAG = "N", DUETERM = "0", CHANNEL = "9", FEE = "010", RSTORE1 = "1", RSTORE2 = "1", RSTORE3 = "1", RSTORE4 = "1", RECVITEM1 = "6V1", RECVITEM2 = "6V2", RECVITEM3 = "6RM", RECVITEM4 = "", RECVITEM5 = "", ACTFEE = "10", MARTFEE1 = "00", MARTFEE2 = "00", MARTFEE3 = "00", POSTFLAG = "1", ACTFEEPT = "10", POSTFEE = "00", HIFLAG = "0", HIFARE = "000", NETDATE = "20190927", AUTOFLAG = "0", EBFLAG = "0", EBDATE = "00000000", EBFEEFLAG = "0", EBFEE = "0", EBACTTYPE = "2", CHKDUPPAY = "0", CUSTID = "1234567", FUNC = "0", MAFARE = "0", NOFARE = "0", CTBCFLAG = "0", SHAREBNFTFLG = "1", SHAREBEFTPERCENT = "20", ACTFEEBEFT = "50", ACTFEEMART = "15", SHAREACTFLG = "1", ACTPERCENT = "50", CLEARFEEMART1 = "0", CLEARFEEMART2 = "0", CLEARFEEMART3 = "0", CLEARFEEMART4 = "0", CLEARFEEMART5 = "0", PAYKINDPOST = "0", ACTFEEPOST = "15", SHAREPOSTFLG = "1", POSTPERCENT = "50", AGRIFLAG = "1", AGRIFEE = "25", FILLER = ""
                },
                new ACCFTT()
                {
                    KEYNO = "912000", ACCIDNO = "1058108889999", CUSTNAME = "每筆總手續費-有分潤", APPBECODE = "1058", BRCODE = "1058", IDCODE = "85283063", APPLYDATE = DateTime.Now.ToString("yyyyMMdd"), CHGDATE = "", APPLYSTAT = "0", CHKNUMFLAG = "Y", CHKAMTFLAG = "N", DUETERM = "0", CHANNEL = "9", FEE = "010", RSTORE1 = "1", RSTORE2 = "1", RSTORE3 = "1", RSTORE4 = "1", RECVITEM1 = "6V1", RECVITEM2 = "6V2", RECVITEM3 = "6RM", RECVITEM4 = "", RECVITEM5 = "", ACTFEE = "10", MARTFEE1 = "00", MARTFEE2 = "00", MARTFEE3 = "00", POSTFLAG = "1", ACTFEEPT = "10", POSTFEE = "00", HIFLAG = "0", HIFARE = "000", NETDATE = "20190927", AUTOFLAG = "0", EBFLAG = "0", EBDATE = "00000000", EBFEEFLAG = "0", EBFEE = "0", EBACTTYPE = "2", CHKDUPPAY = "0", CUSTID = "1234567", FUNC = "0", MAFARE = "0", NOFARE = "0", CTBCFLAG = "0", SHAREBNFTFLG = "1", SHAREBEFTPERCENT = "20", ACTFEEBEFT = "50", ACTFEEMART = "15", SHAREACTFLG = "1", ACTPERCENT = "50", CLEARFEEMART1 = "0", CLEARFEEMART2 = "0", CLEARFEEMART3 = "0", CLEARFEEMART4 = "0", CLEARFEEMART5 = "0", PAYKINDPOST = "0", ACTFEEPOST = "15", SHAREPOSTFLG = "1", POSTPERCENT = "50", AGRIFLAG = "1", AGRIFEE = "25", FILLER = ""
                },
                new ACCFTT()
                {
                    KEYNO = "992106", ACCIDNO = "1058108889999", CUSTNAME = "每筆總手續費-有分潤", APPBECODE = "1058", BRCODE = "1058", IDCODE = "85283063", APPLYDATE = DateTime.Now.ToString("yyyyMMdd"), CHGDATE = "", APPLYSTAT = "0", CHKNUMFLAG = "Y", CHKAMTFLAG = "N", DUETERM = "0", CHANNEL = "9", FEE = "010", RSTORE1 = "1", RSTORE2 = "1", RSTORE3 = "1", RSTORE4 = "1", RECVITEM1 = "6V1", RECVITEM2 = "6V2", RECVITEM3 = "6RM", RECVITEM4 = "", RECVITEM5 = "", ACTFEE = "10", MARTFEE1 = "00", MARTFEE2 = "00", MARTFEE3 = "00", POSTFLAG = "1", ACTFEEPT = "10", POSTFEE = "00", HIFLAG = "0", HIFARE = "000", NETDATE = "20190927", AUTOFLAG = "0", EBFLAG = "0", EBDATE = "00000000", EBFEEFLAG = "0", EBFEE = "0", EBACTTYPE = "2", CHKDUPPAY = "0", CUSTID = "1234567", FUNC = "0", MAFARE = "0", NOFARE = "0", CTBCFLAG = "0", SHAREBNFTFLG = "1", SHAREBEFTPERCENT = "20", ACTFEEBEFT = "50", ACTFEEMART = "15", SHAREACTFLG = "1", ACTPERCENT = "50", CLEARFEEMART1 = "0", CLEARFEEMART2 = "0", CLEARFEEMART3 = "0", CLEARFEEMART4 = "0", CLEARFEEMART5 = "0", PAYKINDPOST = "0", ACTFEEPOST = "15", SHAREPOSTFLG = "1", POSTPERCENT = "50", AGRIFLAG = "1", AGRIFEE = "25", FILLER = ""
                },
            };
            bool err = false;

            accftts.ForEach(p => { if (p.Source != new ACCFTT()
                {
                    Source = p.Source
                }.Source)
                                   {
                                       err = true; return;
                                   }
                            });
            if (err)
            {
                Message.AddCustErrorMessage(MessageCode.Code0000, "服務申請書Source拆分組合異常"); return;
            }
            string path = $@"D:\ibankRoot\Ftp_SKGPortalCore\ACCFTT\"; Directory.CreateDirectory(path);

            using StreamWriter sw = new StreamWriter($@"{path}ACCFTT.{ DateTime.Now.ToString("yyyyMMdd")}", false, Encoding.GetEncoding(950));
            accftts.ForEach(p => sw.WriteLine(p.Source));
            sw.Close();
        }
Пример #28
0
        /// <summary>
        /// 資訊流-超商
        /// </summary>
        public static List <dynamic> ReceiptInfoMarketData(SysMessageLog Message)
        {
            List <dynamic> marts = new List <dynamic>();

            marts.AddRange(new List <ReceiptInfoBillMarketModel>()
            {
                new ReceiptInfoBillMarketModel()
                {
                    CollectionType = "6V1", Channel = "7111111", Barcode2 = "0009920868538462", Barcode3 = "125"
                },
                new ReceiptInfoBillMarketModel()
                {
                    CollectionType = "6V1", Channel = "TFM", Barcode2 = "0009935862576194", Barcode3 = "2130"
                },
                new ReceiptInfoBillMarketModel()
                {
                    CollectionType = "6V1", Channel = "OKM", Barcode2 = "0080587749729183", Barcode3 = "255"
                },
                new ReceiptInfoBillMarketModel()
                {
                    CollectionType = "6V1", Channel = "HILIFE", Barcode2 = "2143751953183729", Barcode3 = "320"
                },
                new ReceiptInfoBillMarketModel()
                {
                    CollectionType = "6V1", Channel = "AGRI", Barcode2 = "0009920868538462", Barcode3 = "351"
                },
                new ReceiptInfoBillMarketModel()
                {
                    CollectionType = "6V1", Channel = "GT", Barcode2 = "0009935862576194", Barcode3 = "405"
                },
                new ReceiptInfoBillMarketModel()
                {
                    CollectionType = "62N", Channel = "OKM", Barcode2 = "0000992086100001", Barcode3 = "457"
                },
            });

            marts.AddRange(new List <ReceiptInfoBillMarketSPIModel>()
            {
                new ReceiptInfoBillMarketSPIModel()
                {
                    Channel = "7111111", Barcode2 = "0009920868538462", Barcode3_Amount = "15"
                },
                new ReceiptInfoBillMarketSPIModel()
                {
                    Channel = "TFM", Barcode2 = "0009935862576194", Barcode3_Amount = "20"
                },
                new ReceiptInfoBillMarketSPIModel()
                {
                    Channel = "OKM", Barcode2 = "0080587749729183", Barcode3_Amount = "25"
                },
                new ReceiptInfoBillMarketSPIModel()
                {
                    Channel = "HILIFE", Barcode2 = "2143751953183729", Barcode3_Amount = "30"
                },
                new ReceiptInfoBillMarketSPIModel()
                {
                    Channel = "AGRI", Barcode2 = "0009920868538462", Barcode3_Amount = "35"
                },
                new ReceiptInfoBillMarketSPIModel()
                {
                    Channel = "GT", Barcode2 = "0009935862576194", Barcode3_Amount = "40"
                },
                new ReceiptInfoBillMarketSPIModel()
                {
                    Channel = "SIM", Barcode2 = "0000992086100001", Barcode3_Amount = "45"
                },
            });

            bool err = false;

            marts.ForEach(p =>
            {
                if (p is ReceiptInfoBillMarketModel)
                {
                    if (p.Source != new ReceiptInfoBillMarketModel()
                    {
                        Source = p.Source
                    }.Source)
                    {
                        err = true; return;
                    }
                }
                else
                {
                    if (p.Source != new ReceiptInfoBillMarketSPIModel()
                    {
                        Source = p.Source
                    }.Source)
                    {
                        err = true; return;
                    }
                }
            });
            if (err)
            {
                Message.AddCustErrorMessage(MessageCode.Code0000, "資訊流-超商Source拆分組合異常"); return(null);
            }
            string path = $@"D:\ibankRoot\Ftp_SKGPortalCore\TransactionListDaily\"; Directory.CreateDirectory(path);

            using StreamWriter sw = new StreamWriter($@"{path}SKG_MART.{DateTime.Now.ToString("yyyyMMdd")}", false, Encoding.GetEncoding(950));
            marts.ForEach(p => sw.WriteLine(p.Source));
            sw.Close();
            return(marts);
        }
Пример #29
0
        public static void CreateDept(SysMessageLog Message, ApplicationDbContext DataAccess)
        {
            try
            {
                Message.Prefix            = "新增「部門」-初始資料:";
                using DeptRepository repo = new DeptRepository(DataAccess)
                      {
                          User = SystemOperator.SysOperator, Message = Message
                      };
                List <DeptSet> depts = new List <DeptSet>()
                {
                    new DeptSet()
                    {
                        Dept = new DeptModel()
                        {
                            DeptId = "0019", DeptName = "中正分行", IsBranch = true
                        }
                    },
                    new DeptSet()
                    {
                        Dept = new DeptModel()
                        {
                            DeptId = "0028", DeptName = "東台北分行", IsBranch = true
                        }
                    },
                    new DeptSet()
                    {
                        Dept = new DeptModel()
                        {
                            DeptId = "0037", DeptName = "龍山分行", IsBranch = true
                        }
                    },
                    new DeptSet()
                    {
                        Dept = new DeptModel()
                        {
                            DeptId = "0046", DeptName = "西園分行", IsBranch = true
                        }
                    },
                    new DeptSet()
                    {
                        Dept = new DeptModel()
                        {
                            DeptId = "0055", DeptName = "西門分行", IsBranch = true
                        }
                    },
                };

                depts.ForEach(dept =>
                {
                    if (null == repo.QueryData(new[] { dept.Dept.DeptId }))
                    {
                        repo.Create(dept);
                    }
                });
                repo.CommitData(FuncAction.Create);
            }
            finally
            {
                Message.Prefix = string.Empty;
            }
        }
 /// <summary>
 /// 檢查資料
 /// </summary>
 /// <param name="set"></param>
 /// <param name="message"></param>
 public static void CheckData(CollectionTypeSet set, SysMessageLog message)
 {
     CheckIsOverlap(message, set.CollectionTypeDetail);
     CheckChannelVerifyPeriod(message, set);
 }