This commit is contained in:
geh 2025-05-06 15:21:24 +08:00
parent 5d52ebd488
commit 6a7a44f9da
5 changed files with 42 additions and 13 deletions

View File

@ -281,7 +281,6 @@ namespace BLL
CompanyComprehensivePlanNum = companyComprehensivePlanList.Count(x => x.UnitId == _unitId),
CompanySpecialPlanNum = companySpecialPlanList.Count(x => x.UnitId == _unitId),
CompanyOnSiteDisposalPlan = companyOnSiteDisposalPlanList.Count(x => x.UnitId == _unitId),
CompanyDrillNum = companyDrillList.Count(x => x.UnitId.Contains(_unitId)),
ProjectComprehensivePlanNum = projectComprehensivePlanList.Count(x => _beUnderConstructionList.Contains(x.ProjectId)),
ProjectSpecialPlanNum = projectSpecialPlanList.Count(x => _beUnderConstructionList.Contains(x.ProjectId)),
ProjectOnSiteDisposalPlan = projectOnSiteDisposalPlanList.Count(x => _beUnderConstructionList.Contains(x.ProjectId)),
@ -309,6 +308,11 @@ namespace BLL
SuperConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperConstructionNum)
};
if (!string.IsNullOrEmpty(_unitId))
{
table.CompanyDrillNum = companyDrillList.Count(x => x.UnitId.Contains(_unitId));
}
if (_unitType == 0)
{
table.BeUnderConstructionNum = beUnderConstructionList.Count();

View File

@ -1006,11 +1006,11 @@ namespace FineUIPro.Web.HSSE.SitePerson
// JValueCount = sysTestRule.JValue * getIsTrueItem.Count; //总分
}
if (!string.IsNullOrEmpty(sign1))
if (!string.IsNullOrEmpty(Signature))
{
helper.AddImage(rootPath + sign1, "sign1", 50, 25, 15, 30);
helper.AddImage(rootPath + sign1, "sign1_1", 50, 25, 15, 30);
helper.AddImage(rootPath + sign1, "sign1_2", 50, 25, 15, 30);
helper.AddImage(rootPath + Signature, "sign1", 50, 25, 15, 30);
helper.AddImage(rootPath + Signature, "sign1_1", 50, 25, 15, 30);
helper.AddImage(rootPath + Signature, "sign1_2", 50, 25, 15, 30);
}
else
{
@ -1259,7 +1259,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
object[] fieldValues = { };
if (!string.IsNullOrEmpty(Signature))
{
helper.AddImage(rootPath + Signature, "testName", 50, 25, 10, 5);
helper.AddImage(rootPath + Signature, "testName", 50, 25, 30, 5);
fieldNames = new[]
{
"projectName", "name", "time", "sex", "InTime", "sign",

View File

@ -88,7 +88,7 @@ namespace WebAPI.Controllers.HSSE
Model.ToDoItem toDoItem = new Model.ToDoItem
{
MenuId = Const.PersonListMenuId,
DataId = item.PersonId + "_1",
DataId = item.PersonId + "_2",
UrlStr = item.AttachUrl1,
};
if (!string.IsNullOrEmpty(item.AttachUrl1))
@ -96,21 +96,21 @@ namespace WebAPI.Controllers.HSSE
APIUpLoadFileService.SaveAttachUrl(toDoItem);
}
toDoItem.DataId = item.PersonId + "_2";
toDoItem.DataId = item.PersonId + "_3";
toDoItem.UrlStr = item.AttachUrl2;
if (!string.IsNullOrEmpty(item.AttachUrl2))
{
APIUpLoadFileService.SaveAttachUrl(toDoItem);
}
toDoItem.DataId = item.PersonId + "_3";
toDoItem.DataId = item.PersonId + "_4";
toDoItem.UrlStr = item.AttachUrl3;
if (!string.IsNullOrEmpty(item.AttachUrl3))
{
APIUpLoadFileService.SaveAttachUrl(toDoItem);
}
toDoItem.DataId = item.PersonId + "_4";
toDoItem.DataId = item.PersonId + "_5";
toDoItem.UrlStr = item.AttachUrl4;
if (!string.IsNullOrEmpty(item.AttachUrl4))
{

View File

@ -641,8 +641,11 @@ namespace WebAPI.Controllers
/// 岗位交卷
/// <param name="testRecordId">试卷ID</param>
/// </summary>
public Model.ResponeData SaveSubmitTestRecord(string testRecordId,string Signature)
[HttpPost]
public Model.ResponeData postSubmitTestRecord(Model.TestRecordItem testRecordItem)
{
string testRecordId = testRecordItem.TestRecordId;
string Signature = testRecordItem.Signature;
var responeData = new Model.ResponeData();
try
{
@ -653,9 +656,31 @@ namespace WebAPI.Controllers
var getTestRecord = db.Training_TestRecord.FirstOrDefault(e => e.TestRecordId == testRecordId);
if (getTestRecord != null)
{
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
string SignatureUrl = @"FileUpload\TestRecord\" + getTestRecord.TestRecordId + "~签名" + ".png";
string Signaturefilename = rootUrl + SignatureUrl;
if (getTestRecord.TestStartTime.HasValue)
{
getTestRecord.Signature = Signature;
if (!string.IsNullOrEmpty(Signature))
{
Signature = Signature.Replace("data:image/svg+xml;base64,", "").Replace("data:image/png;base64,", "").Replace("data:image/jgp;base64,", "").Replace("data:image/jpg;base64,", "").Replace("data:image/jpeg;base64,", "");//将base64头部信息替换
byte[] bytes = Convert.FromBase64String(Signature);
MemoryStream memStream = new MemoryStream(bytes);
Image mImage = Image.FromStream(memStream);
Bitmap bp = new Bitmap(mImage);
MemoryStream ms = new MemoryStream();
// 确保目录存在
string directory = Path.GetDirectoryName(Signaturefilename);
if (!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
bp.Save(Signaturefilename, System.Drawing.Imaging.ImageFormat.Png);
getTestRecord.Signature = Signaturefilename.Replace(rootUrl, "");
}
getTestRecord.TestEndTime = DateTime.Now;
getTestRecord.TestScores = db.Training_TestRecordItem.Where(x => x.TestRecordId == testRecordId).Sum(x => x.SubjectScore ?? 0);
db.SubmitChanges();

View File

@ -158,7 +158,7 @@ namespace WebAPI.Filter
, "TestRecord*getTestRecordItemListByTestRecordId"
, "TestRecord*getTestTimesByTestRecordId"
, "TestRecord*getTestRecordItemAnswerBySelectedItem"
, "TestRecord*SaveSubmitTestRecord"
, "TestRecord*postSubmitTestRecord"
};
/// <summary>