531 lines
16 KiB
ObjectPascal
531 lines
16 KiB
ObjectPascal
|
|
unit U_BXListChk;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
|||
|
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, StdCtrls,
|
|||
|
|
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
|||
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
|||
|
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
|||
|
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
|||
|
|
IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit,
|
|||
|
|
cxTextEdit, cxDBLookupComboBox, cxContainer, cxDropDownEdit, cxPC, Menus,
|
|||
|
|
TeEngine, Series, TeeProcs, Chart, DbChart, GanttCh, cxLookAndFeels,
|
|||
|
|
cxLookAndFeelPainters, cxNavigator, dxCore, ActiveX, dxBarBuiltInMenu, U_SLT,
|
|||
|
|
jpeg, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint,
|
|||
|
|
dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide,
|
|||
|
|
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
|||
|
|
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
|||
|
|
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
|||
|
|
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
|||
|
|
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
|||
|
|
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
|||
|
|
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
|||
|
|
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin,
|
|||
|
|
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
|
|||
|
|
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
|
|||
|
|
dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine,
|
|||
|
|
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmBXListChk = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
ClientDataSet1: TClientDataSet;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
v1XH: TcxGridDBColumn;
|
|||
|
|
v1FXH: TcxGridDBColumn;
|
|||
|
|
v2Column7: TcxGridDBColumn;
|
|||
|
|
Tv1Column2: TcxGridDBColumn;
|
|||
|
|
Tv1Column3: TcxGridDBColumn;
|
|||
|
|
v2Column15: TcxGridDBColumn;
|
|||
|
|
v1Column5: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
Panel10: TPanel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
BegDate: TDateTimePicker;
|
|||
|
|
EndDate: TDateTimePicker;
|
|||
|
|
cxTabControl1: TcxTabControl;
|
|||
|
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
|
Tv1Column4: TcxGridDBColumn;
|
|||
|
|
Tv1Column5: TcxGridDBColumn;
|
|||
|
|
Tv1Column6: TcxGridDBColumn;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
DeptName: TEdit;
|
|||
|
|
FeeType: TEdit;
|
|||
|
|
FeeName: TEdit;
|
|||
|
|
Filler: TEdit;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
DFDW: TEdit;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
FPBH: TEdit;
|
|||
|
|
Tv1Column7: TcxGridDBColumn;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
ToolButton4: TToolButton;
|
|||
|
|
Tv1Column8: TcxGridDBColumn;
|
|||
|
|
Tv1Column9: TcxGridDBColumn;
|
|||
|
|
Tv1Column10: TcxGridDBColumn;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
GroupBox1: TGroupBox;
|
|||
|
|
ScrollBox1: TScrollBox;
|
|||
|
|
adoqueryPicture: TADOQuery;
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
|
procedure C_CodeNameChange(Sender: TObject);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure DeptNameChange(Sender: TObject);
|
|||
|
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
|
procedure ToolButton4Click(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
private
|
|||
|
|
|
|||
|
|
{ Private declarations }
|
|||
|
|
procedure InitGrid();
|
|||
|
|
procedure InitImage();
|
|||
|
|
public
|
|||
|
|
canshu1: string;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmBXListChk: TfrmBXListChk;
|
|||
|
|
Mach: array of TfrmSlt;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_RTFun;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.InitGrid();
|
|||
|
|
begin
|
|||
|
|
Panel10.Visible := True;
|
|||
|
|
Panel10.Refresh;
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select A.*,B.HSID ');
|
|||
|
|
SQL.Add(',WChker=[dbo].[F_Get_Order_SubStr](A.HMID,''BXWChk'') from Bx_HxMain A ');
|
|||
|
|
SQL.Add(' inner join Bx_HxSub B on A.HMid=B.HMid');
|
|||
|
|
sql.Add(' where A.Filltime>=:begdate and A.FillTime<:enddate');
|
|||
|
|
sql.Add(' and (isnull(B.Chker,'''')='''+Trim(DName)+''' or isnull(ChkerHZ,'''')=''<27>'') ');
|
|||
|
|
if cxTabControl1.TabIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
sql.Add('and isnull(B.ChkStatus,'''')<>''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
end
|
|||
|
|
else if cxTabControl1.TabIndex = 1 then
|
|||
|
|
begin
|
|||
|
|
sql.Add('and isnull(B.ChkStatus,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
end;
|
|||
|
|
Parameters.ParamByName('begdate').Value := Trim(FormatDateTime('yyyy-MM-dd', BegDate.Date));
|
|||
|
|
Parameters.ParamByName('enddate').Value := Trim(FormatDateTime('yyyy-MM-dd', enddate.Date + 1));
|
|||
|
|
// ShowMessage(sql.text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, ClientDataSet1);
|
|||
|
|
SInitCDSData20(ADOQueryMain, ClientDataSet1);
|
|||
|
|
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
Panel10.Visible := False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmBXListChk := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
var
|
|||
|
|
i, j: integer;
|
|||
|
|
begin
|
|||
|
|
j := length(Mach);
|
|||
|
|
if j > 0 then
|
|||
|
|
begin
|
|||
|
|
for i := 0 to j - 1 do
|
|||
|
|
begin
|
|||
|
|
Mach[i].free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
SetLength(Mach, 0);
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('Tv1', Tv1, Self.Caption);
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ReadCxGrid('Tv1', Tv1, Self.Caption);
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.ToolButton2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.Active then
|
|||
|
|
begin
|
|||
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel2, 1, 2));
|
|||
|
|
SCreateCDS20(ADOQueryMain, ClientDataSet1);
|
|||
|
|
SInitCDSData20(ADOQueryMain, ClientDataSet1);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.C_CodeNameChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.FormCreate(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FYear: string;
|
|||
|
|
FMonth: string;
|
|||
|
|
FDate: TDate;
|
|||
|
|
begin
|
|||
|
|
{FDate:=SGetServerDate10(ADOQueryTemp);
|
|||
|
|
FYear:=FormatDateTime('yyyy',FDate);
|
|||
|
|
FMonth:=FormatDateTime('MM',FDate);
|
|||
|
|
if StrToInt(FMonth)<2 then
|
|||
|
|
begin
|
|||
|
|
BegDate.Date:=StrToDate(IntToStr(strtoint(FYear)-1)+'-02-01');
|
|||
|
|
//EndDate.Date:=StrToDate(FYear+'-01-31');
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
BegDate.Date:=StrToDate(FYear+'-02-01');
|
|||
|
|
//EndDate.Date:=StrToDate(IntToStr(strtoint(FYear)+1)+'-01-31');
|
|||
|
|
end; }
|
|||
|
|
EndDate.Date := SGetServerDate(ADOQueryTemp);
|
|||
|
|
BegDate.Date := EndDate.Date - 30;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.cxTabControl1Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if ClientDataSet1.Locate('SSel', True, []) = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while Locate('SSel', False, []) do
|
|||
|
|
begin
|
|||
|
|
Delete;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
TcxGridToExcel('<27><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD>б<EFBFBD>', cxGrid1);
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.DeptNameChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.ToolButton3Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FSJ,FSJ1:String;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if cxTabControl1.TabIndex <> 0 then
|
|||
|
|
Exit;
|
|||
|
|
if ClientDataSet1.Locate('SSel', True, []) = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while ClientDataSet1.Locate('SSel', True, []) do
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' update Bx_HxSub set ChkTime=getdate(),ChkStatus=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' where HSID=''' + Trim(ClientDataSet1.fieldbyname('HSID').AsString) + ''' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select Top 1 * from Bx_HxSub where isnull(ChkStatus,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' and HMID=''' + Trim(ClientDataSet1.fieldbyname('HMID').AsString) + ''' ');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
FSJ:=Trim(ADOQueryCmd.fieldbyname('ChkStatus').AsString);
|
|||
|
|
if Trim(FSJ)='' then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' update Bx_HxMain set ChkTime=getdate(),ChkStatus=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',Chker='''+Trim(DName)+''',chkcode='''+Trim(DCode)+'''');
|
|||
|
|
sql.Add(',Step=(select Chkint from Bx_HxSub where HSID='''+Trim(ClientDataSet1.fieldbyname('HSID').AsString)+''')');
|
|||
|
|
sql.Add(' where HMID=''' + Trim(ClientDataSet1.fieldbyname('HMID').AsString) + ''' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select Top 1 * from Bx_HxSub where isnull(ChkStatus,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' and HMID=''' + Trim(ClientDataSet1.fieldbyname('HMID').AsString) + ''' ');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
FSJ1:=Trim(ADOQueryCmd.fieldbyname('ChkStatus').AsString);
|
|||
|
|
if (Trim(FSJ)<>'') and (Trim(FSJ1)<>'') then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' update Bx_HxMain set ChkTime=getdate(),ChkStatus=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',Chker='''+Trim(DName)+''',chkcode='''+Trim(DCode)+'''');
|
|||
|
|
sql.Add(',Step=(select Chkint from Bx_HxSub where HSID='''+Trim(ClientDataSet1.fieldbyname('HSID').AsString)+''')');
|
|||
|
|
sql.Add(' where HMID=''' + Trim(ClientDataSet1.fieldbyname('HMID').AsString) + ''' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.Delete;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.ToolButton4Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FSJ,FSJ1,FSJ2:String;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if cxTabControl1.TabIndex <> 1 then
|
|||
|
|
Exit;
|
|||
|
|
if ClientDataSet1.Locate('SSel', True, []) = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while ClientDataSet1.Locate('SSel', True, []) do
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' update Bx_HxSub set ChkTime=getdate(),ChkStatus=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' where HSID=''' + Trim(ClientDataSet1.fieldbyname('HSID').AsString) + ''' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select Top 1 * from Bx_HxSub where isnull(ChkStatus,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' and HMID=''' + Trim(ClientDataSet1.fieldbyname('HMID').AsString) + ''' ');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
FSJ:=Trim(ADOQueryCmd.fieldbyname('ChkStatus').AsString);
|
|||
|
|
if Trim(FSJ)='' then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' update Bx_HxMain set ChkTime=Null,ChkStatus=''<27><><EFBFBD>ύ'',Chker=Filler,chkcode=FillCode');
|
|||
|
|
sql.Add(',Step=0');
|
|||
|
|
sql.Add(' where HMID=''' + Trim(ClientDataSet1.fieldbyname('HMID').AsString) + ''' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select Top 1 * from Bx_HxSub where isnull(ChkStatus,'''')=''δ<><CEB4><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' and HMID=''' + Trim(ClientDataSet1.fieldbyname('HMID').AsString) + ''' ');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
FSJ1:=Trim(ADOQueryCmd.fieldbyname('ChkStatus').AsString);
|
|||
|
|
if (Trim(FSJ)<>'') and (Trim(FSJ1)<>'') then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select ChkInt=Chkint-1 from Bx_HxSub ');
|
|||
|
|
sql.Add(' where HSID=''' + Trim(ClientDataSet1.fieldbyname('HSID').AsString) + ''' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FSJ2:=Trim(ADOQueryCmd.fieldbyname('ChkInt').AsString);
|
|||
|
|
if StrToInt(FSJ2)>0 then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' update Bx_HxMain set ChkStatus=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',Step='+Trim(FSJ2));
|
|||
|
|
sql.Add(',ChkTime=(select ChkTime from Bx_HxSub where HMID='''+ Trim(ClientDataSet1.fieldbyname('HMID').AsString)+''' and ChkInt='+FSJ2+' ),');
|
|||
|
|
sql.Add(',Chker=(select Chker from Bx_HxSub where HMID='''+ Trim(ClientDataSet1.fieldbyname('HMID').AsString)+''' and ChkInt='+FSJ2+' ) ');
|
|||
|
|
sql.Add(' where HMID=''' + Trim(ClientDataSet1.fieldbyname('HMID').AsString) + ''' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.Delete;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNoFilter(Tv1, True);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNoFilter(Tv1, False);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.InitImage();
|
|||
|
|
var
|
|||
|
|
i, j: integer;
|
|||
|
|
jpg: TJpegImage;
|
|||
|
|
myStream: TADOBlobStream;
|
|||
|
|
begin
|
|||
|
|
j := length(Mach);
|
|||
|
|
if j > 0 then
|
|||
|
|
begin
|
|||
|
|
for i := 0 to j - 1 do
|
|||
|
|
begin
|
|||
|
|
Mach[i].free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
SetLength(Mach, 0);
|
|||
|
|
if ClientDataSet1.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
try
|
|||
|
|
with adoqueryPicture do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select A.TFID,A.WBID,A.FilesOther,A.FileName,A.url from TP_File A ');
|
|||
|
|
sql.add('where A.WBID=' + quotedstr(trim(ClientDataSet1.fieldbyname('HMID').AsString)));
|
|||
|
|
sql.Add(' and A.TFType=''<27><><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' ');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
j := adoqueryPicture.RecordCount;
|
|||
|
|
if j < 1 then
|
|||
|
|
exit;
|
|||
|
|
adoqueryPicture.DisableControls;
|
|||
|
|
adoqueryPicture.First;
|
|||
|
|
SetLength(Mach, j);
|
|||
|
|
jpg := TJpegImage.Create();
|
|||
|
|
for i := 0 to j - 1 do
|
|||
|
|
begin
|
|||
|
|
if triM(adoqueryPicture.fieldbyname('FilesOther').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
myStream := tadoblobstream.Create(tblobfield(adoqueryPicture.fieldbyname('FilesOther')), bmread);
|
|||
|
|
jpg.LoadFromStream(myStream);
|
|||
|
|
Mach[i] := TfrmSlt.Create(Self);
|
|||
|
|
Mach[i].Name := trim(adoqueryPicture.fieldbyname('TFID').AsString);
|
|||
|
|
Mach[i].Parent := ScrollBox1;
|
|||
|
|
Mach[i].Left := 0 + i * 165;
|
|||
|
|
Mach[i].Init(adoqueryPicture.fieldbyname('TFID').AsString, adoqueryPicture.fieldbyname('FileName').AsString, adoqueryPicture.fieldbyname('url').AsString, jpg);
|
|||
|
|
end;
|
|||
|
|
adoqueryPicture.Next;
|
|||
|
|
end;
|
|||
|
|
adoqueryPicture.EnableControls;
|
|||
|
|
finally
|
|||
|
|
jpg.free;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBXListChk.Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
InitImage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|