更新版本至master
This commit is contained in:
		
							parent
							
								
									93f7b84701
								
							
						
					
					
						commit
						93c12bbbde
					
				@ -875,7 +875,7 @@
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	function setAuthPage() {
 | 
						function setAuthPage() {
 | 
				
			||||||
        $(`#accAuthPageTable input[type=checkbox]`).prop('disabled', false);
 | 
							$(`#accAuthPageTable input[type=checkbox]`).removeClass();
 | 
				
			||||||
		$.each($(`#accAuthPageTable input[type=checkbox]:checked`), function (i, v) {
 | 
							$.each($(`#accAuthPageTable input[type=checkbox]:checked`), function (i, v) {
 | 
				
			||||||
			$(v).click();
 | 
								$(v).click();
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
@ -886,7 +886,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		$.each(pageAct.authCode, function (i, v) {
 | 
							$.each(pageAct.authCode, function (i, v) {
 | 
				
			||||||
			$(`#accAuthPageTable input[id=${v}]`).click();
 | 
								$(`#accAuthPageTable input[id=${v}]`).click();
 | 
				
			||||||
            $(`#accAuthPageTable input[id=${v}]`).attr('disabled', true);
 | 
					 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -233,6 +233,7 @@
 | 
				
			|||||||
            $('#js_nested_list').html(strHtml);
 | 
					            $('#js_nested_list').html(strHtml);
 | 
				
			||||||
            $(`[data-tabname="hisListItem"]`).YTTab();
 | 
					            $(`[data-tabname="hisListItem"]`).YTTab();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
							$(loadEle).Loading("close");
 | 
				
			||||||
        ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
 | 
					        ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -497,7 +498,7 @@
 | 
				
			|||||||
				$(loadEle).Loading("close");
 | 
									$(loadEle).Loading("close");
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			complete: (xhr) => {
 | 
								complete: (xhr) => {
 | 
				
			||||||
				setLoading(false);
 | 
									$(loadEle).Loading("close");
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
		// ytAjax = new YourTeam.Ajax(url, objSendData, function (rel) {
 | 
							// ytAjax = new YourTeam.Ajax(url, objSendData, function (rel) {
 | 
				
			||||||
 | 
				
			|||||||
@ -861,7 +861,6 @@
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		opeRecTable = new YourTeam.JqDataTables.getTableByAjax(ajaxObj, tag, null, columns, column_defs);
 | 
							opeRecTable = new YourTeam.JqDataTables.getTableByAjax(ajaxObj, tag, null, columns, column_defs);
 | 
				
			||||||
		$(tag).DataTable().order([10, 'desc']).draw();
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	function setType(wt) {
 | 
						function setType(wt) {
 | 
				
			||||||
@ -894,23 +893,23 @@
 | 
				
			|||||||
			let ytd = displayDate(new Date(new Date().setDate(new Date().getDate() - 1)), 'date').replaceAll('/', '-')
 | 
								let ytd = displayDate(new Date(new Date().setDate(new Date().getDate() - 1)), 'date').replaceAll('/', '-')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (dateType == 'tdy') {
 | 
								if (dateType == 'tdy') {
 | 
				
			||||||
				pageAct.startdate = displayDate(new Date(new Date().setDate(new Date().getDate() + 1)), 'datetime');
 | 
									pageAct.startdate = displayDate(new Date(new Date().setDate(new Date().getDate())), 'datetime').toString().replaceAll("/", "-").split(" ")[0] + "T00:00:00";
 | 
				
			||||||
				pageAct.enddate = new Date(displayDate(new Date(new Date().setDate(new Date().getDate() + 2)), 'date'));
 | 
									pageAct.enddate = displayDate(new Date(new Date().setDate(new Date().getDate())), 'datetime').toString().replaceAll("/", "-").split(" ")[0] + "T23:59:59";
 | 
				
			||||||
				$('#startdate').val(today);
 | 
									$('#startdate').val(today);
 | 
				
			||||||
				$('#startdate').data('val', today);
 | 
									$('#startdate').data('val', today);
 | 
				
			||||||
				$('#enddate').val(today);
 | 
									$('#enddate').val(today);
 | 
				
			||||||
				$('#enddate').data('val', today);
 | 
									$('#enddate').data('val', today);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			else if (dateType == 'ytd') {
 | 
								else if (dateType == 'ytd') {
 | 
				
			||||||
				pageAct.startdate = new Date(displayDate(new Date(new Date().setDate(new Date().getDate())), 'date'));
 | 
									pageAct.startdate = displayDate(new Date(new Date().setDate(new Date().getDate() - 1)), 'datetime').toString().replaceAll("/", "-").split(" ")[0] + "T00:00:00";
 | 
				
			||||||
				pageAct.enddate = new Date(displayDate(new Date(new Date().setDate(new Date().getDate() + 1)), 'date'));
 | 
									pageAct.enddate = displayDate(new Date(new Date().setDate(new Date().getDate() - 1)), 'datetime').toString().replaceAll("/", "-").split(" ")[0] + "T23:59:59";
 | 
				
			||||||
				$('#startdate').val(ytd);
 | 
									$('#startdate').val(ytd);
 | 
				
			||||||
				$('#startdate').data('val', ytd);
 | 
									$('#startdate').data('val', ytd);
 | 
				
			||||||
				$('#enddate').val(ytd);
 | 
									$('#enddate').val(ytd);
 | 
				
			||||||
				$('#enddate').data('val', ytd);
 | 
									$('#enddate').data('val', ytd);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			else {
 | 
								else {
 | 
				
			||||||
				pageAct.enddate = new Date(displayDate(new Date(pageAct.enddate.valueOf()).setDate(pageAct.enddate.getDate() + 2), 'date'));
 | 
									pageAct.enddate = displayDate(new Date(pageAct.enddate.valueOf()).setDate(pageAct.enddate.getDate()), 'date').toString().replaceAll("/", "-") + "T23:59:59";
 | 
				
			||||||
				$(`[onclick^=setDate]`).removeClass('btn-info');
 | 
									$(`[onclick^=setDate]`).removeClass('btn-info');
 | 
				
			||||||
				$(`[onclick^=setDate]`).addClass('btn-secondary');
 | 
									$(`[onclick^=setDate]`).addClass('btn-secondary');
 | 
				
			||||||
				if ($('#startdate').val() == $('#enddate').val()) {
 | 
									if ($('#startdate').val() == $('#enddate').val()) {
 | 
				
			||||||
@ -947,6 +946,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	function snSearch() {
 | 
						function snSearch() {
 | 
				
			||||||
		clearPageAct();
 | 
							clearPageAct();
 | 
				
			||||||
 | 
							pageAct.startdate = $('#startdate').val() + "T00:00:00";
 | 
				
			||||||
 | 
							pageAct.enddate = $('#enddate').val() + "T23:59:59"
 | 
				
			||||||
		pageAct.serial_number = $('#serial_number').val() || null;
 | 
							pageAct.serial_number = $('#serial_number').val() || null;
 | 
				
			||||||
		refTable();
 | 
							refTable();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -1005,14 +1006,14 @@
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	function exportExcel(e) {
 | 
						function exportExcel(e) {
 | 
				
			||||||
 | 
							console.log("export", e)
 | 
				
			||||||
		let url = baseApiUrl + "/operation/OpeExportExcel";
 | 
							let url = baseApiUrl + "/operation/OpeExportExcel";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		objSendData.Data = {
 | 
							objSendData.Data = {
 | 
				
			||||||
			work_type: pageAct.work_type,
 | 
								work_type: pageAct.work_type,
 | 
				
			||||||
			startdate: pageAct.startdate == undefined ? null : pageAct.startdate,
 | 
								startdate: pageAct.startdate == undefined ? null : pageAct.startdate,
 | 
				
			||||||
			enddate: pageAct.enddate == undefined ? null : pageAct.enddate,
 | 
								enddate: pageAct.enddate == undefined ? null : pageAct.enddate,
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
 | 
					 | 
				
			||||||
		ytAjax = new YourTeam.Ajax(url, objSendData, function (rel) {
 | 
							ytAjax = new YourTeam.Ajax(url, objSendData, function (rel) {
 | 
				
			||||||
			if (rel.code == "0000")
 | 
								if (rel.code == "0000")
 | 
				
			||||||
				location.href = baseApiUrl + "/api/df?path=" + rel.data.split('/')[0] + "&fileName=" + rel.data.split('/')[1] + "&token=" + cookies.get("JWT-Authorization");
 | 
									location.href = baseApiUrl + "/api/df?path=" + rel.data.split('/')[0] + "&fileName=" + rel.data.split('/')[1] + "&token=" + cookies.get("JWT-Authorization");
 | 
				
			||||||
 | 
				
			|||||||
@ -740,3 +740,7 @@ a[data-tabname="topFunBtn"]:hover { color: var(--theme-primary-50); }
 | 
				
			|||||||
.t-yellow {
 | 
					.t-yellow {
 | 
				
			||||||
  color: var(--yt-yellow-1);
 | 
					  color: var(--yt-yellow-1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					input.disabledBox {
 | 
				
			||||||
 | 
					    pointer-events: none;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -351,35 +351,35 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                                    cell = row.CreateCell(i);
 | 
					                                    cell = row.CreateCell(i);
 | 
				
			||||||
                                    if (i == 0)
 | 
					                                    if (i == 0)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        cell.SetCellValue(of.system_key);
 | 
					                                        cell.SetCellValue(of.system_key ?? "");
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                    if (i == 1)
 | 
					                                    if (i == 1)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        cell.SetCellValue(of.name);
 | 
					                                        cell.SetCellValue(of.name ?? "");
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                    if (i == 2)
 | 
					                                    if (i == 2)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        cell.SetCellValue(of.contact_person);
 | 
					                                        cell.SetCellValue(of.contact_person ?? "");
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                    if (i == 3)
 | 
					                                    if (i == 3)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        cell.SetCellValue(of.phone);
 | 
					                                        cell.SetCellValue(of.phone ?? "");
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                    if (i == 4)
 | 
					                                    if (i == 4)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        cell.SetCellValue(of.email);
 | 
					                                        cell.SetCellValue(of.email ?? "");
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                    if (i == 5)
 | 
					                                    if (i == 5)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        cell.SetCellValue(of.tax_id_number);
 | 
					                                        cell.SetCellValue(of.tax_id_number ?? "");
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                    if (i == 6)
 | 
					                                    if (i == 6)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        cell.SetCellValue(of.remark);
 | 
					                                        cell.SetCellValue(of.remark ?? "");
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                    if (i == 7)
 | 
					                                    if (i == 7)
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
                                        cell.SetCellValue(of.Created_at);
 | 
					                                        cell.SetCellValue(of.Created_at ?? "");
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                    cell.CellStyle = style12;
 | 
					                                    cell.CellStyle = style12;
 | 
				
			||||||
@ -389,17 +389,19 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else if (ee.work_type == 1)
 | 
					                    else if (ee.work_type == 1)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        var sqlString = $@"select opr.*, concat(d.device_floor_tag, ' ', d.device_last_name, ' ', d.device_serial_tag) as device_name, ui.full_name as user_full_name
 | 
					                        var sqlString = $@"select opr.*, d.full_name as device_name, ui.full_name as user_full_name
 | 
				
			||||||
                                       from operation_record opr
 | 
					                                       from operation_record opr
 | 
				
			||||||
                                       left join device d on opr.fix_do_code = d.device_number and d.deleted = 0 and d.device_area_tag = SUBSTRING_INDEX(opr.fix_do_code, '_', 1)
 | 
					                                       left join device d on opr.fix_do_code = d.device_number and d.deleted = 0 and d.device_area_tag = SUBSTRING_INDEX(opr.fix_do_code, '_', 1)
 | 
				
			||||||
				                                           and d.device_building_tag = SUBSTRING_INDEX(opr.fix_do_code, '_', 2) and d.device_floor_tag = SUBSTRING_INDEX(opr.fix_do_code, '_', 5)
 | 
									                                           and d.device_building_tag = SUBSTRING_INDEX(SUBSTRING_INDEX(opr.fix_do_code, '_', 2), '_', -1) and d.device_floor_tag = SUBSTRING_INDEX(SUBSTRING_INDEX(opr.fix_do_code, '_', 5), '_', -1)
 | 
				
			||||||
				                                           and d.device_system_tag = opr.device_system_category_layer2 and d.device_name_tag = opr.device_system_category_layer3
 | 
									                                           and d.device_system_tag = opr.device_system_category_layer2 and d.device_name_tag = opr.device_system_category_layer3
 | 
				
			||||||
                                       left join userinfo ui on opr.work_person_id = ui.userinfo_guid
 | 
					                                       left join userinfo ui on opr.work_person_id = ui.userinfo_guid
 | 
				
			||||||
                                       where opr.deleted = 0 and opr.work_type = 1;";
 | 
					                                       where opr.deleted = 0 and opr.work_type = 1 and opr.created_at >= '{ee.startdate?.ToString("yyyy-MM-dd") + "T00:00:00"}' and opr.created_at <= '{ee.enddate?.ToString("yyyy-MM-dd") + "T23:59:59"}';";
 | 
				
			||||||
                        var sheet = workbook.CreateSheet("廠商資料");
 | 
					                        var sheet = workbook.CreateSheet("廠商資料");
 | 
				
			||||||
                        var operation_record = backendRepository.GetAllAsync<Operation_Record>(sqlString, null);
 | 
					                        var operation_record = backendRepository.GetAllAsync<Operation_Record>(sqlString);
 | 
				
			||||||
                        List<Operation_Record_File> operation_record_file = new List<Operation_Record_File>();
 | 
					                        List<Operation_Record_File> operation_record_file = new List<Operation_Record_File>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        if (operation_record.Result != null)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
                            if (operation_record.Result.Count > 0)
 | 
					                            if (operation_record.Result.Count > 0)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                foreach (var or in operation_record.Result)
 | 
					                                foreach (var or in operation_record.Result)
 | 
				
			||||||
@ -463,27 +465,27 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                                        cell = row.CreateCell(i);
 | 
					                                        cell = row.CreateCell(i);
 | 
				
			||||||
                                        if (i == 0)
 | 
					                                        if (i == 0)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.work_type_name);
 | 
					                                            cell.SetCellValue(or.work_type_name == "null" ? "" : or.work_type_name);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 1)
 | 
					                                        if (i == 1)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.location);
 | 
					                                            cell.SetCellValue(or.location == "null" ? "" : or.location);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 2)
 | 
					                                        if (i == 2)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.formId);
 | 
					                                            cell.SetCellValue(or.formId == "null" ? "" : or.formId);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 3)
 | 
					                                        if (i == 3)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.device_name);
 | 
					                                            cell.SetCellValue(or.device_name == "null" ? "" : or.device_name);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 4)
 | 
					                                        if (i == 4)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.status_name);
 | 
					                                            cell.SetCellValue(or.status_name == "null" ? "" : or.status_name);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 5)
 | 
					                                        if (i == 5)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.user_full_name);
 | 
					                                            cell.SetCellValue(or.user_full_name == "null" ? "" : or.user_full_name);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 6)
 | 
					                                        if (i == 6)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
@ -491,7 +493,7 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 7)
 | 
					                                        if (i == 7)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        var imageNames = or.lorf.Count > 0 ? or.lorf.Select(x => x.save_file_name).ToList() : null;
 | 
					                                            var imageNames = or.lorf.Count > 0 ? or.lorf.Where(x => x.ori_file_name.Contains("JPG") || x.ori_file_name.Contains("PNG")).Select(x => x.save_file_name).ToList() : null;
 | 
				
			||||||
                                            if (imageNames != null)
 | 
					                                            if (imageNames != null)
 | 
				
			||||||
                                            {
 | 
					                                            {
 | 
				
			||||||
                                                //insert image process
 | 
					                                                //insert image process
 | 
				
			||||||
@ -545,31 +547,37 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 9)
 | 
					                                        if (i == 9)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.Created_at);
 | 
					                                            cell.SetCellValue(or.Created_at ?? "");
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                        cell.CellStyle = style12;
 | 
					                                        cell.CellStyle = style12;
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else if (ee.work_type == 2)
 | 
					                    else if (ee.work_type == 2)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        var sqlString = $@"select opr.*, concat(d.device_floor_tag, ' ', d.device_last_name, ' ', d.device_serial_tag) as device_name, ui.full_name as user_full_name
 | 
					                        var sqlString = $@"select opr.*, d.full_name as device_name, ui.full_name as user_full_name
 | 
				
			||||||
                                       from operation_record opr
 | 
					                                       from operation_record opr
 | 
				
			||||||
                                       left join device d on opr.fix_do_code = d.device_number and d.deleted = 0 and d.device_area_tag = SUBSTRING_INDEX(opr.fix_do_code, '_', 1)
 | 
					                                       left join device d on opr.fix_do_code = d.device_number and d.deleted = 0 and d.device_area_tag = SUBSTRING_INDEX(opr.fix_do_code, '_', 1)
 | 
				
			||||||
				                                        and d.device_building_tag = SUBSTRING_INDEX(opr.fix_do_code, '_', 2) and d.device_floor_tag = SUBSTRING_INDEX(opr.fix_do_code, '_', 5)
 | 
									                                        and d.device_building_tag = SUBSTRING_INDEX(SUBSTRING_INDEX(opr.fix_do_code, '_', 2), '_', -1) and d.device_floor_tag = SUBSTRING_INDEX(SUBSTRING_INDEX(opr.fix_do_code, '_', 5), '_', -1)
 | 
				
			||||||
				                                        and d.device_system_tag = opr.device_system_category_layer2 and d.device_name_tag = opr.device_system_category_layer3
 | 
									                                        and d.device_system_tag = opr.device_system_category_layer2 and d.device_name_tag = opr.device_system_category_layer3
 | 
				
			||||||
                                       left join userinfo ui on opr.work_person_id = ui.userinfo_guid
 | 
					                                       left join userinfo ui on opr.work_person_id = ui.userinfo_guid
 | 
				
			||||||
                                       where opr.deleted = 0 and opr.work_type = 2";
 | 
					                                       where opr.deleted = 0 and opr.work_type = 2 and opr.created_at >= '{ee.startdate?.ToString("yyyy-MM-dd") + "T00:00:00"}' and opr.created_at <= '{ee.enddate?.ToString("yyyy-MM-dd") + "T23:59:59"}';";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        var sheet = workbook.CreateSheet("廠商資料");
 | 
					                        var sheet = workbook.CreateSheet("廠商資料");
 | 
				
			||||||
                        var operation_record = backendRepository.GetAllAsync<Operation_Record>(sqlString);
 | 
					                        var operation_record = backendRepository.GetAllAsync<Operation_Record>(sqlString);
 | 
				
			||||||
                        List<Operation_Record_File> operation_record_file = new List<Operation_Record_File>();
 | 
					                        List<Operation_Record_File> operation_record_file = new List<Operation_Record_File>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        if (operation_record.Result != null)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
                            if (operation_record.Result.Count > 0)
 | 
					                            if (operation_record.Result.Count > 0)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                foreach (var or in operation_record.Result)
 | 
					                                foreach (var or in operation_record.Result)
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                    sqlString = $@"select * from operation_record_file where record_id = @record_id";
 | 
					                                    sqlString = $@"select * from operation_record_file where record_id = @record_id";
 | 
				
			||||||
                                    var param = new { @record_id = or.id };
 | 
					                                    var param = new { @record_id = or.id };
 | 
				
			||||||
                                    operation_record_file = backendRepository.GetAllAsync<Operation_Record_File>(sqlString, param).Result;
 | 
					                                    operation_record_file = backendRepository.GetAllAsync<Operation_Record_File>(sqlString, param).Result;
 | 
				
			||||||
@ -634,32 +642,32 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                                        cell = row.CreateCell(i);
 | 
					                                        cell = row.CreateCell(i);
 | 
				
			||||||
                                        if (i == 0)
 | 
					                                        if (i == 0)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.work_type_name);
 | 
					                                            cell.SetCellValue(or.work_type_name == "null" ? "" : or.work_type_name);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 1)
 | 
					                                        if (i == 1)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.location);
 | 
					                                            cell.SetCellValue(or.location == "null" ? "" : or.location);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 2)
 | 
					                                        if (i == 2)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.error_code);
 | 
					                                            cell.SetCellValue(or.error_code == "null" ? "" : or.error_code);
 | 
				
			||||||
                                            sheet.AutoSizeColumn(i);
 | 
					                                            sheet.AutoSizeColumn(i);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 3)
 | 
					                                        if (i == 3)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.formId);
 | 
					                                            cell.SetCellValue(or.formId == "null" ? "" : or.formId);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 4)
 | 
					                                        if (i == 4)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.device_name);
 | 
					                                            cell.SetCellValue(or.device_name == "null" ? "" : or.device_name);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 5)
 | 
					                                        if (i == 5)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.status_name);
 | 
					                                            cell.SetCellValue(or.status_name == "null" ? "" : or.status_name);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 6)
 | 
					                                        if (i == 6)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.user_full_name);
 | 
					                                            cell.SetCellValue(or.user_full_name == "null" ? "" : or.user_full_name);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 7)
 | 
					                                        if (i == 7)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
@ -667,7 +675,7 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 8)//image
 | 
					                                        if (i == 8)//image
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        var imageNames = or.lorf.Count > 0 ? or.lorf.Select(x => x.save_file_name).ToList() : null;
 | 
					                                            var imageNames = or.lorf.Count > 0 ? or.lorf.Where(x => x.ori_file_name.Contains("JPG") || x.ori_file_name.Contains("PNG")).Select(x => x.save_file_name).ToList() : null;
 | 
				
			||||||
                                            if (imageNames != null)
 | 
					                                            if (imageNames != null)
 | 
				
			||||||
                                            {
 | 
					                                            {
 | 
				
			||||||
                                                //insert image process
 | 
					                                                //insert image process
 | 
				
			||||||
@ -721,7 +729,7 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                        if (i == 10)
 | 
					                                        if (i == 10)
 | 
				
			||||||
                                        {
 | 
					                                        {
 | 
				
			||||||
                                        cell.SetCellValue(or.Created_at);
 | 
					                                            cell.SetCellValue(or.Created_at == "null" ? "" : or.Created_at);
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                        cell.CellStyle = style12;
 | 
					                                        cell.CellStyle = style12;
 | 
				
			||||||
@ -730,6 +738,7 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    workbook.Write(fs);
 | 
					                    workbook.Write(fs);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
				
			|||||||
@ -596,11 +596,13 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
 | 
					                    await backendRepository.ExecuteSql($"delete from role_auth where role_guid = '{post.SelectedRoleId}' and AuthCode like '%PF%'");
 | 
				
			||||||
                    if (post.SaveCheckAuth.Count > 0)
 | 
					                    if (post.SaveCheckAuth.Count > 0)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        foreach (var item in post.SaveCheckAuth)
 | 
					                        foreach (var item in post.SaveCheckAuth)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            #region 新增權限
 | 
					                            #region 新增權限
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
                                Dictionary<string, object> roleAuth = new Dictionary<string, object>();
 | 
					                                Dictionary<string, object> roleAuth = new Dictionary<string, object>();
 | 
				
			||||||
                                roleAuth = new Dictionary<string, object>()
 | 
					                                roleAuth = new Dictionary<string, object>()
 | 
				
			||||||
                                    {
 | 
					                                    {
 | 
				
			||||||
@ -610,6 +612,7 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
                                    };
 | 
					                                    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                await backendRepository.AddOneByCustomTable(roleAuth, "role_auth");
 | 
					                                await backendRepository.AddOneByCustomTable(roleAuth, "role_auth");
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
                            #endregion
 | 
					                            #endregion
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
				
			|||||||
@ -16,9 +16,9 @@
 | 
				
			|||||||
    "MySqlDBConfig": {
 | 
					    "MySqlDBConfig": {
 | 
				
			||||||
      "Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201
 | 
					      "Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201
 | 
				
			||||||
      "Port": "js2LutKe+rdjzdxMPQUrvQ==",
 | 
					      "Port": "js2LutKe+rdjzdxMPQUrvQ==",
 | 
				
			||||||
      //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30
 | 
					      "Database": "VJB2XC+lAtzuHObDGMVOAA==", //30
 | 
				
			||||||
      //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp
 | 
					      //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp
 | 
				
			||||||
      "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome
 | 
					      //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome
 | 
				
			||||||
      //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel
 | 
					      //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel
 | 
				
			||||||
      //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office
 | 
					      //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office
 | 
				
			||||||
      //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT
 | 
					      //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT
 | 
				
			||||||
 | 
				
			|||||||
										
											Binary file not shown.
										
									
								
							
		Loading…
	
		Reference in New Issue
	
	Block a user