[後端] 調整ope controller api

This commit is contained in:
dev02 2023-10-05 17:57:38 +08:00
parent 22396c5736
commit 2168ebd759
2 changed files with 9 additions and 8 deletions

View File

@ -24,6 +24,7 @@ using System.Threading.Tasks;
using Image = System.Drawing.Image; using Image = System.Drawing.Image;
using System.IdentityModel.Tokens.Jwt; using System.IdentityModel.Tokens.Jwt;
using System.Net; using System.Net;
using System.Data.SqlTypes;
namespace FrontendWebApi.ApiControllers namespace FrontendWebApi.ApiControllers
{ {
@ -206,7 +207,7 @@ namespace FrontendWebApi.ApiControllers
try try
{ {
var sqlString = @$"select device_number, concat(device_floor_tag, ' ', full_name) as device_name, full_name, device_floor_tag, device_system_tag, device_name_tag var sqlString = @$"select device_number, concat(device_floor_tag, ' ', full_name) as device_name, full_name, device_floor_tag, device_system_tag, device_name_tag
from device where deleted = 0 and device_area_tag = @device_area_tag and device_building_tag = @device_building_tag and device_name_tag in @list_sub_system_tag "; from device where deleted = 0 and device_area_tag = @device_area_tag and device_name_tag in @list_sub_system_tag ";
var param = new { @device_building_tag = bl.device_building_tag, @device_area_tag = bl.device_area_tag, @list_sub_system_tag = bl.list_sub_system_tag }; var param = new { @device_building_tag = bl.device_building_tag, @device_area_tag = bl.device_area_tag, @list_sub_system_tag = bl.list_sub_system_tag };
@ -769,7 +770,7 @@ namespace FrontendWebApi.ApiControllers
List<Operation_Firm> opList = new List<Operation_Firm>(); List<Operation_Firm> opList = new List<Operation_Firm>();
try try
{ {
var sqlString = $@"select id, name from operation_firm where deleted = 0 and device_system_category_layer3 in @sub_system_tag"; var sqlString = $@"select id, name from operation_firm where deleted = 0";
opList = await backendRepository.GetAllAsync<Operation_Firm>(sqlString, new { @sub_system_tag = ofl.sub_system_tag }); opList = await backendRepository.GetAllAsync<Operation_Firm>(sqlString, new { @sub_system_tag = ofl.sub_system_tag });
apiResult.Code = "0000"; apiResult.Code = "0000";
@ -1226,8 +1227,8 @@ namespace FrontendWebApi.ApiControllers
{ "@device_system_category_layer3", or.device_system_category_layer3}, { "@device_system_category_layer3", or.device_system_category_layer3},
{ "@work_type", or.work_type}, { "@work_type", or.work_type},
{ "@error_code", or.error_code}, { "@error_code", or.error_code},
{ "@fix_do", or.fix_do}, { "@fix_do", or.fix_do == "null" ? "" : or.fix_do },
{ "@fix_do_code", or.fix_do_code }, { "@fix_do_code", or.fix_do_code == "null" ? "" : or.fix_do_code },
{ "@fix_firm", or.fix_firm}, { "@fix_firm", or.fix_firm},
{ "@status", or.status}, { "@status", or.status},
{ "@work_person_id", or.work_person_id}, { "@work_person_id", or.work_person_id},
@ -1291,8 +1292,8 @@ namespace FrontendWebApi.ApiControllers
{ "@device_system_category_layer2", or.device_system_category_layer2}, { "@device_system_category_layer2", or.device_system_category_layer2},
{ "@device_system_category_layer3", or.device_system_category_layer3}, { "@device_system_category_layer3", or.device_system_category_layer3},
{ "@error_code", or.error_code}, { "@error_code", or.error_code},
{ "@fix_do", or.fix_do}, { "@fix_do", or.fix_do == "null" ? "" : or.fix_do },
{ "@fix_do_code", or.fix_do_code }, { "@fix_do_code", or.fix_do_code == "null" ? "" : or.fix_do_code },
{ "@fix_firm", or.fix_firm}, { "@fix_firm", or.fix_firm},
{ "@status", or.status}, { "@status", or.status},
{ "@work_person_id", or.work_person_id}, { "@work_person_id", or.work_person_id},
@ -1300,8 +1301,8 @@ namespace FrontendWebApi.ApiControllers
{ "@end_time", or.end_time}, { "@end_time", or.end_time},
{ "@work_time", or.work_time}, { "@work_time", or.work_time},
{ "@finish_time", or.finish_time}, { "@finish_time", or.finish_time},
{ "@notice", or.notice}, { "@notice", or.notice == "null" ? null : or.notice},
{ "@description", or.description}, { "@description", or.description == "null" ? null : or.description},
{ "@updated_by", myUser.userinfo_guid}, { "@updated_by", myUser.userinfo_guid},
{ "@updated_at", DateTime.Now} { "@updated_at", DateTime.Now}
}; };