修复批次模板和单张模板bug

This commit is contained in:
强 杨 2023-12-27 09:42:52 +08:00
parent 7edede3395
commit 0ca9debfeb
1 changed files with 31 additions and 20 deletions

View File

@ -23,6 +23,7 @@ using Emgu.CV.Flann;
using System.Data.SqlTypes; using System.Data.SqlTypes;
using System.Security.AccessControl; using System.Security.AccessControl;
using System.Security.Cryptography; using System.Security.Cryptography;
using Microsoft.SqlServer.Server;
public partial class Temp_UserNoPostionTemp : System.Web.UI.Page public partial class Temp_UserNoPostionTemp : System.Web.UI.Page
{ {
@ -392,39 +393,49 @@ public partial class Temp_UserNoPostionTemp : System.Web.UI.Page
try try
{ {
CommonUse commonUse = new CommonUse(); CommonUse commonUse = new CommonUse();
string BatchID = Globals.Request("BatchID");
string GroupNo = Globals.Request("GroupNo");
long TempID = Convert.ToInt64(Globals.Request("TempID")); long TempID = Convert.ToInt64(Globals.Request("TempID"));
string sql = "select * from MK_TempleteDataUser where DetaID_bigint=" + TempID + " AND UserID_bigint=" + UserID; string sql = "select * from MK_TempleteDataUser where DetaID_bigint=" + TempID + " AND UserID_bigint=" + UserID;
if (BatchID != "")
{
sql = @"select * from MK_TempleteDataUserBatch where DetaID_bigint=" + TempID + " AND UserID_bigint=" + UserID;
}
else if (GroupNo != "")
{
sql = @"select * from MK_TempleteDataUserOnePaper where DetaID_bigint=" + TempID + " AND UserID_bigint=" + UserID;
}
DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql); DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql);
if (dt.Rows.Count <= 0) if (dt.Rows.Count <= 0)
{ {
Response.Write("NO DATA"); Response.Write("NO DATA");
return false; return false;
} }
Bitmap PictureBoxBitMap = ImgGet(dt.Rows[0]["TempPicture64_nvarchar"].ToString()); //Bitmap PictureBoxBitMap = ImgGet(dt.Rows[0]["TempPicture64_nvarchar"].ToString());
//var PictureBoxBitMap = commonUse.RotateByOrientation(tempPictureBoxBitMap); ////var PictureBoxBitMap = commonUse.RotateByOrientation(tempPictureBoxBitMap);
if (PictureBoxBitMap == null) //if (PictureBoxBitMap == null)
{ //{
Response.Write("NO PICTURE"); // Response.Write("NO PICTURE");
} //}
string[] GetData = totalHtml.Split('$'); //string[] GetData = totalHtml.Split('$');
string PYPostionList = ""; //string PYPostionList = "";
int width = Convert.ToInt32(GetData[6].Split(',')[0]); //int width = Convert.ToInt32(GetData[6].Split(',')[0]);
int height = Convert.ToInt32(GetData[6].Split(',')[1]); //int height = Convert.ToInt32(GetData[6].Split(',')[1]);
PictureBoxBitMap = ScaleToSize(PictureBoxBitMap, width, height); //PictureBoxBitMap = ScaleToSize(PictureBoxBitMap, width, height);
Image<Gray, byte> imagex = new Image<Gray, byte>(PictureBoxBitMap); //Image<Gray, byte> imagex = new Image<Gray, byte>(PictureBoxBitMap);
Mat mat_threshold1 = new Mat(); //Mat mat_threshold1 = new Mat();
CvInvoke.Threshold(imagex, mat_threshold1, 160, 255, Emgu.CV.CvEnum.ThresholdType.BinaryInv); //CvInvoke.Threshold(imagex, mat_threshold1, 160, 255, Emgu.CV.CvEnum.ThresholdType.BinaryInv);
Mat mat_dilate1 = commonUse.MyDilate(mat_threshold1); //Mat mat_dilate1 = commonUse.MyDilate(mat_threshold1);
VectorOfVectorOfPoint selected_contours1; //VectorOfVectorOfPoint selected_contours1;
selected_contours1 = commonUse.GetUsefulContoursDingWei(mat_dilate1, 1); //selected_contours1 = commonUse.GetUsefulContoursDingWei(mat_dilate1, 1);
Image<Gray, byte> currentFramext = new Image<Gray, byte>(PictureBoxBitMap); //Image<Gray, byte> currentFramext = new Image<Gray, byte>(PictureBoxBitMap);
int PageIndex = Convert.ToInt32(Globals.Request("PageIndex")); //int PageIndex = Convert.ToInt32(Globals.Request("PageIndex"));
//if (PageIndex == 1) //if (PageIndex == 1)
//{ //{
// int mx = GetOtherBitmaplist(currentFramext.Mat, 160, PYPostionList.Split(','), GetData[9]); // int mx = GetOtherBitmaplist(currentFramext.Mat, 160, PYPostionList.Split(','), GetData[9]);