Oracle包和包体

我就是我 2022-08-12 16:19 285阅读 0赞
  1. create or replace package PKG_TCAS_DEPOT_CORE_CALC is
  2. --计提月份
  3. g_commis_month date;
  4. /*
  5. *分摊计算任务
  6. */
  7. procedure stp_commission_calc_task;
  8. /*
  9. *网点总计提奖金计算
  10. */
  11. procedure stp_dept_commission_calc;
  12. /*
  13. *仓管员计提奖金计算
  14. */
  15. procedure stp_depot_commission_calc;
  16. /*
  17. *计算转换仓管员的考勤信息(开始计提月份、是否参与计提、是否折算、转换后考勤数)
  18. */
  19. procedure stp_convert_emp_worktime;
  20. /*
  21. *更新网点计提奖金表的总考勤数
  22. */
  23. procedure stp_update_deptcommis_worktime;
  24. /*
  25. *获取网点的票数单价和重量单价
  26. *p_dept_code: 网点代码
  27. *p_area_code: 地区代码
  28. *p_price_type_code: 单价类型
  29. *p_quantity_price: 票数单价
  30. *p_weight_price: 重量单价
  31. */
  32. procedure stp_get_dept_price(p_dept_code in tm_tcas_depot_price.dept_code%type,
  33. p_area_code out tm_tcas_depot_price_type.area_code%type,
  34. p_price_type_code out tm_tcas_depot_price_type.price_type_code%type,
  35. p_quantity_price out tm_tcas_depot_price_type.price_ballot_qty%type,
  36. p_weight_price out tm_tcas_depot_price_type.price_weight_qty%type);
  37. /*
  38. *获取网点当前计提月份的总考勤数
  39. *p_dept_code: 网点代码
  40. */
  41. function get_dept_worktime(p_dept_code in tt_tcas_depotpbs_emp_info.dept_code%type) return number;
  42. /*
  43. *获取某个网点当前计提月份的总奖金
  44. *p_dept_code: 网点代码
  45. */
  46. function get_dept_commission(p_dept_code in tt_tcas_depotpbs_emp_info.dept_code%type) return number;
  47. /*
  48. *获取某员工当前计提月份在某个网点的总考勤数(已转计提)
  49. *p_emp_code: 员工工号
  50. *p_dept_code: 网点代码
  51. */
  52. function get_depot_worktime_by_dept(p_emp_code in tt_tcas_depotpbs_emp_info.emp_no%type,
  53. p_dept_code in tt_tcas_depotpbs_emp_info.dept_code%type) return number;
  54. /*
  55. *获取当前计提月份(系统当前月份的上一月)
  56. */
  57. function get_commission_month return date;
  58. /*
  59. *传递仓管员当前计提月份的奖金汇总数据
  60. */
  61. procedure stp_pass_depot_commission;
  62. /*
  63. *网点计提分摊计算入口
  64. */
  65. procedure stp_main;
  66. end PKG_TCAS_DEPOT_CORE_CALC;
  67. create or replace package body pkg_tcas_depot_core_calc is
  68. /*
  69. *分摊计算任务
  70. */
  71. procedure stp_commission_calc_task is
  72. l_call_no number;
  73. begin
  74. begin
  75. --获取序列号
  76. select seq_tcas_running_log.nextval into l_call_no from dual;
  77. --记录开始时间
  78. pkg_tcas_comm.stp_running_log('pkg_tcas_depot_core_calc',
  79. 'stp_dept_commission_calc',
  80. sysdate,
  81. null,
  82. null,
  83. 'start',
  84. 0,
  85. l_call_no);
  86. stp_dept_commission_calc;
  87. --记录结束时间
  88. pkg_tcas_comm.stp_running_log('pkg_tcas_depot_core_calc',
  89. 'stp_dept_commission_calc',
  90. sysdate,
  91. null,
  92. null,
  93. 'end',
  94. 0,
  95. l_call_no);
  96. end;
  97. begin
  98. --得到序列号
  99. select seq_tcas_running_log.nextval into l_call_no from dual;
  100. --记录开始时间
  101. pkg_tcas_comm.stp_running_log('pkg_tcas_depot_core_calc',
  102. 'stp_depot_commission_calc',
  103. sysdate,
  104. null,
  105. null,
  106. 'start',
  107. 0,
  108. l_call_no);
  109. stp_depot_commission_calc;
  110. --记录结束时间
  111. pkg_tcas_comm.stp_running_log('pkg_tcas_depot_core_calc',
  112. 'stp_depot_commission_calc',
  113. sysdate,
  114. null,
  115. null,
  116. 'end',
  117. 0,
  118. l_call_no);
  119. end;
  120. begin
  121. --得到序列号
  122. select seq_tcas_running_log.nextval into l_call_no from dual;
  123. --记录开始时间
  124. pkg_tcas_comm.stp_running_log('pkg_tcas_depot_core_calc',
  125. 'stp_update_deptcommis_worktime',
  126. sysdate,
  127. null,
  128. null,
  129. 'start',
  130. 0,
  131. l_call_no);
  132. stp_update_deptcommis_worktime;
  133. --记录结束时间
  134. pkg_tcas_comm.stp_running_log('pkg_tcas_depot_core_calc',
  135. 'stp_update_deptcommis_worktime',
  136. sysdate,
  137. null,
  138. null,
  139. 'end',
  140. 0,
  141. l_call_no);
  142. end;
  143. begin
  144. --得到序列号
  145. select seq_tcas_running_log.nextval into l_call_no from dual;
  146. --记录开始时间
  147. pkg_tcas_comm.stp_running_log('pkg_tcas_depot_core_calc',
  148. 'stp_pass_depot_commission',
  149. sysdate,
  150. null,
  151. null,
  152. 'start',
  153. 0,
  154. l_call_no);
  155. stp_pass_depot_commission;
  156. --记录结束时间
  157. pkg_tcas_comm.stp_running_log('pkg_tcas_depot_core_calc',
  158. 'stp_pass_depot_commission',
  159. sysdate,
  160. null,
  161. null,
  162. 'end',
  163. 0,
  164. l_call_no);
  165. end;
  166. end stp_commission_calc_task;
  167. /*
  168. *网点总计提奖金计算
  169. */
  170. procedure stp_dept_commission_calc is
  171. --地区代码
  172. l_area_code tm_department.area_code%type := null;
  173. --单价
  174. l_price_type_code tm_tcas_depot_price_type.price_type_code%type := null;
  175. l_quantity_price tm_tcas_depot_price_type.price_ballot_qty%type := null;
  176. l_weight_price tm_tcas_depot_price_type.price_weight_qty%type := null;
  177. --网点总计提奖金
  178. l_dept_money tr_tcas_depot_commission.dept_commis_money%type := 0;
  179. --提示信息
  180. l_prompt_msg tr_tcas_depot_commission.prompt_message%type := null;
  181. cursor c_query_dept_amount(commission_month_string ti_fact_to_ecastcas.month_code%type) is
  182. select dept_code, tickets, weight
  183. from ti_fact_to_ecastcas t
  184. where t.month_code = commission_month_string
  185. and not exists(select 1
  186. from tt_tcas_ignore_dept_type i
  187. where i.type_code = (select type_code
  188. from tm_department d
  189. where d.dept_code = t.dept_code
  190. and rownum<=1));
  191. begin
  192. --删除当前计提月份已存在的数据
  193. delete from tr_tcas_depot_commission
  194. where trunc(commis_month, 'month') = g_commis_month;
  195. for amount in c_query_dept_amount(to_char(g_commis_month, 'yyyymm'))
  196. loop
  197. stp_get_dept_price(amount.dept_code,
  198. l_area_code,
  199. l_price_type_code,
  200. l_quantity_price,
  201. l_weight_price);
  202. --没有查询到单价配置(没有配置,或为空)
  203. if((l_area_code is null)
  204. or (l_price_type_code is null)
  205. or (l_quantity_price is null)
  206. or (l_weight_price is null)) then
  207. l_dept_money := null;
  208. l_prompt_msg := '{11}';
  209. elsif(amount.tickets is null) then
  210. l_dept_money := null;
  211. l_prompt_msg := '{12}';
  212. elsif(amount.weight is null) then
  213. l_dept_money := null;
  214. l_prompt_msg := '{13}';
  215. else
  216. l_dept_money := (l_quantity_price * amount.tickets) +
  217. (l_weight_price * amount.weight);
  218. l_prompt_msg := null;
  219. end if;
  220. insert into tr_tcas_depot_commission
  221. (
  222. commission_id,
  223. area_code,
  224. dept_code,
  225. commis_month,
  226. dept_commis_money,
  227. dept_work_time,
  228. ballot_qty,
  229. weight_qty,
  230. price_type_code,
  231. price_ballot_qty,
  232. price_weight_qty,
  233. created_emp_code,
  234. created_tm,
  235. modified_emp_code,
  236. modified_tm,
  237. prompt_message
  238. )
  239. values
  240. (
  241. seq_tcas_depot.nextval,
  242. l_area_code,
  243. amount.dept_code,
  244. g_commis_month,
  245. l_dept_money,
  246. null,
  247. amount.tickets,
  248. amount.weight,
  249. l_price_type_code,
  250. l_quantity_price,
  251. l_weight_price,
  252. 'sys',
  253. sysdate,
  254. 'sys',
  255. sysdate,
  256. l_prompt_msg
  257. );
  258. end loop;
  259. commit;
  260. end stp_dept_commission_calc;
  261. /*
  262. *仓管员计提奖金计算
  263. */
  264. procedure stp_depot_commission_calc is
  265. --员工姓名
  266. l_emp_name tr_tcas_depot_commission_emp.emp_name%type;
  267. --职位名称
  268. l_position_name tr_tcas_depot_commission_emp.position_name%type;
  269. --职位状态
  270. l_position_state tr_tcas_depot_commission_emp.position_state%type;
  271. --仓管员所属组织网点
  272. l_emp_dept_code tr_tcas_depot_commission_emp.emp_dept_code%type;
  273. --员工当前计提月份总考勤数(已转计提)
  274. l_depot_worktime tr_tcas_depot_commission_emp.emp_commis_time%type := 0;
  275. --网点当前计提月份总奖金
  276. l_dept_commission tr_tcas_depot_commission_emp.emp_commis_money%type := 0;
  277. --仓管员当前计提月份奖金
  278. l_emp_commis_money tr_tcas_depot_commission_emp.emp_commis_money%type;
  279. cursor c_query_depot_schedule_trans is
  280. select *
  281. from (select t.emp_code,
  282. t.dept_code,
  283. t.person_type,
  284. t.begin_commission_month,
  285. (sum(t.work_time) over(partition by t.emp_code, t.dept_code)) work_time,
  286. (sum(t.convert_worktime) over(partition by t.emp_code, t.dept_code)) depot_convert_work_time,
  287. (sum(t.convert_worktime) over(partition by t.dept_code)) dept_worktime,
  288. (row_number() over(partition by t.emp_code, t.dept_code order by t.work_date desc)) rn
  289. from tt_tcas_depot_schedule_trans t
  290. where trunc(t.work_date, 'month') = g_commis_month) x
  291. where x.rn = 1;
  292. begin
  293. --删除当前计提月份已存在的数据
  294. delete from tr_tcas_depot_commission_emp c
  295. where trunc(c.commission_month, 'month') = g_commis_month;
  296. --计算转换仓管员的考勤信息
  297. stp_convert_emp_worktime;
  298. for schedule in c_query_depot_schedule_trans
  299. loop
  300. begin
  301. select e.emp_name,
  302. e.position_name,
  303. e.position_status,
  304. e.dept_code
  305. into l_emp_name,
  306. l_position_name,
  307. l_position_state,
  308. l_emp_dept_code
  309. from tm_employee e
  310. where e.emp_code = schedule.emp_code and rownum=1;
  311. exception when others then
  312. l_emp_name := null;
  313. l_position_name := null;
  314. l_position_state := null;
  315. l_emp_dept_code := null;
  316. end;
  317. l_depot_worktime := get_depot_worktime_by_dept(schedule.emp_code, schedule.dept_code);
  318. l_dept_commission := get_dept_commission(schedule.dept_code);
  319. if((schedule.dept_worktime is null) or (schedule.dept_worktime = 0)) then
  320. l_emp_commis_money := 0;
  321. else
  322. l_emp_commis_money := (l_depot_worktime/(schedule.dept_worktime))*l_dept_commission;
  323. end if;
  324. insert into tr_tcas_depot_commission_emp
  325. (
  326. commission_emp_id,
  327. emp_code,
  328. commission_month,
  329. dept_code,
  330. emp_commis_time,
  331. emp_convert_time,
  332. emp_commis_money,
  333. emp_dept_code,
  334. emp_name,
  335. person_type,
  336. position_name,
  337. position_state,
  338. begin_commis_month,
  339. created_emp_code,
  340. created_tm,
  341. modified_emp_code,
  342. modified_tm
  343. )
  344. values
  345. (
  346. seq_tcas_depot.nextval,
  347. schedule.emp_code,
  348. g_commis_month,
  349. schedule.dept_code,
  350. schedule.work_time,
  351. schedule.depot_convert_work_time,
  352. l_emp_commis_money,
  353. l_emp_dept_code,
  354. l_emp_name,
  355. schedule.person_type,
  356. l_position_name,
  357. l_position_state,
  358. schedule.begin_commission_month,
  359. 'sys',
  360. sysdate,
  361. 'sys',
  362. sysdate
  363. );
  364. end loop;
  365. commit;
  366. end stp_depot_commission_calc;
  367. /*
  368. *计算转换仓管员的考勤信息
  369. *(开始计提月份、是否参与计提、是否折算、转换后考勤数)
  370. */
  371. procedure stp_convert_emp_worktime is
  372. --人员类型
  373. l_person_type tt_tcas_sap_hr_person_type.person_type%type := null;
  374. --开始计提月份
  375. l_begin_month tm_tcas_begin_commis_month.begin_commis_month%type;
  376. --是否参与计提
  377. l_is_begin_commis tt_tcas_depot_schedule_trans.is_begin_commission%type;
  378. --是否折算
  379. l_is_convert tt_tcas_depot_schedule_trans.is_convert%type;
  380. --转换后考勤数
  381. l_convert_worktime tt_tcas_depot_schedule_trans.convert_worktime%type;
  382. --提示信息
  383. l_reason tt_tcas_depot_schedule_trans.prompt_message%type;
  384. --人员类型是否包含“非全”
  385. l_is_contain_feiquan number := 0;
  386. cursor c_query_depot_schedule is
  387. select t.depot_pbs_emp_info_id, t.emp_no, t.dept_code, t.work_date, t.work_time,
  388. (select e.person_type from tm_employee e where e.emp_code=t.emp_no and rownum=1) person_type
  389. from tt_tcas_depotpbs_emp_info t
  390. where trunc(t.work_date, 'month') = g_commis_month;
  391. begin
  392. --删除当前计提月份已存在数据
  393. delete from tt_tcas_depot_schedule_trans t
  394. where trunc(t.work_date, 'month') = g_commis_month;
  395. for schedule in c_query_depot_schedule
  396. loop
  397. --从人员类型接口表查询人员类型
  398. begin
  399. select t.person_type
  400. into l_person_type
  401. from tt_tcas_sap_hr_person_type t
  402. where t.emp_code = schedule.emp_no
  403. and trunc(schedule.work_date) >= trunc(t.effective_date)
  404. and trunc(schedule.work_date) <= trunc(t.expiry_date)
  405. and rownum = 1;
  406. exception when others then
  407. l_person_type := null;
  408. end;
  409. --接口表中未查询到“人员类型”,则从员工表中取
  410. if(l_person_type is null) then
  411. l_person_type := schedule.person_type;
  412. end if;
  413. l_is_begin_commis := 0;
  414. l_is_convert := 0;
  415. l_convert_worktime := schedule.work_time;
  416. l_is_contain_feiquan := 0;
  417. --查询开始计提月份
  418. begin
  419. select begin_commis_month
  420. into l_begin_month
  421. from tm_tcas_begin_commis_month m
  422. where m.emp_no_commis = schedule.emp_no
  423. and rownum=1;
  424. exception when others then
  425. l_begin_month := null;
  426. end;
  427. --开始计提月份未设置或未生效:不计提
  428. if((l_begin_month is null) or (trunc(l_begin_month, 'month')>g_commis_month)) then
  429. if(l_person_type is not null) then
  430. select instr(l_person_type, '非全', 1, 1)
  431. into l_is_contain_feiquan
  432. from dual;
  433. if((l_is_contain_feiquan is not null) and (l_is_contain_feiquan>0)) then
  434. l_is_convert := 1;
  435. l_convert_worktime := ((schedule.work_time)*4)/9;
  436. l_reason := '{14}';
  437. else
  438. l_is_convert := 1;
  439. l_convert_worktime := (schedule.work_time)/2;
  440. l_reason := '{15}';
  441. end if;
  442. else
  443. l_reason := '{16}';
  444. end if;
  445. else
  446. if(l_person_type is not null) then
  447. l_is_begin_commis := 1;
  448. l_reason := '{18}';
  449. else
  450. l_reason := '{19}';
  451. end if;
  452. end if;
  453. insert into tt_tcas_depot_schedule_trans
  454. (
  455. depot_schedule_translate_id,
  456. emp_code,
  457. dept_code,
  458. work_date,
  459. work_time,
  460. person_type,
  461. begin_commission_month,
  462. is_begin_commission,
  463. is_convert,
  464. convert_worktime,
  465. depot_pbs_emp_info_id,
  466. prompt_message,
  467. created_emp_code,
  468. created_tm
  469. )
  470. values
  471. (
  472. seq_tcas_depot.nextval,
  473. schedule.emp_no,
  474. schedule.dept_code,
  475. schedule.work_date,
  476. schedule.work_time,
  477. l_person_type,
  478. l_begin_month,
  479. l_is_begin_commis,
  480. l_is_convert,
  481. l_convert_worktime,
  482. schedule.depot_pbs_emp_info_id,
  483. l_reason,
  484. 'sys',
  485. sysdate
  486. );
  487. end loop;
  488. commit;
  489. end stp_convert_emp_worktime;
  490. /*
  491. *更新当前计提月份网点计提奖金表的总考勤数
  492. */
  493. procedure stp_update_deptcommis_worktime is
  494. begin
  495. update tr_tcas_depot_commission c
  496. set c.dept_work_time = get_dept_worktime(c.dept_code)
  497. where trunc(c.commis_month, 'month') = g_commis_month;
  498. commit;
  499. end stp_update_deptcommis_worktime;
  500. /*
  501. *获取网点的票数单价和重量单价
  502. *p_dept_code: 网点代码
  503. *p_area_code: 地区代码
  504. *p_price_type_code: 单价类型
  505. *p_quantity_price: 票数单价
  506. *p_weight_price: 重量单价
  507. */
  508. procedure stp_get_dept_price(p_dept_code in tm_tcas_depot_price.dept_code%type,
  509. p_area_code out tm_tcas_depot_price_type.area_code%type,
  510. p_price_type_code out tm_tcas_depot_price_type.price_type_code%type,
  511. p_quantity_price out tm_tcas_depot_price_type.price_ballot_qty%type,
  512. p_weight_price out tm_tcas_depot_price_type.price_weight_qty%type) is
  513. begin
  514. --查询网点所属的地区代码
  515. begin
  516. select d.area_code
  517. into p_area_code
  518. from tm_department d
  519. where d.dept_code = p_dept_code
  520. and rownum = 1;
  521. exception
  522. when others then
  523. p_area_code := null;
  524. end;
  525. --查询网点的单价类型
  526. begin
  527. select t.price_type_code
  528. into p_price_type_code
  529. from tm_tcas_depot_price t
  530. where t.dept_code = p_dept_code
  531. and rownum = 1;
  532. exception
  533. when others then
  534. p_price_type_code := null;
  535. end;
  536. --查询网点的票数单价和重量单价
  537. if((p_area_code is not null) and (p_price_type_code is not null)) then
  538. begin
  539. select x.price_ballot_qty, x.price_weight_qty
  540. into p_quantity_price, p_weight_price
  541. from tm_tcas_depot_price_type x
  542. where x.area_code = p_area_code
  543. and x.price_type_code = p_price_type_code
  544. and rownum = 1;
  545. exception
  546. when others then
  547. p_quantity_price := null;
  548. p_weight_price := null;
  549. end;
  550. else
  551. p_quantity_price := null;
  552. p_weight_price := null;
  553. end if;
  554. end stp_get_dept_price;
  555. /*
  556. *获取某个网点当前计提月份的总考勤数(折算后)
  557. *p_dept_code: 网点代码
  558. */
  559. function get_dept_worktime(p_dept_code in tt_tcas_depotpbs_emp_info.dept_code%type) return number is
  560. l_dept_worktime tt_tcas_depotpbs_emp_info.work_time%type := 0;
  561. begin
  562. select nvl(sum(t.convert_worktime), 0)
  563. into l_dept_worktime
  564. from tt_tcas_depot_schedule_trans t
  565. where t.dept_code = p_dept_code
  566. and trunc(t.work_date, 'month') = g_commis_month;
  567. return l_dept_worktime;
  568. end get_dept_worktime;
  569. /*
  570. *获取某个网点当前计提月份的总奖金
  571. *p_dept_code: 网点代码
  572. */
  573. function get_dept_commission(p_dept_code in tt_tcas_depotpbs_emp_info.dept_code%type) return number is
  574. l_dept_commission tr_tcas_depot_commission.dept_commis_money%type := 0;
  575. begin
  576. begin
  577. select nvl(t.dept_commis_money, 0)
  578. into l_dept_commission
  579. from tr_tcas_depot_commission t
  580. where t.dept_code = p_dept_code
  581. and trunc(t.commis_month, 'month') = g_commis_month
  582. and rownum=1;
  583. exception when others then
  584. l_dept_commission := 0;
  585. end;
  586. return l_dept_commission;
  587. end get_dept_commission;
  588. /*
  589. *获取某个员工当前计提月份在某个网点的总计提考勤数(已转计提)
  590. *p_emp_code: 员工工号
  591. *p_dept_code: 网点代码
  592. */
  593. function get_depot_worktime_by_dept(p_emp_code in tt_tcas_depotpbs_emp_info.emp_no%type,
  594. p_dept_code in tt_tcas_depotpbs_emp_info.dept_code%type)
  595. return number is
  596. l_depot_worktime tt_tcas_depot_schedule_trans.work_time%type := 0;
  597. begin
  598. select nvl(sum(t.convert_worktime), 0)
  599. into l_depot_worktime
  600. from tt_tcas_depot_schedule_trans t
  601. where t.emp_code = p_emp_code
  602. and t.dept_code = p_dept_code
  603. and trunc(t.work_date, 'month') = g_commis_month
  604. and t.is_begin_commission = 1;
  605. return l_depot_worktime;
  606. end get_depot_worktime_by_dept;
  607. /*
  608. *获取当前计提月份(系统当前月份的上一月)
  609. */
  610. function get_commission_month return date is
  611. begin
  612. return trunc(add_months(sysdate, -1), 'month');
  613. end get_commission_month;
  614. /*
  615. *传递仓管员当前计提月份的奖金汇总数据
  616. */
  617. procedure stp_pass_depot_commission is
  618. begin
  619. delete from tr_tcas_commission_result r
  620. where r.created_emp = 'stp_pass_depot_commission'
  621. and r.commission_month = to_char(g_commis_month, 'yyyy-mm-dd');
  622. insert into tr_tcas_commission_result
  623. (
  624. result_id,
  625. endda,
  626. begda,
  627. betrg,
  628. created_tm,
  629. created_emp,
  630. commission_month,
  631. pernr
  632. )
  633. (
  634. select
  635. null,
  636. to_char(g_commis_month, 'yyyy-mm-dd'),
  637. to_char(g_commis_month, 'yyyy-mm-dd'),
  638. to_char(round(commis_money, 2)),
  639. sysdate,
  640. 'stp_pass_depot_commission',
  641. to_char(g_commis_month, 'yyyy-mm-dd'),
  642. emp_code
  643. from
  644. (
  645. select t.emp_code, sum(t.emp_commis_money) commis_money
  646. from tr_tcas_depot_commission_emp t
  647. where trunc(t.commission_month) = g_commis_month
  648. group by t.emp_code
  649. )
  650. );
  651. commit;
  652. end stp_pass_depot_commission;
  653. /*
  654. *网点计提分摊计算入口
  655. */
  656. procedure stp_main is
  657. l_main_call_no number;
  658. l_job_name varchar2(40) := 'STP_DEPOT_CORE_CALC';
  659. l_runnable number := 0;
  660. begin
  661. g_commis_month := get_commission_month;
  662. --得到序列号
  663. select seq_tcas_running_log.nextval into l_main_call_no from dual;
  664. --记录开始时间
  665. pkg_tcas_comm.stp_running_log('pkg_tcas_depot_core_calc',
  666. 'stp_main',
  667. sysdate,
  668. null,
  669. null,
  670. 'start',
  671. 0,
  672. l_main_call_no);
  673. pkg_tcas_comm.stp_start_task(l_job_name, l_runnable);
  674. if(l_runnable <> 0) then
  675. stp_commission_calc_task;
  676. --是否成功完成(1=成功完成,0=没有完成)
  677. pkg_tcas_comm.stp_end_task(l_job_name, null, 1, l_runnable);
  678. end if;
  679. --记录结束时间
  680. pkg_tcas_comm.stp_running_log('pkg_tcas_depot_core_calc',
  681. 'stp_main',
  682. sysdate,
  683. null,
  684. null,
  685. 'end',
  686. 0,
  687. l_main_call_no);
  688. exception when others then
  689. --回滚事务
  690. rollback;
  691. --是否成功完成(1=成功完成, 0=没有完成)
  692. pkg_tcas_comm.stp_end_task(l_job_name, null, 0, l_runnable);
  693. --记录错误日志
  694. pkg_tcas_comm.stp_running_log('pkg_tcas_depot_core_calc',
  695. 'stp_main',
  696. sysdate,
  697. sqlcode,
  698. sqlerrm,
  699. 'error',
  700. 0,
  701. l_main_call_no);
  702. commit;
  703. end stp_main;
  704. end pkg_tcas_depot_core_calc;

发表评论

表情:
评论列表 (有 0 条评论,285人围观)

还没有评论,来说两句吧...

相关阅读

    相关 、元框架

    .NET Core 是一种由 NuGet 包组成的平台。 有些产品体验受益于包的细粒度定义,而另一些受益于粗粒度的定义。 为了适应这种二元定义,一款好的产品应该作为一组细粒度的

    相关 TCP粘

    产生的原因 1. 应用程序写入数据的字节大小大于套接字发送缓冲区的大小 2. 进行MSS大小的TCP分段。MSS是最大报文段长度的缩写。MSS是TCP报文段中的数据