1. 暫時簽入2

This commit is contained in:
Kai 2021-08-25 18:25:06 +08:00
parent c2c9df6f36
commit c8f605168c
5 changed files with 22 additions and 13 deletions

View File

@ -540,6 +540,7 @@ namespace SolarPower.Controllers
WorkType = (int)OperationRecodeWorkTypeEnum.Fix, WorkType = (int)OperationRecodeWorkTypeEnum.Fix,
ErrorCode = post.ErrorCode, ErrorCode = post.ErrorCode,
FixDo = post.FixDo, FixDo = post.FixDo,
FixFirm = post.FixFirm,
Status = post.Status, Status = post.Status,
WorkPersonId = post.WorkPersonId, WorkPersonId = post.WorkPersonId,
FinishTime = finishTime, FinishTime = finishTime,
@ -557,6 +558,7 @@ namespace SolarPower.Controllers
"WorkType", "WorkType",
"ErrorCode", "ErrorCode",
"FixDo", "FixDo",
"FixFirm",
"Status", "Status",
"WorkPersonId", "WorkPersonId",
"FinishTime", "FinishTime",
@ -609,6 +611,7 @@ namespace SolarPower.Controllers
Id = post.Id, Id = post.Id,
ErrorCode = post.ErrorCode, ErrorCode = post.ErrorCode,
FixDo = post.FixDo, FixDo = post.FixDo,
FixFirm = post.FixFirm,
Status = post.Status, Status = post.Status,
FinishTime = !string.IsNullOrEmpty(finishTime) ? finishTime : null, FinishTime = !string.IsNullOrEmpty(finishTime) ? finishTime : null,
WorkPersonId = post.WorkPersonId, WorkPersonId = post.WorkPersonId,
@ -625,6 +628,7 @@ namespace SolarPower.Controllers
"Id", "Id",
"ErrorCode", "ErrorCode",
"FixDo", "FixDo",
"FixFirm",
"Status", "Status",
"FinishTime", "FinishTime",
"WorkTime", "WorkTime",

View File

@ -2159,6 +2159,10 @@ ALTER TABLE `device`
ADD COLUMN `WarrantyDate` TIMESTAMP NULL DEFAULT NULL COMMENT '保固日期' AFTER `InstallDate`, ADD COLUMN `WarrantyDate` TIMESTAMP NULL DEFAULT NULL COMMENT '保固日期' AFTER `InstallDate`,
ADD COLUMN `BrandNum` VARCHAR(50) NULL DEFAULT NULL COMMENT '廠商序號' AFTER `Brand`; ADD COLUMN `BrandNum` VARCHAR(50) NULL DEFAULT NULL COMMENT '廠商序號' AFTER `Brand`;
-- 新增運維作業紀錄加入廠商 20210825
ALTER TABLE `operation_record`
ADD COLUMN `FixFirm` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '負責廠商' AFTER `FixDo`;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */; /*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;

View File

@ -134,6 +134,7 @@ namespace SolarPower.Models
public byte WorkType { get; set; } public byte WorkType { get; set; }
public string ErrorCode { get; set; } public string ErrorCode { get; set; }
public string FixDo { get; set; } public string FixDo { get; set; }
public byte FixFirm { get; set; }
public byte Status { get; set; } public byte Status { get; set; }
public int WorkPersonId { get; set; } public int WorkPersonId { get; set; }
public string StartTime public string StartTime
@ -281,6 +282,7 @@ namespace SolarPower.Models
public byte WorkType { get; set; } public byte WorkType { get; set; }
public string ErrorCode { get; set; } public string ErrorCode { get; set; }
public string FixDo { get; set; } public string FixDo { get; set; }
public byte FixFirm { get; set; }
public byte Status { get; set; } public byte Status { get; set; }
public int WorkPersonId { get; set; } public int WorkPersonId { get; set; }
public string StartTime { get; set; }//開始時間 public string StartTime { get; set; }//開始時間
@ -298,6 +300,7 @@ namespace SolarPower.Models
public string SerialNumber { get; set; } public string SerialNumber { get; set; }
public string ErrorCode { get; set; } public string ErrorCode { get; set; }
public string FixDo { get; set; } public string FixDo { get; set; }
public byte FixFirm { get; set; }
public byte Status { get; set; } public byte Status { get; set; }
public int WorkPersonId { get; set; } public int WorkPersonId { get; set; }
public string FinishTime { get; set; } // 完成時間 public string FinishTime { get; set; } // 完成時間

View File

@ -1569,19 +1569,18 @@ namespace SolarPower.Repository.Implement
} }
} }
public async Task<List<FirmlSelectItemList>> GetFirmlSelectOptionListAsync(int powerStationId) public async Task<List<FirmlSelectItemList>> GetFimlSelectOptionListAsync(int powerStationId, string siteDB)
{ {
List<FirmlSelectItemList> result; List<FirmlSelectItemList> result;
using (IDbConnection conn = this._databaseHelper.GetConnection()) using (IDbConnection conn = this._databaseHelper.GetConnection())
{ {
try try
{ {
var sql = @$"SELECT u.Id AS Value, u.Name AS Text var sql = @$"SELECT aa.Id AS Value, aa.Name AS Text
FROM power_station_operation_personnel op FROM {siteDB}.operation_firm aa
LEFT JOIN user u ON op.UserId = u.Id WHERE aa.Deleted = 0 AND aa.PowerStationId = @PowerStationId";
WHERE op.Deleted = 0 AND op.PowerStationId = @PowerStationId";
result = (await conn.QueryAsync<OperationPersonnelSelectItemList>(sql, new { PowerStationId = powerStationId })).ToList(); result = (await conn.QueryAsync<FirmlSelectItemList>(sql, new { PowerStationId = powerStationId })).ToList();
} }
catch (Exception exception) catch (Exception exception)
{ {

View File

@ -204,7 +204,7 @@
<div class="col-lg-6"> <div class="col-lg-6">
<div class="form-group"> <div class="form-group">
<label class="form-label" for="fix_firm_modal">負責廠商</label> <label class="form-label" for="fix_firm_modal">負責廠商</label>
<select></select> <select class="form-control" id="fix_firm_select_modal"></select>
</div> </div>
</div> </div>
</div> </div>
@ -398,17 +398,15 @@
return; return;
} }
$("#work_person_select_modal").empty(); $("#fix_firm_select_modal").empty();
if (rel.data.length > 0) { if (rel.data.length > 0) {
$.each(rel.data, function (index, val) { $.each(rel.data, function (index, val) {
$("#work_person_select_modal").append($("<option />").val(val.value).text(val.text)); $("#fix_firm_select_modal").append($("<option />").val(val.value).text(val.text));
}); });
if (recode != null || recode != undefined) {
$("#work_person_select_modal").val(recode.workPersonId);
}
} }
$("#fix_firm_select_modal").val($("#fix_firm_select_modal option:first").val()).trigger('change');
}); });
}); });
//#endregion //#endregion
@ -882,6 +880,7 @@
formData.append("WorkType", selected_work_type); formData.append("WorkType", selected_work_type);
formData.append("ErrorCode", $("#error_code_modal").val()); formData.append("ErrorCode", $("#error_code_modal").val());
formData.append("FixDo", $("#fix_do_modal").val()); formData.append("FixDo", $("#fix_do_modal").val());
formData.append("FixFirm", $("#fix_firm_select_modal").val());
formData.append("Status", $("input[name=status_modal]:checked").val()); formData.append("Status", $("input[name=status_modal]:checked").val());
formData.append("WorkPersonId", $("#work_person_select_modal").val()); formData.append("WorkPersonId", $("#work_person_select_modal").val());
formData.append("WorkTime", $("#work_time_modal").val()); formData.append("WorkTime", $("#work_time_modal").val());