1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
/**  
* PrintAwbOrder.aspx.cs
*
* 功 能: 打印送货单
* 类 名: PrintAwbOrder
*
* Ver    变更日期             负责人  变更内容
* ───────────────────────────────────
* V0.01  2013-5-17 17:54      吴崎均    初版
*
*
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL.EC;
using CY.BLL;
using CY.Model;
using CY.Infrastructure.Common;
using System.Text;
using CY.BLL.Sys;
using System.Transactions;
using CY.Model.Inquiry;
 
namespace CY.WebForm.Pages.business
{
    /// <summary>
    /// 打印送货单
    /// </summary>
    public partial class PrintAwbOrder : BasePage
    {
        EC_OrderBasicBLL _eC_OrderBasicBLL = null;
        OA_CorporateClientsBLL _oA_CorporateClientsBLL = null;
        EC_MemberBasicBLL _eC_MemberBasicBLL = null;
        OA_StaffBLL oA_StaffBLL = null;
        OA_DeliverPlanBLL _OA_DeliverPlanBLL = null;
        OA_DeliverPlanBLL oA_DeliverPlanBLL = null;
        EC_OrderPrintParameterBLL eC_OrderPrintParameterBLL = null;
        Sys_DictionaryBLL dictionaryBLL = null;
        /// <summary>
        /// 初始化构造
        /// </summary>
        public PrintAwbOrder()
        {
            _eC_OrderBasicBLL = new EC_OrderBasicBLL();
            _oA_CorporateClientsBLL = new OA_CorporateClientsBLL();
            _eC_MemberBasicBLL = new EC_MemberBasicBLL();
            oA_StaffBLL = new OA_StaffBLL();
            _OA_DeliverPlanBLL = new  OA_DeliverPlanBLL();
            oA_DeliverPlanBLL = new OA_DeliverPlanBLL();
            eC_OrderPrintParameterBLL = new EC_OrderPrintParameterBLL();
            dictionaryBLL = new Sys_DictionaryBLL();
        }
 
        /// <summary>
        /// 界面加载事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            int  shifouDelivery = MyConvert.ConvertToInt(Request["shifouDelivery"]).Value;
            int orderId = Request["orderId"].ToString().ToInt32().Value;
           
 
 
            Guid buyerid = MyConvert.ConvertToGuid(Request["buyerid"]);
 
            var DeliveryTime = MyConvert.ConvertToDateTime( Request["DeliveryTime"]);
 
            if (string.IsNullOrEmpty(Request["ids"]) || Guid.Empty.Equals(buyerid))
            {
                Response.Clear();
                Response.Write("<script>alert('传入参数错误!');</script>");
                Response.End(); return;
            }
            else ;
 
            string buyerNmae = string.Empty;
            string buyerPhone = string.Empty;
            string address = string.Empty;
            string prepayments = "0.00";
            string Remark = "";
 
            List<EC_AcceptWayByOrder> eC_AcceptWayByOrders = null;
            OA_CorporateClients oA_CorporateClients = null;
            OA_CustomerCommunications oA_CustomerCommunications = null;
            EC_MemberExtend eC_MemberExtend = null;
            OA_CorporateClients oA_CorporateClientsBiddingcompany = null;
 
            try
            {
 
 
                eC_AcceptWayByOrders = _eC_OrderBasicBLL.SelectOrderAddress(Request["ids"].Trim()) as List<EC_AcceptWayByOrder>;
                oA_CorporateClients = _oA_CorporateClientsBLL.SelectModelByFirmIdandMemberId(CurrentUser.MemberId, buyerid);
                this.spnBuyerName.InnerText = oA_CorporateClients.CompanyName;
                oA_CorporateClientsBiddingcompany = _oA_CorporateClientsBLL.SelectBiddingcompanyByFirmId(CurrentUser.MemberId).Where(x=>x.Keyid1 == oA_CorporateClients.Biddingcompany).FirstOrDefault();
                if (oA_CorporateClientsBiddingcompany != null)
                {
                    this.spnD.InnerText = oA_CorporateClientsBiddingcompany.CompanyName;
                }
                OA_Staff oA_Staff =  oA_StaffBLL.GetModelByKeyid(oA_CorporateClients.BusinessManagerId);
                if (oA_Staff != null)
                {
                    this.spnB.InnerText = oA_Staff.Name;
                }
                this.spnC.InnerText = CurrentUser.TrueName;
 
 
                if (null == oA_CorporateClients)
                {
                    EC_MemberExtend buyerMemberExtend = _eC_MemberBasicBLL.GetMemberExtendByMemberId(buyerid);
                    buyerNmae = buyerMemberExtend.Name;
                    buyerPhone = buyerMemberExtend.PhoneNum;
                    address = buyerMemberExtend.DetailedAddress;
                }
                else
                {
                    oA_CustomerCommunications = _oA_CorporateClientsBLL.GetModel_CustomerCommunications(oA_CorporateClients.Keyid);
                    buyerNmae = oA_CorporateClients.CompanyName;
                    buyerPhone = oA_CustomerCommunications.CompanyPhone;
                    address = oA_CustomerCommunications.DetailedAddress;
                    prepayments = (oA_CorporateClients.Prepayments.HasValue ? oA_CorporateClients.Prepayments.Value : 0).ToString("F2");
                }
                buyerNmae = string.IsNullOrEmpty(buyerNmae) ? string.Empty : buyerNmae;
                buyerPhone = string.IsNullOrEmpty(buyerPhone) ? string.Empty : buyerPhone;
                address = string.IsNullOrEmpty(address) ? string.Empty : address;
                prepayments = string.IsNullOrEmpty(prepayments) ? string.Empty : prepayments;
                eC_MemberExtend = _eC_MemberBasicBLL.GetMemberExtendByMemberId(CurrentUser.MemberId);
 
 
 
                //address = GetAddress(eC_AcceptWayByOrders, address);
                //if (string.IsNullOrEmpty(address))
                //{
                //    Response.Clear();
                //    Response.Write(string.Format("<script>alert('{0}!');</script>", 1 == eC_AcceptWayByOrders.Count ? "没有收货地址" : "要合并的订单收货地址必须一致"));
                //    Response.End();
                //}
                string accepterAddress = string.Empty;
                string accepterPhone = string.Empty;
 
                EC_AcceptWayByOrderBLL _AcceptWayByOrderBLL = new EC_AcceptWayByOrderBLL();
                EC_AcceptWayByOrder model = _AcceptWayByOrderBLL.GetModelByTargetId(orderId);
                EC_AwbInfo m_EC_AwbInfo = _eC_OrderBasicBLL.SelectAwbInfoById(orderId);
                if (model != null)
                {
                    accepterAddress = model.AccepterAddress;
                    accepterPhone = model.AccepterPhone;
                }
                if (!string.IsNullOrEmpty(accepterAddress))
                {
                    address = accepterAddress;
                }
                if (!string.IsNullOrEmpty(accepterPhone))
                {
                    buyerPhone = accepterPhone;
                }
 
                if (m_EC_AwbInfo != null)
                {
                    Remark = m_EC_AwbInfo.Remark;
 
                }
                this.spnRemark.InnerHtml = Remark;
                StringBuilder builder = new StringBuilder();
                builder.Append("{");
                builder.Append("BuyerName:'");
                builder.Append(buyerNmae);
                builder.Append("',");
                builder.Append("BuyerPhone:'");
                builder.Append(buyerPhone);
                builder.Append("',");
                builder.Append("BuyerAddress:'");
                builder.Append(address);
                builder.Append("',");
                builder.Append("BuyerPrepayments:'");
                builder.Append(prepayments);
                builder.Append("',");
                builder.Append("SellerName:'");
                builder.Append(eC_MemberExtend.Name);
                builder.Append("',");
                builder.Append("SellerAddress:'");
                builder.Append(eC_MemberExtend.DetailedAddress);
                builder.Append("',");
                builder.Append("SellerPhone:'");
                builder.Append(eC_MemberExtend.PhoneNum);
                builder.Append("',");
                builder.Append("SellerShortName:'");
                builder.Append(CurrentUser.ShortName);
                builder.Append("'}");
 
                txtOtherInfo.Value = builder.ToString();
 
                EC_OrderBasic eC_OrderBasic = _eC_OrderBasicBLL.SelectModelById(orderId);
 
                if (!eC_OrderBasic.DeliveryOrderId.HasValue || eC_OrderBasic.DeliveryOrderId.Equals(Guid.Empty))
                {
                    
                  string ssss =   DateTime.Now.ToString("yyyyMMdd");
                    string SellerOrderId = ssss+ 1.ToString("000");
 
                    string maxSellerOrderId = oA_DeliverPlanBLL.GetModelByformid(CurrentUser.MemberId).Where(x=>x.SellerOrderId.Contains(ssss)).Max(x=>x.SellerOrderId);
                    if (!string.IsNullOrWhiteSpace(maxSellerOrderId))
                    {
                     string aaaaaaaaaaaa =    maxSellerOrderId.Substring(maxSellerOrderId.Length - 3, 3);
                        SellerOrderId = ssss + (aaaaaaaaaaaa.ToInt32().Value+1).ToString("000");
                    }
                    this.SellerOrderId.InnerText = SellerOrderId;
                    using (TransactionScope scope = new TransactionScope())
                    {
 
 
                        OA_DeliverPlan oA_DeliverPlan = new OA_DeliverPlan();
                        oA_DeliverPlan.Lianxiren = model.Accepter;
                        oA_DeliverPlan.Keyid = Guid.NewGuid();
                        oA_DeliverPlan.FirmId = CurrentUser.MemberId;
                        oA_DeliverPlan.DeliverTime = DeliveryTime.HasValue? DeliveryTime: eC_OrderBasic.DeliveryTime;
                        oA_DeliverPlan.BuyerId = eC_OrderBasic.BuyerId;
                        oA_DeliverPlan.DeliveredTime = null;
                        oA_DeliverPlan.Zhuyishixiang = Remark;
                        oA_DeliverPlan.Gongzuokaoping = "";
                        oA_DeliverPlan.CarId = 0;
                        oA_DeliverPlan.DriverId = 0;
                        oA_DeliverPlan.Transferstatus = 1;
                        oA_DeliverPlan.TransfersTime = null;
                        oA_DeliverPlan.Sort = 1;
                        oA_DeliverPlan.Creater = CurrentUser.TrueMemberId;
                        oA_DeliverPlan.CreateTime = DateTime.Now;
                        oA_DeliverPlan.Updater = CurrentUser.TrueMemberId;
                        oA_DeliverPlan.LastUpdateTime = DateTime.Now;
                        oA_DeliverPlan.wentifankui = "";
                        oA_DeliverPlan.SellerOrderId = SellerOrderId;
                        oA_DeliverPlan.Dianhua = model.AccepterPhone;
                        oA_DeliverPlan.Dizhi = model.AccepterAddress;
                        oA_DeliverPlan.Remark = Remark;
                        oA_DeliverPlan.BusinessManagerId = oA_CorporateClients.BusinessManagerId??0;
                        oA_DeliverPlan.Biddingcompany = oA_CorporateClients.Biddingcompany??0;
                        oA_DeliverPlan.CompanyName = oA_CorporateClients.CompanyName;
                        oA_DeliverPlan.shifouDelivery = shifouDelivery;
                        _OA_DeliverPlanBLL.InsertModel(oA_DeliverPlan);
                        this.spnBuyerAddress.InnerText = oA_DeliverPlan.Dizhi;
                        this.spnNowTime.InnerText = oA_DeliverPlan.DeliverTime.Value.ToString("yyyy-MM-dd");
                        this.SellerOrderId.InnerText = oA_DeliverPlan.SellerOrderId;
                        this.spnBuyerPhone.InnerText = oA_DeliverPlan.Dianhua;
                        string[] orderids = Request["ids"].Split(',');
                        foreach (string oid in orderids)
                        {
                            _eC_OrderBasicBLL.UpdateDeliveryOrderId(oid.ToInt32().Value, oA_DeliverPlan.Keyid);
                        }
                        scope.Complete();
                    }
 
                    
                }
                else
                {
                   
                    OA_DeliverPlan oA_DeliverPlan = _OA_DeliverPlanBLL.GetModelByKeyid(eC_OrderBasic.DeliveryOrderId,null,null);
                    this.spnBuyerAddress.InnerText = oA_DeliverPlan.Dizhi;
                    this.spnNowTime.InnerText = oA_DeliverPlan.DeliverTime.Value.ToString("yyyy-MM-dd");
                    this.SellerOrderId.InnerText = oA_DeliverPlan.SellerOrderId;
                    this.spnBuyerPhone.InnerText = oA_DeliverPlan.Dianhua;
                    this.SellerOrderId.InnerText = oA_DeliverPlan.SellerOrderId;
                    oA_DeliverPlan.Dianhua = model.AccepterPhone;
                    oA_DeliverPlan.Dizhi = model.AccepterAddress;
                    oA_DeliverPlan.Lianxiren = model.Accepter;
                    oA_DeliverPlan.Remark = "";
                    oA_DeliverPlan.BusinessManagerId = oA_CorporateClients.BusinessManagerId ?? 0;
                    oA_DeliverPlan.Biddingcompany = oA_CorporateClients.Biddingcompany ?? 0;
                    oA_DeliverPlan.CompanyName = oA_CorporateClients.CompanyName;
                    //oA_DeliverPlan.shifouDelivery = shifouDelivery;
                    //oA_DeliverPlan.DeliverTime = eC_OrderBasic.DeliveryTime;
                    _OA_DeliverPlanBLL.UpdateModel(oA_DeliverPlan);
                }
 
 
 
                List<Model.EC_OrderBasic> eC_OrderBasics = _eC_OrderBasicBLL.GetOrderByIds(Request["ids"]).ToList();
                decimal SumPrice = 0;
 
                if (eC_OrderBasics != null && eC_OrderBasics.Count > 0)
                {
                    for (int i = 0; i < eC_OrderBasics.Count; i++)
                    {
                        if (i == 0)
                        {
                            EC_AwbInfo m_EC_AwbInfoaaa = _eC_OrderBasicBLL.SelectAwbInfoById(eC_OrderBasics[i].Keyid.Value);
 
 
                            if (m_EC_AwbInfoaaa != null)
                            {
                                this.spnRemark.InnerText = m_EC_AwbInfoaaa.Remark;
 
                            }
                        }
                        SumPrice += eC_OrderBasics[i].SumPrice.Value;
 
                        EC_OrderPrintParameter _eC_OrderPrintParameter = eC_OrderPrintParameterBLL.GetModel(eC_OrderBasics[i].Keyid.Value);
                        InquiryCommonModel _inquiryCommonModel = null;
                        if (null == _eC_OrderPrintParameter)
                        {
                            _inquiryCommonModel = new InquiryCommonModel();
                        }
                        else
                        {
                            _inquiryCommonModel = SerializationHelper.DeSerialize(typeof(InquiryCommonModel), _eC_OrderPrintParameter.PrintParameter) as InquiryCommonModel;
                        }
 
                        eC_OrderBasics[i].PrintSizeName = _inquiryCommonModel.PrintSizeName;
                        EC_OrderBasic _eC_OrderBasic = _eC_OrderBasicBLL.SelectModelById(eC_OrderBasics[i].Keyid.Value);
                        eC_OrderBasics[i].OrderExtend.PrintNum = _eC_OrderBasic.OrderExtend.PrintNum;
 
                        var sss = dictionaryBLL.GetDataByType("印刷单位").Where(x => x.MeanValue == _eC_OrderBasic.OrderExtend.printunit).FirstOrDefault();
                        if (sss != null)
                        {
                            eC_OrderBasics[i].yssldw = sss.Name;
                        }
 
                    }
                }
 
                rptData.DataSource = eC_OrderBasics;
                rptData.DataBind();
              
 
              
                
                this.spnSumPrice.InnerText = SumPrice.ToString("#0.00");
                this.spnSumPriceUpper.InnerText = GetChinaMoney(SumPrice);
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                Response.Clear();
                Response.Write("<script>alert('数据错误!');</script>");
                Response.End();
            }
 
 
 
        }
        /// <summary>
        /// 获取订单送货地址
        /// </summary>
        /// <param name="eC_AcceptWayByOrders">订单收货地址</param>
        /// <param name="defaultAddress">默认收货地址</param>
        private static string GetAddress(List<EC_AcceptWayByOrder> eC_AcceptWayByOrders, string defaultAddress)
        {
            if (null == eC_AcceptWayByOrders || 0 == eC_AcceptWayByOrders.Count) return null;
            Sys_DictionaryBLL _sys_DictionaryBLL = new Sys_DictionaryBLL();
            List<Sys_Dictionary> sys_Dictionaries = _sys_DictionaryBLL.GetDataByType("收货方式") as List<Sys_Dictionary>;
            Dictionary<int, string> typs = new Dictionary<int, string>();
            sys_Dictionaries.Find(delegate(Sys_Dictionary sys_Dictionary)
            {
                typs.Add(sys_Dictionary.Keyid.Value, sys_Dictionary.Name);
                return false;
            });
            string address = string.Empty;
            eC_AcceptWayByOrders.Find(delegate(EC_AcceptWayByOrder tempAcceptWay)
            {
                switch (typs[tempAcceptWay.AcceptTypeId.Value])
                {
                    case "自提":
                    case "代发货运":
                    default:
                        break;
 
                    case "送货上门":
                    case "指定货运公司":
                        if (null == address) return true; else ;//地址不相同时直接跳出
                        //地址为空字符时或者地址与收货地址相同时地址为收货地址,否则地址不相同(为空)
                        address = 0 == address.Length || (!string.IsNullOrEmpty(tempAcceptWay.AccepterAddress) && address.Equals(tempAcceptWay.AccepterAddress)) ? tempAcceptWay.AccepterAddress : null;
 
                        break;
 
                }
                return false;
            });
 
            if (null == address)//地址完全不一致
            {
                return null;
            }
            else if (string.Empty.Equals(address)) //都是自提或是代发货运时采用默认地址
            {
                return defaultAddress;
            }
            else
            {
                return address;//地址一致时采用一致的地址
            }
 
 
        }
 
 
 
        public static string GetChinaMoney(decimal money)
        {
            string[] strArray;
            string str = "";
            string str2 = "";
            string str3 = money.ToString("0.00");
            switch (str3.Trim().Length)
            {
                case 4:
                    strArray = new string[] { str3[0].ToString(), "y", str3[2].ToString(), "j", str3[3].ToString(), "f" };
                    str = string.Concat(strArray);
                    break;
 
                case 5:
                    strArray = new string[] { str3[0].ToString(), "s", str3[1].ToString(), "y", str3[3].ToString(), "j", str3[4].ToString(), "f" };
                    str = string.Concat(strArray);
                    break;
 
                case 6:
                    strArray = new string[] { str3[0].ToString(), "b", str3[1].ToString(), "s", str3[2].ToString(), "y", str3[4].ToString(), "j", str3[5].ToString(), "f" };
                    str = string.Concat(strArray);
                    break;
 
                case 7:
                    strArray = new string[] { str3[0].ToString(), "q", str3[1].ToString(), "b", str3[2].ToString(), "s", str3[3].ToString(), "y", str3[5].ToString(), "j", str3[6].ToString(), "f" };
                    str = string.Concat(strArray);
                    break;
 
                case 8:
                    strArray = new string[] { str3[0].ToString(), "w", str3[1].ToString(), "q", str3[2].ToString(), "b", str3[3].ToString(), "s", str3[4].ToString(), "y", str3[6].ToString(), "j", str3[7].ToString(), "f" };
                    str = string.Concat(strArray);
                    break;
 
                case 9:
                    strArray = new string[] { str3[0].ToString(), "s", str3[1].ToString(), "w", str3[2].ToString(), "q", str3[3].ToString(), "b", str3[4].ToString(), "s", str3[5].ToString(), "y", str3[7].ToString(), "j", str3[8].ToString(), "f" };
                    str = string.Concat(strArray);
                    break;
 
                case 10:
                    strArray = new string[] {
                        str3[0].ToString(), "b", str3[1].ToString(), "s", str3[2].ToString(), "w", str3[3].ToString(), "q", str3[4].ToString(), "b", str3[5].ToString(), "s", str3[6].ToString(), "y", str3[8].ToString(), "j",
                        str3[9].ToString(), "f"
                     };
                    str = string.Concat(strArray);
                    break;
 
                case 11:
                    strArray = new string[] {
                        str3[0].ToString(), "q", str3[1].ToString(), "b", str3[2].ToString(), "s", str3[3].ToString(), "w", str3[4].ToString(), "q", str3[5].ToString(), "b", str3[6].ToString(), "s", str3[7].ToString(), "y",
                        str3[9].ToString(), "j", str3[10].ToString(), "f"
                     };
                    str = string.Concat(strArray);
                    break;
 
                case 12:
                    strArray = new string[] {
                        str3[0].ToString(), "m", str3[1].ToString(), "q", str3[2].ToString(), "b", str3[3].ToString(), "s", str3[4].ToString(), "w", str3[5].ToString(), "q", str3[6].ToString(), "b", str3[7].ToString(), "s",
                        str3[8].ToString(), "y", str3[10].ToString(), "j", str3[11].ToString(), "f"
                     };
                    str = string.Concat(strArray);
                    break;
            }
            for (int i = 0; i < str.Trim().Length; i++)
            {
                switch (str[i])
                {
                    case '0':
                        str2 = str2 + "零";
                        break;
 
                    case '1':
                        str2 = str2 + "壹";
                        break;
 
                    case '2':
                        str2 = str2 + "贰";
                        break;
 
                    case '3':
                        str2 = str2 + "叁";
                        break;
 
                    case '4':
                        str2 = str2 + "肆";
                        break;
 
                    case '5':
                        str2 = str2 + "伍";
                        break;
 
                    case '6':
                        str2 = str2 + "陆";
                        break;
 
                    case '7':
                        str2 = str2 + "柒";
                        break;
 
                    case '8':
                        str2 = str2 + "捌";
                        break;
 
                    case '9':
                        str2 = str2 + "玖";
                        break;
 
                    case 'b':
                        str2 = str2 + "佰";
                        break;
 
                    case 'f':
                        str2 = str2 + "分";
                        break;
 
                    case 'j':
                        str2 = str2 + "角";
                        break;
 
                    case 'm':
                        str2 = str2 + "亿";
                        break;
 
                    case 'q':
                        str2 = str2 + "仟";
                        break;
 
                    case 's':
                        str2 = str2 + "拾";
                        break;
 
                    case 'w':
                        str2 = str2 + "万";
                        break;
 
                    case 'y':
                        str2 = str2 + "元";
                        break;
                }
            }
            return str2;
        }
    }
}