You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

322 lines
11 KiB
Plaintext

unit u_op_close_all;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, bsSkinCtrls,ADODB, BusinessSkinForm;
type
Tfrm_op_close_all = class(TForm)
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox3: TbsSkinCheckRadioBox;
bsSkinButton1: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
yewu: TDataSource;
accept: TDataSource;
pay: TDataSource;
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure select_feng_all();
procedure select_feng_op();
procedure select_feng_fee();
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_op_close_all: Tfrm_op_close_all;
implementation
uses my_sys_chat, u_sys_progress,my_sys_function;
{$R *.dfm}
procedure Tfrm_op_close_all.select_feng_all();
var
can_do:boolean;
p_accmonth:TADOQuery;
dsstr,PostUrl,str:string;
begin
if yewu.DataSet.RecordCount>1 then begin
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(self);
frm_sys_progress.bsSkinGauge1.ProgressText:='正在封帐请等候。。。';
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.MaxValue:=yewu.DataSet.RecordCount;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.Update;
end;
p_accmonth:=createAdoQuery;
yewu.DataSet.First;
while not yewu.DataSet.eof do
begin
if yewu.DataSet.fieldbyname('业务状态').asstring<>'业务封帐' then
begin
yewu.DataSet.edit;
yewu.DataSet['业务状态']:='业务封帐';
yewu.DataSet.post;
{
Send_op_do('业务封帐,业务编号:'+yewu.DataSet.fieldbyname('业务编号').AsString,'41',
yewu.DataSet.fieldbyname('操作员').AsString,
yewu.DataSet.fieldbyname('客服员').AsString,
yewu.DataSet.fieldbyname('揽货人').AsString);
}
end;
if yewu.DataSet.fieldbyname('费用状态').asstring<>'费用封帐' then
begin
can_do:=true;
accept.DataSet.first;
while not accept.DataSet.eof do
begin
if can_do then
begin
if (accept.DataSet.FieldByName('费用状态').asstring<>'审核通过') and
(accept.DataSet.FieldByName('费用状态').asstring<>'部分结算') and
(accept.DataSet.FieldByName('费用状态').asstring<>'结算完毕') and
(accept.DataSet.FieldByName('费用状态').asstring<>'禁止删除') and
(accept.DataSet.FieldByName('费用状态').asstring<>'禁止修改')then
begin
can_do:=false;
end;
end;
accept.DataSet.next;
end;
if can_do then
begin
pay.DataSet.first;
while not pay.DataSet.eof do
begin
if can_do then
begin
if (pay.DataSet.FieldByName('费用状态').asstring<>'审核通过') and
(pay.DataSet.FieldByName('费用状态').asstring<>'部分结算') and
(pay.DataSet.FieldByName('费用状态').asstring<>'结算完毕') and
(pay.DataSet.FieldByName('费用状态').asstring<>'禁止删除') and
(pay.DataSet.FieldByName('费用状态').asstring<>'禁止修改')then
begin
can_do:=false;
end;
end;
pay.DataSet.next;
end;
end;
if can_do then
begin
yewu.DataSet.edit;
yewu.DataSet['费用状态']:='费用封帐';
yewu.DataSet['费用封帐日期']:=now;
yewu.DataSet.post;
p_accmonth.Close;
p_accmonth.SQL.Text:='exec p_exec_accmonth '''+yewu.DataSet.fieldbyname('编号').AsString+'''';
p_accmonth.ExecSQL;
if (dsstr='') then
dsstr:=dsstr+'{'
else dsstr:=dsstr+',{';
dsstr:=dsstr+'"bookingId":'+ yewu.DataSet.FieldByName('DJYID').asstring;
dsstr:=dsstr+',"lockStatus":true';
dsstr:=dsstr+'}';
{
Send_op_do('费用封帐,业务编号:'+yewu.DataSet.fieldbyname('业务编号').AsString,'42',
yewu.DataSet.fieldbyname('操作员').AsString,
yewu.DataSet.fieldbyname('客服员').AsString,
yewu.DataSet.fieldbyname('揽货人').AsString);
}
end;
end;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
yewu.DataSet.next;
end;
if (dsstr<>'') then begin
str:=str+'[';
str:=str+dsstr;
str:=str+']';
PostUrl:='http://47.104.85.216:13579/DataSync/SaveBookingOrderLock';
TDsDjyThread.create(PostUrl,str,'','1bccf850845542f89057007e51f78f13','2af5ed1f0cc124bcfc4ba05e4a24eac77f2f582c25737477633a1c0303ac3b8ed647e810880dac58');
InsertSysLog('上传大简云封账',yewu.DataSet.FieldByName('业务编号').asstring);
end;
FreeAndNil(p_accmonth);
if frm_sys_progress.showing then begin
frm_sys_progress.close;
frm_sys_progress:=nil;
end;
end;
procedure Tfrm_op_close_all.select_feng_op();
begin
if yewu.DataSet.RecordCount>1 then begin
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(self);
frm_sys_progress.bsSkinGauge1.ProgressText:='正在封帐请等候。。。';
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.MaxValue:=yewu.DataSet.RecordCount;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.Update;
end;
yewu.DataSet.first;
while not yewu.DataSet.eof do
begin
if yewu.DataSet.fieldbyname('业务状态').asstring<>'业务封帐' then
begin
yewu.DataSet.edit;
yewu.DataSet['业务状态']:='业务封帐';
yewu.DataSet.post;
{
Send_op_do('业务封帐,业务编号:'+yewu.DataSet.fieldbyname('业务编号').AsString,'41',
yewu.DataSet.fieldbyname('操作员').AsString,
yewu.DataSet.fieldbyname('客服员').AsString,
yewu.DataSet.fieldbyname('揽货人').AsString);
}
end;
yewu.DataSet.Next;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
end;
if frm_sys_progress.showing then begin
frm_sys_progress.close;
frm_sys_progress:=nil;
end;
end;
procedure Tfrm_op_close_all.select_feng_fee();
var
can_do:boolean;
p_accmonth:TAdoQuery;
dsstr,PostUrl,str:string;
begin
if yewu.DataSet.RecordCount>1 then begin
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(self);
frm_sys_progress.bsSkinGauge1.ProgressText:='正在封帐请等候。。。';
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.MaxValue:=yewu.DataSet.RecordCount;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.Update;
end;
p_accmonth:=createAdoQuery;
yewu.DataSet.first;
while not yewu.DataSet.eof do
begin
if yewu.DataSet.fieldbyname('费用状态').asstring<>'费用封帐' then
begin
can_do:=true;
accept.DataSet.first;
while not accept.DataSet.eof do
begin
if can_do then
begin
if (accept.DataSet.FieldByName('费用状态').asstring<>'审核通过') and
(accept.DataSet.FieldByName('费用状态').asstring<>'部分结算') and
(accept.DataSet.FieldByName('费用状态').asstring<>'结算完毕') and
(accept.DataSet.FieldByName('费用状态').asstring<>'禁止删除') and
(accept.DataSet.FieldByName('费用状态').asstring<>'禁止修改')then
begin
can_do:=false;
end;
end;
accept.DataSet.next;
end;
if can_do then
begin
pay.DataSet.first;
while not pay.DataSet.eof do
begin
if can_do then
begin
if (pay.DataSet.FieldByName('费用状态').asstring<>'审核通过') and
(pay.DataSet.FieldByName('费用状态').asstring<>'部分结算') and
(pay.DataSet.FieldByName('费用状态').asstring<>'结算完毕') and
(pay.DataSet.FieldByName('费用状态').asstring<>'禁止删除') and
(pay.DataSet.FieldByName('费用状态').asstring<>'禁止修改')then
begin
can_do:=false;
end;
end;
pay.DataSet.next;
end;
end;
if can_do then
begin
yewu.DataSet.edit;
yewu.DataSet['费用状态']:='费用封帐';
yewu.DataSet['费用封帐日期']:=now;
yewu.DataSet.post;
p_accmonth.Close;
p_accmonth.SQL.Text:='exec p_exec_accmonth '''+yewu.DataSet.fieldbyname('编号').AsString+'''';
p_accmonth.ExecSQL;
if (dsstr='') then
dsstr:=dsstr+'{'
else dsstr:=dsstr+',{';
dsstr:=dsstr+'"bookingId":'+ yewu.DataSet.FieldByName('DJYID').asstring;
dsstr:=dsstr+',"lockStatus":true';
dsstr:=dsstr+'}';
{
Send_op_do('费用封帐,业务编号:'+yewu.DataSet.fieldbyname('业务编号').AsString,'42',
yewu.DataSet.fieldbyname('操作员').AsString,
yewu.DataSet.fieldbyname('客服员').AsString,
yewu.DataSet.fieldbyname('揽货人').AsString);
}
end;
end;
yewu.DataSet.next;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
end;
if (dsstr<>'') then begin
str:=str+'[';
str:=str+dsstr;
str:=str+']';
PostUrl:='http://47.104.85.216:13579/DataSync/SaveBookingOrderLock';
TDsDjyThread.create(PostUrl,str,'','1bccf850845542f89057007e51f78f13','2af5ed1f0cc124bcfc4ba05e4a24eac77f2f582c25737477633a1c0303ac3b8ed647e810880dac58');
InsertSysLog('上传大简云封账',yewu.DataSet.FieldByName('业务编号').asstring);
end;
FreeAndNil(p_accmonth);
if frm_sys_progress.showing then begin
frm_sys_progress.close;
frm_sys_progress:=nil;
end;
end;
procedure Tfrm_op_close_all.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_op_close_all.bsSkinButton1Click(Sender: TObject);
begin
if bsSkinCheckRadioBox3.Checked then
begin
frm_op_close_all.select_feng_all();
close;
exit;
end;
if bsSkinCheckRadioBox1.Checked then
begin
frm_op_close_all.select_feng_op();
close;
exit;
end;
if bsSkinCheckRadioBox2.Checked then
begin
frm_op_close_all.select_feng_fee();
close;
exit;
end;
end;
end.