$PBExportHeader$uo_crm.sru forward global type uo_crm from nonvisualobject end type end forward global type uo_crm from nonvisualobject end type global uo_crm uo_crm type variables Long uo_cusid end variables forward prototypes public function integer uof_add_plan (s_cust_plan arg_s_cust_plan, string arg_opemp, ref string arg_msg, boolean arg_ifcommit) public function integer uof_add_interview (s_cust_interview arg_s_cust_interview, string arg_opemp, ref string arg_msg, boolean arg_ifcommit) public function integer uof_add_cust (s_custom arg_s_cust, string arg_opemp, ref string arg_msg, boolean arg_ifcommit) public function integer uof_del_interview (long arg_interviewid, string arg_opemp, ref string arg_msg, boolean arg_ifcommit) public function integer uof_del_plan (long arg_planid, string arg_opemp, ref string arg_msg, boolean arg_ifcommit) public function integer uof_del_rep (long arg_repid, string arg_opemp, ref string arg_msg, boolean arg_ifcommit) public function integer uof_add_rep (s_cust_rep arg_s_cust_rep, string arg_opemp, ref string arg_msg, boolean arg_ifcommit) public function integer uof_del_cust (long arg_cusid, ref string arg_msg, boolean arg_ifcommit) public function integer uof_change_state (long arg_cusid, integer arg_state, ref string arg_msg, boolean arg_ifcommit) public function integer uof_del_station (long arg_cusid, long arg_stationid, ref string arg_msg, boolean arg_ifcommit) public function integer uof_add_station (s_cust_station arg_s_cust_station, ref string arg_msg, boolean arg_ifcommit) public function integer uof_set_dft_station (s_cust_station arg_s_cust_station, ref string arg_msg, boolean arg_ifcommit) public function integer uof_add_item (s_item_cust_spt arg_s_item, ref string arg_msg, boolean arg_ifcommit) public function integer uof_add_sample (s_cust_sample arg_s_cust_sample, string arg_opemp, ref string arg_msg, boolean arg_ifcommit) public function integer uof_del_sample (long arg_sampleid, string arg_opemp, ref string arg_msg, boolean arg_ifcommit) public function integer uof_code_find (long arg_id, string arg_code, ref string arg_msg) public function integer uof_audit_cust_rq (long arg_rqid, boolean arg_approval, string arg_dscrp, ref string arg_msg, boolean arg_ifcommit) end prototypes public function integer uof_add_plan (s_cust_plan arg_s_cust_plan, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 Long cnt,ll_planid IF IsNull(arg_s_cust_plan.saler) THEN arg_s_cust_plan.saler = '' IF IsNull(arg_s_cust_plan.planrep) THEN arg_s_cust_plan.planrep = '' IF IsNull(arg_s_cust_plan.plancontent) THEN arg_s_cust_plan.plancontent = '' IF IsNull(arg_s_cust_plan.dscrp) THEN arg_s_cust_plan.dscrp = '' IF IsNull(arg_s_cust_plan.cusid) THEN arg_s_cust_plan.cusid = 0 IF IsNull(arg_s_cust_plan.planid) THEN arg_s_cust_plan.planid = 0 IF IsNull(arg_s_cust_plan.accomplishrslt) THEN arg_s_cust_plan.accomplishrslt = '' IF arg_s_cust_plan.saler = '' THEN arg_msg = '请输入业务员' rslt = 0 GOTO ext END IF IF arg_s_cust_plan.plancontent = '' THEN arg_msg = '请输入计划内容' rslt = 0 GOTO ext END IF SELECT count(*) INTO :cnt FROM u_cust Where cusid = :arg_s_cust_plan.cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户资料失败 ' rslt = 0 GOTO ext END IF IF cnt = 0 THEN arg_msg = '客户资料不存在或重复' rslt = 0 GOTO ext END IF IF arg_s_cust_plan.planid = 0 THEN ll_planid = f_sys_scidentity(0,"u_cust_plan","planid",arg_msg,TRUE,sqlca) IF ll_planid <= 0 THEN rslt = 0 GOTO ext END IF INSERT INTO u_cust_plan (planid, cusid, saler, plandate, planrep, plancontent, dscrp, opdate, opemp, planaccomplishdate, accomplishdate, accomplishrslt) VALUES(:ll_planid, :arg_s_cust_plan.cusid, :arg_s_cust_plan.saler, :arg_s_cust_plan.plandate, :arg_s_cust_plan.planrep, :arg_s_cust_plan.plancontent, :arg_s_cust_plan.dscrp, getdate(), :arg_opemp, :arg_s_cust_plan.planaccomplishdate, :arg_s_cust_plan.accomplishdate, :arg_s_cust_plan.accomplishrslt); IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'pk_u_cust_plan') > 0 then arg_msg = '建立客户计划失败,关键字客户计划ID重复' else arg_msg = '建立客户计划失败,'+sqlca.SQLErrText end if rslt = 0 GOTO ext END IF ELSE UPDATE u_cust_plan SET saler = :arg_s_cust_plan.saler, plandate = :arg_s_cust_plan.plandate, planrep = :arg_s_cust_plan.planrep, plancontent = :arg_s_cust_plan.plancontent, dscrp = :arg_s_cust_plan.dscrp, moddate = getdate(), modemp = :arg_opemp, planaccomplishdate = :arg_s_cust_plan.planaccomplishdate, accomplishdate = :arg_s_cust_plan.accomplishdate, accomplishrslt = :arg_s_cust_plan.accomplishrslt Where planid = :arg_s_cust_plan.planid; IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'pk_u_cust_plan') > 0 then arg_msg = '更新客户计划失败,关键字客户计划ID重复' else arg_msg = '更新客户计划失败,'+sqlca.SQLErrText end if rslt = 0 GOTO ext END IF END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_add_interview (s_cust_interview arg_s_cust_interview, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 Long cnt,ll_interviewid IF IsNull(arg_s_cust_interview.saler) THEN arg_s_cust_interview.saler = '' IF IsNull(arg_s_cust_interview.interviewrep) THEN arg_s_cust_interview.interviewrep = '' IF IsNull(arg_s_cust_interview.interviewcontent) THEN arg_s_cust_interview.interviewcontent = '' IF IsNull(arg_s_cust_interview.dscrp) THEN arg_s_cust_interview.dscrp = '' IF IsNull(arg_s_cust_interview.cusid) THEN arg_s_cust_interview.cusid = 0 IF IsNull(arg_s_cust_interview.interviewid) THEN arg_s_cust_interview.interviewid = 0 IF IsNull(arg_s_cust_interview.amt) THEN arg_s_cust_interview.amt = 0 IF IsNull(arg_s_cust_interview.interviewway) THEN arg_s_cust_interview.interviewway = '' IF IsNull(arg_s_cust_interview.interviewrslt) THEN arg_s_cust_interview.interviewrslt = '' IF IsNull(arg_s_cust_interview.interviewform) THEN arg_s_cust_interview.interviewform = '' IF IsNull(arg_s_cust_interview.custassess) THEN arg_s_cust_interview.custassess = '' IF IsNull(arg_s_cust_interview.custview) THEN arg_s_cust_interview.custview = '' IF arg_s_cust_interview.saler = '' THEN arg_msg = '请输入业务员' rslt = 0 GOTO ext END IF IF arg_s_cust_interview.interviewcontent = '' THEN arg_msg = '请输入走访内容' rslt = 0 GOTO ext END IF SELECT count(*) INTO :cnt FROM u_cust Where cusid = :arg_s_cust_interview.cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户资料失败' rslt = 0 GOTO ext END IF IF cnt = 0 THEN arg_msg = '客户资料不存在或重复' rslt = 0 GOTO ext END IF IF arg_s_cust_interview.interviewid = 0 THEN ll_interviewid = f_sys_scidentity(0,"u_cust_interview","interviewid",arg_msg,TRUE,sqlca) IF ll_interviewid <= 0 THEN rslt = 0 GOTO ext END IF INSERT INTO u_cust_interview (interviewid, cusid, saler, interviewdate, interviewrep, interviewtime, interviewcontent, dscrp, amt, opdate, opemp, interviewway, interviewrslt, interviewform, custassess, custview) VALUES(:ll_interviewid, :arg_s_cust_interview.cusid, :arg_s_cust_interview.saler, :arg_s_cust_interview.interviewdate, :arg_s_cust_interview.interviewrep, :arg_s_cust_interview.interviewtime, :arg_s_cust_interview.interviewcontent, :arg_s_cust_interview.dscrp, :arg_s_cust_interview.amt, getdate(), :arg_opemp, :arg_s_cust_interview.interviewway, :arg_s_cust_interview.interviewrslt, :arg_s_cust_interview.interviewform, :arg_s_cust_interview.custassess, :arg_s_cust_interview.custview); IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'pk_u_cust_interview') > 0 then arg_msg = '建立客户走访失败,关键字走访记录ID重复' else arg_msg = '建立客户走访失败,'+sqlca.SQLErrText end if rslt = 0 GOTO ext END IF ELSE UPDATE u_cust_interview SET saler = :arg_s_cust_interview.saler, interviewdate = :arg_s_cust_interview.interviewdate, interviewrep = :arg_s_cust_interview.interviewrep, interviewtime = :arg_s_cust_interview.interviewtime, interviewcontent = :arg_s_cust_interview.interviewcontent, dscrp = :arg_s_cust_interview.dscrp, amt = :arg_s_cust_interview.amt, moddate = getdate(), modemp = :arg_opemp, interviewway = :arg_s_cust_interview.interviewway, interviewrslt = :arg_s_cust_interview.interviewrslt, interviewform = :arg_s_cust_interview.interviewform, custassess = :arg_s_cust_interview.custassess, custview = :arg_s_cust_interview.custview Where interviewid = :arg_s_cust_interview.interviewid; IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'pk_u_cust_interview') > 0 then arg_msg = '更新客户走访失败,关键字走访记录ID重复' else arg_msg = '更新客户走访失败,'+sqlca.SQLErrText end if rslt = 0 GOTO ext END IF END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_add_cust (s_custom arg_s_cust, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 Long cnt,ll_cusid,ll_i,ll_repid String ls_cusareaname,ls_areaname IF IsNull(arg_s_cust.cusid) THEN arg_s_cust.cusid = 0 IF IsNull(arg_s_cust.cuscode) THEN arg_s_cust.cuscode = '' IF IsNull(arg_s_cust.Name) THEN arg_s_cust.Name = '' IF IsNull(arg_s_cust.bsntype) THEN arg_s_cust.bsntype = '' IF IsNull(arg_s_cust.rep) THEN arg_s_cust.rep = '' IF IsNull(arg_s_cust.tele) THEN arg_s_cust.tele = '' IF IsNull(arg_s_cust.tele1) THEN arg_s_cust.tele1 = '' IF IsNull(arg_s_cust.bank) THEN arg_s_cust.bank = '' IF IsNull(arg_s_cust.cunt) THEN arg_s_cust.cunt = '' IF IsNull(arg_s_cust.Address) THEN arg_s_cust.Address = '' IF IsNull(arg_s_cust.code) THEN arg_s_cust.code = '' IF IsNull(arg_s_cust.dscrp) THEN arg_s_cust.dscrp = '' IF IsNull(arg_s_cust.givebackrate) THEN arg_s_cust.givebackrate = 0 IF IsNull(arg_s_cust.freight) THEN arg_s_cust.freight = '' IF IsNull(arg_s_cust.freight_tele) THEN arg_s_cust.freight_tele = '' IF IsNull(arg_s_cust.fax) THEN arg_s_cust.fax = '' IF IsNull(arg_s_cust.upname) THEN arg_s_cust.upname = '' IF IsNull(arg_s_cust.inuse) THEN arg_s_cust.inuse = 0 IF IsNull(arg_s_cust.cusareaid) THEN arg_s_cust.cusareaid = 0 IF IsNull(arg_s_cust.areaname) THEN arg_s_cust.areaname = '' IF IsNull(arg_s_cust.cusareaname) THEN arg_s_cust.cusareaname = '' IF IsNull(arg_s_cust.email) THEN arg_s_cust.email = '' IF IsNull(arg_s_cust.State) THEN arg_s_cust.State = 0 IF IsNull(arg_s_cust.peoplenum) THEN arg_s_cust.peoplenum = 0 IF IsNull(arg_s_cust.mainmarket) THEN arg_s_cust.mainmarket = '' IF IsNull(arg_s_cust.saleamt) THEN arg_s_cust.saleamt = 0 IF IsNull(arg_s_cust.nethttp) THEN arg_s_cust.nethttp = '' IF IsNull(arg_s_cust.trade) THEN arg_s_cust.trade = '' IF IsNull(arg_s_cust.corporation) THEN arg_s_cust.corporation = '' IF IsNull(arg_s_cust.grade) THEN arg_s_cust.grade = '' IF IsNull(arg_s_cust.ifself) THEN arg_s_cust.ifself = 0 IF IsNull(arg_s_cust.cuskind) THEN arg_s_cust.cuskind = '' IF IsNull(arg_s_cust.simplename) THEN arg_s_cust.simplename = '' IF IsNull(arg_s_cust.viewdaynum) THEN arg_s_cust.viewdaynum = 0 IF arg_s_cust.cuscode = '' THEN arg_msg = '请输入客户编号!' rslt = 0 GOTO ext END IF IF arg_s_cust.Name = '' THEN arg_msg = '请输入客户名称!' rslt = 0 GOTO ext END IF cnt = 0 SELECT count(*) INTO :cnt FROM u_cust WHERE name = :arg_s_cust.Name AND cusid <> :arg_s_cust.cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户名称是否重复失败' rslt = 0 GOTO ext END IF IF cnt > 0 THEN arg_msg = '客户名称重复,请检查客户资料' rslt = 0 GOTO ext END IF cnt = 0 SELECT count(*) INTO :cnt FROM u_Cusarea Where cusareaid = :arg_s_cust.cusareaid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户区域资料是否重复失败' rslt = 0 GOTO ext END IF IF cnt <> 1 THEN arg_msg = '客户区域资料重复或不存在,请检查客户区域资料' rslt = 0 GOTO ext END IF IF arg_s_cust.bsntype = '' THEN arg_msg = '请选择业务员' rslt = 0 GOTO ext END IF IF arg_s_cust.viewdaynum < 0 THEN arg_msg = '不合理的预收款天数' rslt = 0 GOTO ext END IF SELECT cusareaname,areaname INTO :ls_cusareaname,:ls_areaname FROM u_cusarea Where cusareaid = :arg_s_cust.cusareaid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户区域资料是否重复失败' rslt = 0 GOTO ext END IF IF arg_s_cust.inuse = 0 AND arg_s_cust.cusid > 0 THEN IF f_check_cust_balcamt(arg_s_cust.cusid,arg_msg) = 0 THEN rslt = 0 GOTO ext END IF END IF IF arg_s_cust.cusid = 0 THEN ll_cusid = f_sys_scidentity(0,"u_cust","cusid",arg_msg,FALSE,sqlca) IF ll_cusid <= 0 THEN rslt = 0 GOTO ext END IF INSERT INTO u_cust (cusid, cuscode, name, custype, rep, tele, tele1, bank, cunt, address, code, dscrp, faxno, inuse, cusareaid, cusareaname, areaname, email, givebackrate, freight, freight_tele, upname, state, peoplenum, mainmarket, saleamt, nethttp, trade, corporation, grade, ifself, opdate, opemp, cuskind, simplename, viewdaynum) VALUES(:ll_cusid, :arg_s_cust.cuscode, :arg_s_cust.name, :arg_s_cust.bsntype, :arg_s_cust.rep, :arg_s_cust.tele, :arg_s_cust.tele1, :arg_s_cust.bank, :arg_s_cust.cunt, :arg_s_cust.address, :arg_s_cust.code, :arg_s_cust.dscrp, :arg_s_cust.fax, :arg_s_cust.inuse, :arg_s_cust.cusareaid, :ls_cusareaname, :ls_areaname, :arg_s_cust.email, :arg_s_cust.givebackrate, :arg_s_cust.freight, :arg_s_cust.freight_tele, :arg_s_cust.upname, :arg_s_cust.state, :arg_s_cust.peoplenum, :arg_s_cust.mainmarket, :arg_s_cust.saleamt, :arg_s_cust.nethttp, :arg_s_cust.trade, :arg_s_cust.corporation, :arg_s_cust.grade, :arg_s_cust.ifself, getdate(), :arg_opemp, :arg_s_cust.cuskind, :arg_s_cust.simplename, :arg_s_cust.viewdaynum); IF sqlca.SQLCode <> 0 THEN IF Pos(Lower(sqlca.SQLErrText),'i_cus_code') > 0 THEN arg_msg = '建立客户资料失败,客户编号重复' ELSEIF Pos(Lower(sqlca.SQLErrText),'ix_u_cust') > 0 THEN arg_msg = '建立客户资料失败,客户名称重复' ELSEIF Pos(Lower(sqlca.SQLErrText),'pk_u_cust') > 0 THEN arg_msg = '建立客户资料失败,关键字客户ID重复' ELSE arg_msg = '建立客户资料失败,'+sqlca.SQLErrText END IF rslt = 0 GOTO ext END IF uo_cusid = ll_cusid ELSE UPDATE u_cust SET cuscode = :arg_s_cust.cuscode, name = :arg_s_cust.name, custype = :arg_s_cust.bsntype, rep = :arg_s_cust.rep, tele = :arg_s_cust.tele, tele1 = :arg_s_cust.tele1, bank = :arg_s_cust.bank, cunt = :arg_s_cust.cunt, address = :arg_s_cust.address, code = :arg_s_cust.code, dscrp = :arg_s_cust.dscrp, faxno = :arg_s_cust.fax, inuse = :arg_s_cust.inuse, cusareaid = :arg_s_cust.cusareaid, cusareaname = :ls_cusareaname, areaname = :ls_areaname, email = :arg_s_cust.email, givebackrate = :arg_s_cust.givebackrate, freight = :arg_s_cust.freight, freight_tele = :arg_s_cust.freight_tele, upname = :arg_s_cust.upname, state = :arg_s_cust.state, peoplenum = :arg_s_cust.peoplenum, mainmarket = :arg_s_cust.mainmarket, saleamt = :arg_s_cust.saleamt, nethttp = :arg_s_cust.nethttp, trade = :arg_s_cust.trade, corporation = :arg_s_cust.corporation, grade = :arg_s_cust.grade, ifself = :arg_s_cust.ifself, moddate = getdate(), modemp = :arg_opemp, cuskind = :arg_s_cust.cuskind, simplename = :arg_s_cust.simplename, viewdaynum = :arg_s_cust.viewdaynum Where cusid = :arg_s_cust.cusid; IF sqlca.SQLCode <> 0 THEN /////zww 090916 IF Pos(Lower(sqlca.SQLErrText),'i_cus_code') > 0 THEN arg_msg = '更新客户资料失败,客户编号重复' ELSEIF Pos(Lower(sqlca.SQLErrText),'ix_u_cust') > 0 THEN arg_msg = '更新客户资料失败,客户名称重复' ELSEIF Pos(Lower(sqlca.SQLErrText),'pk_u_cust') > 0 THEN arg_msg = '更新客户资料失败,关键字客户ID重复' ELSE arg_msg = '更新客户资料失败,'+sqlca.SQLErrText END IF // arg_msg = '更新客户资料失败,'+sqlca.SQLErrText rslt = 0 GOTO ext END IF uo_cusid = arg_s_cust.cusid END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF /////////zww 090916 arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_del_interview (long arg_interviewid, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 String ls_opemp SELECT opemp INTO :ls_opemp FROM u_cust_interview Where interviewid = :arg_interviewid; IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'more than') > 0 then arg_msg = '查询客户走访资料失败,查询数据返回值多于一个' else arg_msg = '查询客户走访资料失败' end if rslt = 0 GOTO ext END IF IF NOT sys_power_issuper AND arg_opemp <> ls_opemp THEN arg_msg = '不是资料建立人或系统管理员,不能删除' rslt = 0 GOTO ext END IF DELETE FROM u_cust_interview Where interviewid = :arg_interviewid; IF sqlca.SQLCode <> 0 THEN arg_msg = '删除客户走访资料失败 ' rslt = 0 GOTO ext END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_del_plan (long arg_planid, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 String ls_opemp SELECT opemp INTO :ls_opemp FROM u_cust_plan Where planid = :arg_planid; IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'more than') > 0 then arg_msg = '查询客户工作计划失败,查询数据返回值多于一个' else arg_msg = '查询客户工作计划失败' end if rslt = 0 GOTO ext END IF IF NOT sys_power_issuper AND arg_opemp <> ls_opemp THEN arg_msg = '不是资料建立人或系统管理员,不能删除' rslt = 0 GOTO ext END IF DELETE FROM u_cust_plan Where planid = :arg_planid; IF sqlca.SQLCode <> 0 THEN arg_msg = '删除客户工作计划失败 ' rslt = 0 GOTO ext END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_del_rep (long arg_repid, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 String ls_opemp SELECT opemp INTO :ls_opemp FROM u_cust_rep Where repid = :arg_repid; IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'more than') > 0 then arg_msg = '查询客户联系人资料失败,查询数据返回值多于一个' else arg_msg = '查询客户联系人资料失败' end if rslt = 0 GOTO ext END IF IF NOT sys_power_issuper AND arg_opemp <> ls_opemp THEN arg_msg = '不是资料建立人或系统管理员,不能删除' rslt = 0 GOTO ext END IF DELETE FROM u_cust_rep Where repid = :arg_repid; IF sqlca.SQLCode <> 0 THEN arg_msg = '删除客户联系人失败' rslt = 0 GOTO ext END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_add_rep (s_cust_rep arg_s_cust_rep, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 Long cnt,ll_repid IF IsNull(arg_s_cust_rep.repname) THEN arg_s_cust_rep.repname = '' IF IsNull(arg_s_cust_rep.duty) THEN arg_s_cust_rep.duty = '' IF IsNull(arg_s_cust_rep.sex) THEN arg_s_cust_rep.sex = '' IF IsNull(arg_s_cust_rep.officetel) THEN arg_s_cust_rep.officetel = '' IF IsNull(arg_s_cust_rep.handtel) THEN arg_s_cust_rep.handtel = '' IF IsNull(arg_s_cust_rep.faxno) THEN arg_s_cust_rep.faxno = '' IF IsNull(arg_s_cust_rep.email) THEN arg_s_cust_rep.email = '' IF IsNull(arg_s_cust_rep.dscrp) THEN arg_s_cust_rep.dscrp = '' IF IsNull(arg_s_cust_rep.deptname) THEN arg_s_cust_rep.deptname = '' IF IsNull(arg_s_cust_rep.interest) THEN arg_s_cust_rep.interest = '' IF IsNull(arg_s_cust_rep.mainproduct) THEN arg_s_cust_rep.mainproduct = '' IF arg_s_cust_rep.repname = '' THEN arg_msg = '请输入联系人名称' rslt = 0 GOTO ext END IF SELECT count(*) INTO :cnt FROM u_cust Where cusid = :arg_s_cust_rep.cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户资料失败' rslt = 0 GOTO ext END IF IF cnt = 0 THEN arg_msg = '客户资料不存在或重复' rslt = 0 GOTO ext END IF IF arg_s_cust_rep.repid = 0 THEN ll_repid = f_sys_scidentity(0,"u_cust_rep","repid",arg_msg,TRUE,sqlca) IF ll_repid <= 0 THEN rslt = 0 GOTO ext END IF INSERT INTO u_cust_rep (repid, cusid, repname, duty, sex, officetel, handtel, faxno, email, dscrp, deptname, interest, mainproduct, opdate, opemp) VALUES(:ll_repid, :arg_s_cust_rep.cusid, :arg_s_cust_rep.repname, :arg_s_cust_rep.duty, :arg_s_cust_rep.sex, :arg_s_cust_rep.officetel, :arg_s_cust_rep.handtel, :arg_s_cust_rep.faxno, :arg_s_cust_rep.email, :arg_s_cust_rep.dscrp, :arg_s_cust_rep.deptname, :arg_s_cust_rep.interest, :arg_s_cust_rep.mainproduct, getdate(), :arg_opemp); IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'ix_u_cust_rep') > 0 then arg_msg = '建立客户联系人失败,联系人名称重复' elseif pos(lower(sqlca.SQLErrText),'pk_u_cust_rep') > 0 then arg_msg = '建立客户联系人失败,违反关键字约束:客户ID、联系人ID重复' else arg_msg = '建立客户联系人失败,'+sqlca.SQLErrText end if rslt = 0 GOTO ext END IF ELSE UPDATE u_cust_rep SET repname = :arg_s_cust_rep.repname, duty = :arg_s_cust_rep.duty, sex = :arg_s_cust_rep.sex, officetel = :arg_s_cust_rep.officetel, handtel = :arg_s_cust_rep.handtel, faxno = :arg_s_cust_rep.faxno, email = :arg_s_cust_rep.email, dscrp = :arg_s_cust_rep.dscrp, deptname = :arg_s_cust_rep.deptname, interest = :arg_s_cust_rep.interest, mainproduct = :arg_s_cust_rep.mainproduct, moddate = getdate(), modemp = :arg_opemp Where repid = :arg_s_cust_rep.repid; IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'ix_u_cust_rep') > 0 then arg_msg = '更新客户联系人失败,联系人名称重复' elseif pos(lower(sqlca.SQLErrText),'pk_u_cust_rep') > 0 then arg_msg = '更新客户联系人失败,违反关键字约束:客户ID、联系人ID重复' else arg_msg = '更新客户联系人失败,'+sqlca.SQLErrText end if rslt = 0 GOTO ext END IF END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_del_cust (long arg_cusid, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 Long cnt SELECT count(*) INTO :cnt FROM u_cust Where cusid = :arg_cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户资料失败 ' rslt = 0 GOTO ext END IF cnt = 0 SELECT count(*) INTO :cnt FROM u_cust_interview Where cusid = :arg_cusid ; IF sqlca.SQLCode <> 0 THEN arg_msg = "查询客户走访计划操作失败! " rslt = 0 GOTO ext END IF IF cnt > 0 THEN arg_msg = "该资料已经使用于客户走访计划,不可以删除!" rslt = 0 GOTO ext END IF cnt = 0 SELECT count(*) INTO :cnt FROM u_cust_plan Where cusid = :arg_cusid ; IF sqlca.SQLCode <> 0 THEN arg_msg = "查询客户工作计划操作失败!" rslt = 0 GOTO ext END IF IF cnt > 0 THEN arg_msg = "该资料已经使用于客户工作计划,不可以删除!" rslt = 0 GOTO ext END IF cnt = 0 SELECT count(*) INTO :cnt FROM u_saletask Where cusid = :arg_cusid ; IF sqlca.SQLCode <> 0 THEN arg_msg = "查询客户订货单记录操作失败! " rslt = 0 GOTO ext END IF IF cnt > 0 THEN arg_msg = "该资料已经使用于订货单记录,不可以删除!" rslt = 0 GOTO ext END IF cnt = 0 SELECT COUNT(*) INTO :cnt FROM u_outware WHERE u_outware.cusid = :arg_cusid AND billtype = 1; IF sqlca.SQLCode <> 0 THEN arg_msg = "查询客户出仓记录操作失败!" rslt = 0 GOTO ext END IF IF cnt > 0 THEN arg_msg = "该资料已经使用于出仓记录,不可以删除!" rslt = 0 GOTO ext END IF cnt = 0 SELECT COUNT(*) INTO :cnt FROM u_bmsttake Where cusid = :arg_cusid ; IF sqlca.SQLCode <> 0 THEN arg_msg = "查询客户应收帐记录操作失败!" rslt = 0 GOTO ext END IF IF cnt > 0 THEN arg_msg = "该资料已经使用于应收帐,不可以删除!" rslt = 0 GOTO ext END IF IF f_check_cust_balcamt(arg_cusid,arg_msg) = 0 THEN rslt = 0 GOTO ext END IF DELETE FROM u_cust_rep Where cusid = :arg_cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '删除客户联系人失败 ' rslt = 0 GOTO ext END IF DELETE FROM u_cust_station Where cusid = :arg_cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '删除客户货运部失败 ' rslt = 0 GOTO ext END IF DELETE FROM u_item_cust_spt WHERE relid = :arg_cusid AND reltype = 0; IF sqlca.SQLCode <> 0 THEN arg_msg = '删除客户辅助项目失败 ' rslt = 0 GOTO ext END IF DELETE FROM u_cust Where cusid = :arg_cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '删除客户资料失败 ' rslt = 0 GOTO ext END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_change_state (long arg_cusid, integer arg_state, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1,li_state SELECT state INTO :li_state FROM u_cust Where cusid = :arg_cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户资料失败 ' rslt = 0 GOTO ext END IF IF arg_state = 1 THEN IF li_state = 1 THEN arg_msg = '客户资料已成为正式客户资料,不能再操作' rslt = 0 GOTO ext END IF UPDATE u_cust SET state = 1 WHERE cusid = :arg_cusid AND State <> 1; IF sqlca.SQLCode <> 0 THEN arg_msg = '更新客户资料类型失败 ' rslt = 0 GOTO ext END IF ELSEif arg_state = 0 THEN IF li_state = 0 THEN arg_msg = '客户资料已成为公共客户资料,不能再操作' rslt = 0 GOTO ext END IF UPDATE u_cust SET state = 0 WHERE cusid = :arg_cusid AND State <> 0; IF sqlca.SQLCode <> 0 THEN arg_msg = '更新客户资料类型失败 ' rslt = 0 GOTO ext END IF ELSEif arg_state = 2 THEN IF li_state = 2 THEN arg_msg = '客户资料成为黑名单客户资料,不能再操作' rslt = 0 GOTO ext END IF UPDATE u_cust SET state = 2 WHERE cusid = :arg_cusid AND State <> 2; IF sqlca.SQLCode <> 0 THEN arg_msg = '更新客户资料类型失败 ' rslt = 0 GOTO ext END IF ELSEif arg_state = 3 THEN IF li_state = 3 THEN arg_msg = '客户资料成为准客户资料,不能再操作' rslt = 0 GOTO ext END IF UPDATE u_cust SET state = 3 WHERE cusid = :arg_cusid AND State <> 3; IF sqlca.SQLCode <> 0 THEN arg_msg = '更新客户资料类型失败 ' rslt = 0 GOTO ext END IF END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_del_station (long arg_cusid, long arg_stationid, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 long cnt SELECT count(*) INTO :cnt FROM u_station Where stationid = :arg_stationid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询货运部资料失败 ' rslt = 0 GOTO ext END IF DELETE FROM u_cust_station Where cusid = :arg_cusid and stationid = :arg_stationid; IF sqlca.SQLCode <> 0 THEN arg_msg = '删除客户货运部资料失败' rslt = 0 GOTO ext END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_add_station (s_cust_station arg_s_cust_station, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 Long cnt IF IsNull(arg_s_cust_station.cusid) THEN arg_s_cust_station.cusid = 0 IF IsNull(arg_s_cust_station.stationid) THEN arg_s_cust_station.stationid = 0 IF IsNull(arg_s_cust_station.dftflag) THEN arg_s_cust_station.dftflag = 0 cnt = 0 SELECT count(*) INTO :cnt FROM u_cust Where cusid = :arg_s_cust_station.cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户资料失败 ' rslt = 0 GOTO ext END IF IF cnt = 0 THEN arg_msg = '客户资料不存在或重复' rslt = 0 GOTO ext END IF cnt = 0 SELECT count(*) INTO :cnt FROM u_station Where stationid = :arg_s_cust_station.stationid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询货运部资料失败 ' rslt = 0 GOTO ext END IF IF cnt = 0 THEN arg_msg = '货运部资料不存在或重复' rslt = 0 GOTO ext END IF SELECT count(*) INTO :cnt FROM u_cust_station WHERE stationid = :arg_s_cust_station.stationid AND cusid = :arg_s_cust_station.cusid ; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询货运部资料失败 ' rslt = 0 GOTO ext END IF IF cnt = 0 THEN INSERT INTO u_cust_station (stationid, cusid, dftflag) VALUES(:arg_s_cust_station.stationid, :arg_s_cust_station.cusid, :arg_s_cust_station.dftflag); IF sqlca.SQLCode <> 0 THEN IF Pos(Lower(sqlca.SQLErrText),'pk_u_cust_station') > 0 THEN arg_msg = '建立客户货运部失败,违反关键字约束:客户ID、货运部ID重复' ELSE arg_msg = '建立客户货运部失败,'+sqlca.SQLErrText END IF rslt = 0 GOTO ext END IF END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_set_dft_station (s_cust_station arg_s_cust_station, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 Long cnt String ls_dft_name,ls_dft_tel IF IsNull(arg_s_cust_station.cusid) THEN arg_s_cust_station.cusid = 0 IF IsNull(arg_s_cust_station.stationid) THEN arg_s_cust_station.stationid = 0 IF IsNull(arg_s_cust_station.dftflag) THEN arg_s_cust_station.dftflag = 0 cnt = 0 SELECT count(*) INTO :cnt FROM u_cust Where cusid = :arg_s_cust_station.cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户资料失败 ' rslt = 0 GOTO ext END IF SELECT stationname,tele INTO :ls_dft_name,:ls_dft_tel FROM u_station Where stationid = :arg_s_cust_station.stationid; IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'more than') > 0 then arg_msg = '查询货运部资料失败,查询数据返回值多于一个' else arg_msg = '查询货运部资料失败' end if rslt = 0 GOTO ext END IF UPDATE u_cust_station SET dftflag = 1 WHERE stationid = :arg_s_cust_station.stationid AND cusid = :arg_s_cust_station.cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '设置客户默认货运部失败 ' rslt = 0 GOTO ext END IF UPDATE u_cust_station SET dftflag = 0 WHERE stationid <> :arg_s_cust_station.stationid AND cusid = :arg_s_cust_station.cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '取消设置客户其它默认货运部失败 ' rslt = 0 GOTO ext END IF UPDATE u_cust SET freight = :ls_dft_name, freight_tele = :ls_dft_tel Where cusid = :arg_s_cust_station.cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '更新客户默认货运部失败 ' rslt = 0 GOTO ext END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_add_item (s_item_cust_spt arg_s_item, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 Long cnt,ll_repid IF IsNull(arg_s_item.itemid) THEN arg_s_item.itemid = 0 IF IsNull(arg_s_item.relid) THEN arg_s_item.relid = 0 IF IsNull(arg_s_item.reltype) THEN arg_s_item.reltype = 0 IF IsNull(arg_s_item.dscrp) THEN arg_s_item.dscrp = '' cnt = 0 SELECT count(*) INTO :cnt FROM u_item_cust_spt_def Where itemid = :arg_s_item.itemid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询辅助项目资料失败' rslt = 0 GOTO ext END IF cnt = 0 IF arg_s_item.reltype = 0 THEN SELECT count(*) INTO :cnt FROM u_cust Where cusid = :arg_s_item.relid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户资料失败' rslt = 0 GOTO ext END IF ELSE arg_msg = '错误的项目类型' rslt = 0 GOTO ext END IF UPDATE u_item_cust_spt SET dscrp = :arg_s_item.dscrp WHERE itemid = :arg_s_item.itemid AND relid = :arg_s_item.relid AND reltype = :arg_s_item.reltype; IF sqlca.SQLCode = 0 THEN IF sqlca.SQLNRows = 0 THEN INSERT INTO u_item_cust_spt (itemid, relid, reltype, dscrp) VALUES(:arg_s_item.itemid, :arg_s_item.relid, :arg_s_item.reltype, :arg_s_item.dscrp); IF sqlca.SQLCode <> 0 THEN IF Pos(Lower(sqlca.SQLErrText),'pk_u_item_cust_spt') > 0 THEN arg_msg = '建立辅助项目资料失败,违反关键字约束:客户、辅助项目重复' ELSE arg_msg = '建立辅助项目资料失败,'+sqlca.SQLErrText END IF rslt = 0 GOTO ext END IF END IF ELSE IF Pos(Lower(sqlca.SQLErrText),'pk_u_item_cust_spt') > 0 THEN arg_msg = '更新辅助项目资料失败,违反关键字约束:客户、辅助项目重复' ELSE arg_msg = '更新辅助项目资料失败,'+sqlca.SQLErrText END IF rslt = 0 GOTO ext END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_add_sample (s_cust_sample arg_s_cust_sample, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 Long cnt,ll_sampleid IF IsNull(arg_s_cust_sample.saler) THEN arg_s_cust_sample.saler = '' IF IsNull(arg_s_cust_sample.mtrlid) THEN arg_s_cust_sample.mtrlid = 0 IF IsNull(arg_s_cust_sample.samplecontent) THEN arg_s_cust_sample.samplecontent = '' IF IsNull(arg_s_cust_sample.cusid) THEN arg_s_cust_sample.cusid = 0 IF IsNull(arg_s_cust_sample.sampleid) THEN arg_s_cust_sample.sampleid = 0 IF IsNull(arg_s_cust_sample.qty) THEN arg_s_cust_sample.qty = 0 IF arg_s_cust_sample.saler = '' THEN arg_msg = '请输入业务员' rslt = 0 GOTO ext END IF cnt = 0 SELECT count(*) INTO :cnt FROM u_cust Where cusid = :arg_s_cust_sample.cusid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户资料失败 ' rslt = 0 GOTO ext END IF IF cnt = 0 THEN arg_msg = '客户资料不存在或重复' rslt = 0 GOTO ext END IF cnt = 0 SELECT count(*) INTO :cnt FROM u_mtrldef Where mtrlid = :arg_s_cust_sample.mtrlid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询物料资料失败 ' rslt = 0 GOTO ext END IF IF cnt = 0 THEN arg_msg = '物料资料不存在或重复' rslt = 0 GOTO ext END IF IF arg_s_cust_sample.sampleid = 0 THEN ll_sampleid = f_sys_scidentity(0,"u_cust_sample","sampleid",arg_msg,TRUE,sqlca) IF ll_sampleid <= 0 THEN rslt = 0 GOTO ext END IF INSERT INTO u_cust_sample (sampleid, cusid, saler, sampledate, mtrlid, samplecontent, qty, opdate, opemp) VALUES(:ll_sampleid, :arg_s_cust_sample.cusid, :arg_s_cust_sample.saler, :arg_s_cust_sample.sampledate, :arg_s_cust_sample.mtrlid, :arg_s_cust_sample.samplecontent, :arg_s_cust_sample.qty, getdate(), :arg_opemp); IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'pk_u_cust_sample') > 0 then arg_msg = '建立客户样版失败,关键字客户样版ID重复' else arg_msg = '建立客户样版失败,'+sqlca.SQLErrText end if rslt = 0 GOTO ext END IF ELSE UPDATE u_cust_sample SET saler = :arg_s_cust_sample.saler, sampledate = :arg_s_cust_sample.sampledate, mtrlid = :arg_s_cust_sample.mtrlid, samplecontent = :arg_s_cust_sample.samplecontent, qty = :arg_s_cust_sample.qty, moddate = getdate(), modemp = :arg_opemp Where sampleid = :arg_s_cust_sample.sampleid; IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'pk_u_cust_sample') > 0 then arg_msg = '更新客户样版失败,关键字客户样版ID重复' else arg_msg = '更新客户样版失败,'+sqlca.SQLErrText end if rslt = 0 GOTO ext END IF END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_del_sample (long arg_sampleid, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 String ls_opemp SELECT opemp INTO :ls_opemp FROM u_cust_sample Where sampleid = :arg_sampleid; IF sqlca.SQLCode <> 0 THEN if pos(lower(sqlca.SQLErrText),'more than') > 0 then arg_msg = '查询客户样版失败,查询数据返回值多于一个' else arg_msg = '查询客户样版失败' end if rslt = 0 GOTO ext END IF IF NOT sys_power_issuper AND arg_opemp <> ls_opemp THEN arg_msg = '不是资料建立人或系统管理员,不能删除' rslt = 0 GOTO ext END IF DELETE FROM u_cust_sample Where sampleid = :arg_sampleid; IF sqlca.SQLCode <> 0 THEN arg_msg = '删除客户样版失败' rslt = 0 GOTO ext END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 AND arg_ifcommit THEN COMMIT; END IF arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_code_find (long arg_id, string arg_code, ref string arg_msg);Int rslt = 1 long cnt SELECT count(*) INTO :cnt FROM u_cust WHERE cusid <> :arg_id AND cuscode = :arg_code; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询客户编号:'+arg_code+',是否已用失败 ' rslt = 0 GOTO ext END IF IF cnt > 0 THEN arg_msg = '查询客户编号:'+arg_code+',已用,请重新输入' rslt = 0 GOTO ext END IF ext: arg_msg = '客户管理,'+ arg_msg RETURN rslt end function public function integer uof_audit_cust_rq (long arg_rqid, boolean arg_approval, string arg_dscrp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1 Long cnt Long ll_cusid String ls_custype, ls_dscrp Int li_flag SELECT cusid, custype, flag INTO :ll_cusid, :ls_custype, :li_flag FROM u_cust_rq Where rqid = :arg_rqid; IF sqlca.SQLCode <> 0 THEN rslt = 0 arg_msg = "查询客户申请状况操作失败" GOTO ext END IF IF li_flag = 1 THEN rslt = 0 arg_msg = "客户申请已审核" GOTO ext END IF IF arg_approval THEN ls_dscrp = "批准" ELSE ls_dscrp = "驳回" END IF IF arg_dscrp <> "" THEN ls_dscrp += ",原因:"+arg_dscrp END IF UPDATE u_cust_rq SET flag = 1, auditdate = getdate(), auditemp = :publ_operator, dscrp = :ls_dscrp WHERE rqid = :arg_rqid And flag = 0; IF sqlca.SQLCode <> 0 THEN rslt = 0 arg_msg = "审核客户申请状况操作失败" GOTO ext ELSEIF sqlca.SQLNRows = 0 THEN rslt = 0 arg_msg = "审核客户申请状况操作失败,正在审核中......" GOTO ext END IF IF arg_approval THEN //更新客户状态 UPDATE u_cust SET state = 1 Where cusid = :ll_cusid; ELSE UPDATE u_cust SET state = 0 Where cusid = :ll_cusid; END IF IF sqlca.SQLCode <> 0 THEN rslt = 0 arg_msg = "更新客户类型操作失败" GOTO ext END IF ext: IF rslt = 0 THEN ROLLBACK; ELSEIF rslt = 1 And arg_ifcommit THEN COMMIT; END IF arg_msg = '客户资料,'+ arg_msg RETURN rslt end function on uo_crm.create call super::create TriggerEvent( this, "constructor" ) end on on uo_crm.destroy TriggerEvent( this, "destructor" ) call super::destroy end on