diff --git a/.gitignore b/.gitignore index e89a1b4..1abf800 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ packages obj/ *.user -*.log \ No newline at end of file +*.log +**website.publishproj \ No newline at end of file diff --git a/web/App_Code/api/guadanGuestQueryController.cs b/web/App_Code/api/guadanGuestQueryController.cs index 4749bf0..e86a447 100644 --- a/web/App_Code/api/guadanGuestQueryController.cs +++ b/web/App_Code/api/guadanGuestQueryController.cs @@ -73,6 +73,39 @@ public class guadanGuestQueryController: ApiController total = totalCount, }); } + + [HttpGet] + [Route("api/guadan/guest/checkin/list")] + public async Task GetCheckInGuest([FromUri] DateTime date) + { + var today = DateTime.Now.Date; + var data = await _db.GuaDanOrderGuest + .Where(guest => guest.StatusCode == "402") + .Where(guest => guest.RegionAndRoomAndBedSchedule + .Any(s => s.ScheduleDate == date.Date && s.ScheduleDate == today) == true) + .Select(guest => new + { + name = guest.followers.u_name, + gender = guest.followers.sex, + }) + .ToListAsync(); + return Ok(data); + } + [HttpGet] + [Route("api/guadan/guest/booking/list")] + public async Task GetBookingGuest([FromUri] DateTime date) + { + var data = await _db.GuaDanOrderGuest + .Where(guest => guest.StatusCode == "402" || guest.StatusCode == "401") + .Where(guest => guest.RegionAndRoomAndBedSchedule.Any(s => s.ScheduleDate == date.Date) == true) + .Select(guest => new + { + name = guest.followers.u_name, + gender = guest.followers.sex, + }) + .ToListAsync(); + return Ok(data); + } public string GetRoomAndBedString(RegionRoomBed bed) { if (bed == null || bed.Room == null) return ""; diff --git a/web/App_Code/api/guadanStatisticsTableController.cs b/web/App_Code/api/guadanStatisticsTableController.cs index 289d647..aa2bf23 100644 --- a/web/App_Code/api/guadanStatisticsTableController.cs +++ b/web/App_Code/api/guadanStatisticsTableController.cs @@ -59,6 +59,18 @@ public class guadanStatisticsTableController: ApiController ? g.Count(x => x.GuaDanOrderGuest.RegionRoomBedStatus.Code == "402" || x.GuaDanOrderGuest.RegionRoomBedStatus.Code == "403") : 0, + checkinfemale = g.Key <= DateTime.Today + ? g.Count(x => (x.GuaDanOrderGuest.RegionRoomBedStatus.Code == "402" + || x.GuaDanOrderGuest.RegionRoomBedStatus.Code == "403") + && x.GuaDanOrderGuest.followers.sex == "女眾") + : 0, + checkinmale = g.Key <= DateTime.Today + ? g.Count(x => (x.GuaDanOrderGuest.RegionRoomBedStatus.Code == "402" + || x.GuaDanOrderGuest.RegionRoomBedStatus.Code == "403") + && x.GuaDanOrderGuest.followers.sex == "男眾") + : 0, + bookfemale = g.Count(x => x.GuaDanOrderGuest.followers.sex == "女眾"), + bookmale = g.Count(x => x.GuaDanOrderGuest.followers.sex == "男眾") }) .OrderBy(x => x.date) .ToList(); diff --git a/web/App_Code/api/orderdetailController.cs b/web/App_Code/api/orderdetailController.cs index aee31c7..8d265c5 100644 --- a/web/App_Code/api/orderdetailController.cs +++ b/web/App_Code/api/orderdetailController.cs @@ -22,94 +22,14 @@ public class orderdetailController:ApiController public IHttpActionResult GetList([FromBody] Model.ViewModel.pro_order q, int page, int pageSize = 10, string sortBy = "", bool sortDesc = false) { int activity_num = Convert.ToInt32(q.activity_num); - + //現在的牌位預覽只會出現功德主,修改為所有人都會出現 //var aIDt = _db.actItems.AsEnumerable().Where(f => f.subject.Contains(q.actItemTxt.Trim())).Select(f => f.num);//品項 - var OrderList = _db.pro_order.Where(u => u.activity_num == activity_num).Select(j => j.order_no).ToList(); - var gdzOrderList = _db.pro_order_detail.Where(o => OrderList.Contains(o.order_no) && o.print_id.Contains("主")).Select(o => o.order_no).Distinct().ToList(); - var qry = _db.pro_order.Where(u => gdzOrderList.Contains(u.order_no)).AsEnumerable(); - if (!string.IsNullOrEmpty(q.order_no)) - qry = qry.Where(o => o.order_no.Contains(q.order_no.Trim())); - if (!string.IsNullOrEmpty(q.keyin1)) - qry = qry.Where(o => o.keyin1.Contains(q.keyin1)); - if (q.f_num.HasValue && q.f_num > 0) - qry = qry.Where(o => o.f_num == q.f_num); - if (q.activity_num.HasValue && q.activity_num > 0) - qry = qry.Where(o => o.activity_num == q.activity_num); - if (q.up_time1.HasValue) - qry = qry.Where(o => o.up_time >= q.up_time1.Value); - if (q.up_time2.HasValue) - qry = qry.Where(o => o.up_time < Convert.ToDateTime(q.up_time2.Value).AddDays(1)); - if (!string.IsNullOrEmpty(q.address)) - qry = qry.Where(o => o.address.Contains(q.address.Trim())); - if (!string.IsNullOrEmpty(q.subject)) - qry = qry.Where(o => o.activity_num.HasValue && o.activity.subject.Contains(q.subject?.Trim())); - if (!string.IsNullOrEmpty(q.u_name)) - qry = qry.Where(o => o.f_num.HasValue && o.follower.u_name.Contains(q.u_name?.Trim())); - if (!string.IsNullOrEmpty(q.introducerTxt)) - qry = qry.Where(o => o.introducer.HasValue && o.follower1.u_name.Contains(q.introducerTxt?.Trim())); - - if (!string.IsNullOrEmpty(q.actItemTxt)) - { - //qry = qry.Where(o => o.pro_order_detail.Where(f2 => f2.order_no == o.order_no && aIDt.ToArray().Contains(f2.actItem_num?.ToString())).Count() > 0); - // qry = qry.Where(o => o.pro_order_detail.Where(f2 => f2.order_no == o.order_no && aIDt.Any(x => x == f2.actItem_num)).Count() > 0); - - qry = qry.Where(o => o.pro_order_detail.Where(f2 => f2.actItem_num.HasValue && f2.actItem.subject.Contains(q.actItemTxt?.Trim())).Count() > 0); - - } - - if (!string.IsNullOrEmpty(q.country)) - qry = qry.Where(o => o.f_num != null && o.follower?.country == q.country); - if (!string.IsNullOrEmpty(q.country2)) - { - if (q.country2 == "1") - { - qry = qry.Where(o => o.f_num != null && o.follower?.country == "158"); - } - else if (q.country2 == "2") - { - qry = qry.Where(o => o.f_num != null && o.follower?.country != "158"); - - } - } - - - if (sortBy.Equals("order_no")) - { - if (sortDesc) - qry = qry.OrderByDescending(o => o.order_no); - else - qry = qry.OrderBy(o => o.order_no); - } - else if (sortBy.Equals("keyin1_txt")) - { - if (sortDesc) - qry = qry.OrderByDescending(o => o.keyin1); - else - qry = qry.OrderBy(o => o.keyin1); - } - else if (sortBy.Equals("up_time")) - { - if (sortDesc) - qry = qry.OrderByDescending(o => o.up_time); - else - qry = qry.OrderBy(o => o.up_time); - } - else if (sortBy.Equals("u_name")) - { - if (sortDesc) - qry = qry.OrderByDescending(o => o.follower?.u_name); - else - qry = qry.OrderBy(o => o.follower?.u_name); - } - else if (sortBy.Equals("subject")) - { - if (sortDesc) - qry = qry.OrderByDescending(o => o.activity?.subject); - else - qry = qry.OrderBy(o => o.activity?.subject); - } - else - qry = qry.OrderByDescending(o => o.reg_time); + //var OrderList = _db.pro_order.Where(u => u.activity_num == activity_num).Select(j => j.order_no).ToList(); + //var gdzOrderList = _db.pro_order_detail.Where(o => OrderList.Contains(o.order_no) && o.print_id.Contains("主")).Select(o => o.order_no).Distinct().ToList(); + //var qry = _db.pro_order.Where(u => gdzOrderList.Contains(u.order_no)).AsEnumerable(); + var qry = _db.pro_order.Where( u => u.activity_num == activity_num).AsEnumerable(); + + qry = qry.OrderByDescending(o => o.reg_time); var count = qry.Count(); //pageSize = count;//一次取回?? var ret = new @@ -125,7 +45,11 @@ public class orderdetailController:ApiController up_time = x.up_time, keyin1_txt = Model.pro_order.keyin1_value_to_text(x.keyin1), //detail = x.pro_order_detail.Where(u => u.printed_files != null) - detail = new { count = x.pro_order_detail.Where(u => u.actItem.act_bom.Count() == 0).Count(), + detail = new { count = x.pro_order_detail + .Where(u => (u.parent_num != null) + || u.actItem.subject.Contains("牌") + || !string.IsNullOrEmpty(u.f_num_tablet)) + .Count(), actItem = x.pro_order_detail.Where(u => u.printed_files != null).FirstOrDefault()?.print_id } }), count = count diff --git a/web/App_Code/api/regionRoomBedController.cs b/web/App_Code/api/regionRoomBedController.cs index dec7292..eecd783 100644 --- a/web/App_Code/api/regionRoomBedController.cs +++ b/web/App_Code/api/regionRoomBedController.cs @@ -386,7 +386,7 @@ public class regionRoomBedController : ApiController // 新增每日排程 if (allocationEnd.HasValue) { - for (var date = allocationStart; date <= allocationEnd.Value; date = date.AddDays(1)) + for (var date = allocationStart; date < allocationEnd.Value; date = date.AddDays(1)) { var newSchedule = new RegionAndRoomAndBedSchedule { @@ -398,7 +398,8 @@ public class regionRoomBedController : ApiController CreatedBy = "系统自动分配", CreatedAt = DateTime.Now, GuaDanOrderNo = guest.GuaDanOrderNo, - Title = "掛單" + Title = "掛單", + GuaDanOrderGuestUuid = guest.Uuid, }; _db.RegionAndRoomAndBedSchedule.Add(newSchedule); } @@ -416,7 +417,8 @@ public class regionRoomBedController : ApiController CreatedBy = "系统自动分配", CreatedAt = DateTime.Now, GuaDanOrderNo = guest.GuaDanOrderNo, - Title = "掛單" + Title = "掛單", + GuaDanOrderGuestUuid = guest.Uuid, }; _db.RegionAndRoomAndBedSchedule.Add(newSchedule); } diff --git a/web/admin/guadan/statistics_table.aspx b/web/admin/guadan/statistics_table.aspx index a3a6fd1..699a4d5 100644 --- a/web/admin/guadan/statistics_table.aspx +++ b/web/admin/guadan/statistics_table.aspx @@ -142,13 +142,15 @@ +
+ + + + + {{ bookerDialog.title }} + + + + + + + + + + + + + 關閉 + + + +
+ + + @@ -201,12 +235,60 @@ guadanPeopleCurrentMale: 0, guadanPeopleCurrentFemale: 0 }, + bookerDialog: { + title: "", + show: false, + items: [], + headers: [ + { text: '姓名', value: 'name' }, + { text: "性别", value: 'gender'} + ] + } } }, methods: { + showBookDialog(item, title, type = null) { + this.bookerDialog.title = title; + this.bookerDialog.show = true; + if (type === 'booking') { + this.getBookerDialogBookingItems(item.date); + } + else if (type === 'checkin') { + this.getBookerDialogCheckInItems(item.date); + } + }, + closeBookDialog() { + this.bookerDialog.show = false; + this.bookerDialog.title = ""; + this.bookerDialog.items = []; + }, + async getBookerDialogBookingItems(date) { + try { + const res = await axios.get(HTTP_HOST + 'api/guadan/guest/booking/list', { + params: { + date: date + } + }); + this.bookerDialog.items = res.data; + } catch(error) { + + } + }, + async getBookerDialogCheckInItems(date) { + try { + const res = await axios.get(HTTP_HOST + 'api/guadan/guest/checkin/list', { + params: { + date: date + } + }); + this.bookerDialog.items = res.data; + } catch (error) { + + } + }, async getList() { try { - const res = await axios.get('/api/guadan/guadanstatisticstable/list', { + const res = await axios.get(HTTP_HOST + 'api/guadan/guadanstatisticstable/list', { params: { start: this.startDate || '', end: this.endDate || '' diff --git a/web/admin/printpw/index.aspx.cs b/web/admin/printpw/index.aspx.cs index e204fde..efa6ba1 100644 --- a/web/admin/printpw/index.aspx.cs +++ b/web/admin/printpw/index.aspx.cs @@ -19,53 +19,24 @@ public partial class admin_printpw_index : MyWeb.function private string previousOrderno = ""; protected void Page_Load(object sender, EventArgs e) { - //Response.Write("item:"+Request["item"]+"
"); - //Response.Write("file:"+Request["file"]+"
"); - //Response.Write("list:"+Request["list"]+"
"); - //if (!IsPostBack) - //{ this.Title = "預覽牌位"; if (Request.HttpMethod == "POST") { - /*if (!String.IsNullOrEmpty(Request["item"]) && - !String.IsNullOrEmpty(Request["file"]) && - !String.IsNullOrEmpty(Request["list"]) - )*/ if (!String.IsNullOrEmpty(Request["order_no"])) { var order_no = Request["order_no"]; var oderList = _db.pro_order_detail - .Where(u => u.order_no == order_no && u.printed_files != null) + .Where(u => u.order_no == order_no) + .Where(u => (u.parent_num != null) + || u.actItem.subject.Contains("牌") + || !string.IsNullOrEmpty(u.f_num_tablet)) + //因為目前在[pro_order_detail]表中,沒有辦法區分那些項目是牌位, + //只有根據某些欄位來做部分篩選,可能會篩選錯 + //但是為什麼沒有欄位可以區分一個項目是不是牌位呢? .Select(u => new { detail_num = u.num, actItem_num = u.actItem_num }).ToArray(); Repeater1.DataSource = oderList; Repeater1.DataBind(); } - else if (!String.IsNullOrEmpty(Request["activity_num"])) - { - //var _details = Newtonsoft.Json.JsonConvert.DeserializeObject(Request["list"]); - //string json = ""; - //using (System.IO.StreamReader oSR = new System.IO.StreamReader(Request.InputStream)) - // json = oSR.ReadToEnd(); - int activity_num = Convert.ToInt32(Request["activity_num"]); - //Repeater1.DataSource = _details; - var orderList = _db.pro_order.Where(u => u.activity_num == activity_num).Select(u => u.order_no).ToList(); - var gdzOrderList = _db.pro_order_detail.Where(u => orderList.Contains(u.order_no) && u.print_id.Contains("主") ).Select(u=>u.order_no).Distinct().ToArray(); - var datalist = _db.pro_order_detail - .Where(u => gdzOrderList.Contains(u.order_no) && u.print_id.Contains("主") && u.parent_num != null && u.printed_files != null) - .OrderBy(o => o.order_no) - .ThenBy(o => o.actItem_num) - .ThenBy(o=>o.print_id) - .Select(u => new {detail_num=u.num ,actItem_num=u.actItem_num}) - .ToArray(); - //List ints = new List(); - //ints.Add(12133); - Repeater1.DataSource = datalist; - Repeater1.DataBind(); - if (!String.IsNullOrEmpty(Request["title"])) - { - this.Title += " - " + Request["title"]; - } - } else { Response.Clear(); @@ -74,9 +45,6 @@ public partial class admin_printpw_index : MyWeb.function } } - - //} - } protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) @@ -248,8 +216,8 @@ public partial class admin_printpw_index : MyWeb.function catch (Exception ex) { var msg = ex.Message; - ret[0] = "??:" + msg; - ret[1] = "??"; + ret[0] = ""; + ret[1] = ""; } return ret; } diff --git a/web/admin/printpw/print.css b/web/admin/printpw/print.css index b780474..786e43a 100644 --- a/web/admin/printpw/print.css +++ b/web/admin/printpw/print.css @@ -24,6 +24,8 @@ @page a4l { size: a4 landscape; margin: 0; + margin-top:6mm; + margin-left:6mm; } @page a5 { @@ -133,6 +135,22 @@ pre { line-height: calc(var(--fs_w) * 1.0); } +.text-block.fit-text.add-space { + letter-spacing: 0.5em; +} +.text-block.fit-text.mid_text.add-space { + padding-top: 0.5em; +} +.text-block.fit-text.mid_text.add-space.add-space-3 { + letter-spacing: 1.5em; + padding-top: 1.5em; +} +body.tblt-m .left_text { + --font-max: 30pt; +} +body.tblt-m .top_text_2 { + right: 8mm; +} .vertical { writing-mode: vertical-rl; /*text-orientation: upright;*/ @@ -367,6 +385,10 @@ pre { left: 2mm; } +.top_text_3 { + display: none; +} + /*舊式紙張*/ body.tablet-l { --page-w: 274mm; @@ -548,6 +570,9 @@ body.tblt-l.a3.l2b .mid_text { --divh: 60mm; top: 40%; } +body.tblt-l.a3 .left_text { + --font-max: 36pt; +} body.tblt-l.a3.l2b .mid_text_2 { --divh: 180mm; @@ -638,7 +663,8 @@ body.tblt-m.a4-mrg { } body.tblt-m.a4-mrg .page { - --page-w: 100mm; + --page-w: 95mm; + margin-left:5mm; float: left; } @@ -763,9 +789,8 @@ body.tblt-xs { } body.tblt-xs.a3-mrg .page { - /*--page-w: 57mm;*/ - --page-w: 59mm; - --page-h: 100mm; + --page-w: 57mm; + --page-h: 98mm; page-break-after: auto; float: left; } @@ -775,13 +800,11 @@ body.tblt-xs.a4l-mrg { } body.tblt-xs.a4l-mrg .page { - /* --page-w: 57mm; */ - --page-w: 59mm; - --page-h: 100mm; + --page-w: 57mm; + --page-h: 98mm; page-break-after: auto; float: left; } - body.tblt-xs .top_text_1 { font-size: 8pt; } @@ -800,9 +823,9 @@ body.tblt-xs .mid_text_2 { } body.tblt-xs .right_text { - --divw: 12mm; + --divw: 10mm; --divh: 60mm; - right: 0mm; + right: 2mm; top: 25mm; } @@ -825,8 +848,7 @@ body.tblt-xs .top_text_2{ /*[標準X2B]隨喜牌位-佛力超薦-往生蓮位-A3(直)*/ right: 2mm; right: 3.0mm; - right: 3.5mm; - /* right: 4.0mm; */ + right: 5mm; } body.tblt-xs .txt_up { @@ -1075,35 +1097,4 @@ body.prayer-h pre { /*[標準X1A]隨喜牌位-佛光注照-長生祿位-A4(橫) */ * { outline:0 none !important; -} - -/*让自定义的分页生效,在某个div后面产生class-page从而分页,当牌位不是同一家人的时候就分页*/ -@media print { - .page-break { - display: block !important; - width: 100%; - height: 1px; - visibility: hidden; - page-break-after: always; - } - - .page { - page-break-inside: auto !important; - } - - @page { - orphans: 1; - widows: 1; - } - - .d-flex { - display: block !important; - } - - .page-break::after { - content: ""; - display: block; - height: 1px; - visibility: hidden; - } -} +} \ No newline at end of file diff --git a/web/admin/printpw/print.js b/web/admin/printpw/print.js index 6aacf24..0b90590 100644 --- a/web/admin/printpw/print.js +++ b/web/admin/printpw/print.js @@ -32,17 +32,25 @@ function init_print() { //console.log(i, $(this).html(),$(this).text()); //console.log(i, txt==htm); //console.log(i, txt_arr, line, line_len); - line_len = Math.ceil(line_len / 5) * 5; + line_len = Math.ceil(line_len / 3) * 3; //if(line>1){ css = $(this).attr("style")||""; if(css.length>0){ css += ";"; } css += "--lines:" + line + ";--line_len:" + line_len + ";"; - //debugger; + + //字少時, 加空間 + let allShort = txt_arr2.every(line => line.trim().length <= 7); + let addSpaceClass = allShort ? "add-space" : ""; + allShort = txt_arr2.every(line => line.trim().length <= 3); + addSpaceClass += allShort ? " add-space-3" : ""; + htm_lines = txt_arr2.join("
"); - $(this).attr("style", css); - $(this).html(htm_lines); + $(this) + .attr("style", css) + .addClass(addSpaceClass) + .html(htm_lines); //} //console.log(i, line, line_len, css,txt); }); diff --git a/web/admin/printpw/yulan.aspx b/web/admin/printpw/yulan.aspx index 43e68f0..ebcdf44 100644 --- a/web/admin/printpw/yulan.aspx +++ b/web/admin/printpw/yulan.aspx @@ -153,6 +153,9 @@ +