This commit is contained in:
PastSaid
2025-01-01 08:21:58 +08:00
parent 9725ab5376
commit 3d15fd4b7e
59 changed files with 3013 additions and 1324 deletions

View File

@@ -49,16 +49,18 @@ namespace GZ.LJY000.PiLot.SAL_OUTSTOCK.UploadExtension
this.View.ShowErrMessage("文件未加载完毕!");
return;
}
if (e.Key.EndsWith("FDoUpLoad", StringComparison.OrdinalIgnoreCase))
{
var entity = this.View.Model.BillBusinessInfo.GetEntryEntity("FEntity");
var rows = this.View.Model.GetEntityDataObject(entity);
if (rows != null && rows.Any())
{
var path = HttpContext.Current.Request.PhysicalApplicationPath + @"\FileUpLoadServices\UploadFiles\";
//var path = HttpContext.Current.Request.PhysicalApplicationPath + @"\FileUpLoadServices\UploadFiles\";
var path = HttpContext.Current.Request.PhysicalApplicationPath + @"/FileUpLoadServices/UploadFiles/";
if (!this.Context.DBId.Equals("6735f10547df64"))
path = "D:/Program Files (x86)/Kingdee/K3Cloud/WebSite/FileUpLoadServices/UploadFiles/";
//if (!this.Context.DBId.Equals("6735f10547df64"))
// path = "D:/Program Files (x86)/Kingdee/K3Cloud/WebSite/FileUpLoadServices/UploadFiles/";
foreach (var row in rows)
{
@@ -101,7 +103,7 @@ namespace GZ.LJY000.PiLot.SAL_OUTSTOCK.UploadExtension
Rect region = new Rect(x, y, width, height);
resData = DecodeQRCodes(src, region, false);
resData = DecodeQRCodes(src, region, true);
}
}
}
@@ -118,7 +120,7 @@ namespace GZ.LJY000.PiLot.SAL_OUTSTOCK.UploadExtension
int height = srcHeight / 2;
Rect region = new Rect(x, y, width, height);
resData = DecodeQRCodes(src, region, false);
resData = DecodeQRCodes(src, region, true);
}
if (resData != null)
@@ -132,12 +134,19 @@ namespace GZ.LJY000.PiLot.SAL_OUTSTOCK.UploadExtension
var base64 = FileToBase64String(fullName);
var resultJson = DoAttachmentUpload("SAL_OUTSTOCK", fileName, resData.name, fileBytesLength, fileSuffix, base64);
var result = JsonConvert.DeserializeObject<JToken>(resultJson);
//var result = resultJson as JObject;
var responseData = result["Result"]["ResponseStatus"];
isSuccess = responseData["IsSuccess"].Value<bool>();
if (resultJson != null)
{
var result = JsonConvert.DeserializeObject<JToken>(resultJson);
//var result = resultJson as JObject;
var responseData = result["Result"]["ResponseStatus"];
isSuccess = responseData["IsSuccess"].Value<bool>();
resMsg = JsonConvert.SerializeObject(responseData);
resMsg = JsonConvert.SerializeObject(responseData);
}
else
{
resMsg = "识别单号找不到对应销售出库单!";
}
}
if (isSuccess)
@@ -150,11 +159,18 @@ namespace GZ.LJY000.PiLot.SAL_OUTSTOCK.UploadExtension
{
if (resMsg.IsNullOrEmpty())
resMsg = "识别失败!";
row["FisSucceed"] = false;
row["FResultMsg"] = resMsg;
this.View.GetControl("FFileName").SetCustomPropertyValue("ForeColor", "#FF3300");
}
}
else
{
row["FisSucceed"] = false;
row["FResultMsg"] = "未知错误导致识别失败!";
this.View.GetControl("FFileName").SetCustomPropertyValue("ForeColor", "#FF3300");
}
}
//fileUploaded = false;
@@ -287,17 +303,29 @@ namespace GZ.LJY000.PiLot.SAL_OUTSTOCK.UploadExtension
billNo = "ZHBR-XSCKD240911002";
var InterId = 0L;
var formBillNo = "";
var sqlL = $@"/*dialect*/
SELECT t0.FBILLNO,t0.FID
SELECT t0.FBILLNO,t0.FID,t0e.FENTRYID,t0e.FSEQ,t0e_lk.FSTABLENAME,t0e_lk.FSBILLID
FROM T_SAL_OUTSTOCK t0
WHERE t0.FBILLNO = '{billNo}'
INNER JOIN T_SAL_OUTSTOCKENTRY t0e on t0.FID = t0e.FID
INNER JOIN T_SAL_OUTSTOCKENTRY_LK t0e_lk on t0e_lk.FENTRYID = t0e.FENTRYID
AND t0e_lk.FSTABLENAME = 'T_SAL_DELIVERYNOTICEENTRY'
INNER JOIN T_SAL_DELIVERYNOTICE t1 on t1.FID = t0e_lk.FSBILLID
WHERE t1.FBILLNO = '{billNo}'
";
var data = DBServiceHelper.ExecuteDynamicObject(this.Context, sqlL);
if (data != null && data.Any())
{
InterId = data[0]["FID"].Long2Int();
formBillNo = data[0]["FBILLNO"].ToString();
}
else
{
return null;
}
var fileSql = @"/*dialect*/
SELECT *
@@ -316,7 +344,7 @@ ORDER BY FENABLE DESC";
""FormId"": ""{formId}"",
""IsLast"": true,
""InterId"": {InterId},
""BillNO"": ""{billNo}"",
""BillNO"": ""{formBillNo}"",
""AliasFileName"": """",
""SendByte"": ""{base64}""
}}
@@ -333,7 +361,7 @@ ORDER BY FENABLE DESC";
""FAttachmentName"": ""{fileName}"",
""FBillType"": ""{formId}"",
""FInterID"": ""{InterId}"",
""FBillNo"": ""{billNo}"",
""FBillNo"": ""{formBillNo}"",
""FAttachmentSize"": {fileBytesLength},
""FAttachment"":""{base64}"",
""FFILESTORAGE"":0,
@@ -381,7 +409,7 @@ ORDER BY FENABLE DESC";
var row = new DynamicObject(entity.DynamicObjectType);
var fileName = fileInfo["FileName"].ToString();
var suffix = Path.GetExtension(fileName);
if (suffix.ToUpper().Equals(".PDF")|| suffix.ToUpper().Equals(".JPG"))
if (suffix.ToUpper().Equals(".PDF") || suffix.ToUpper().Equals(".JPG"))
{
row["FFileName"] = fileName;
row["FServerFileName"] = fileInfo["ServerFileName"];