Queueu9.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php defined('BASEPATH') OR exit('No direct script access allowed');
  2. /**
  3. * 该类执行队列使用
  4. */
  5. class Queueu9 extends Start_Controller {
  6. private $url = "http://git.wepolicy.cn/";
  7. private $api = 20250217;
  8. public function __construct(){
  9. parent::__construct();
  10. $this->load->_model("Model_zzquque_u9",'zzquque_u9');
  11. $this->load->_model("Model_aaconf","aaconf");
  12. $this->load->_model("Model_logic_u9xg",'logic_u9xg');
  13. $this->load->_model("Model_logic_order","logic_order");
  14. }
  15. //定义方法的调用规则 获取URI第二段值
  16. public function _remap($arg,$arg_array)
  17. {
  18. $api = $this->input->get('api',true);
  19. if($api != $this->api){
  20. exit('No direct script access allowed');
  21. }
  22. if($arg == 'xdls')//执行小单的流转到临时仓的队列
  23. {
  24. $this->_xdls();
  25. }
  26. if($arg == 'ztdl')//执行在途的队列
  27. {
  28. $this->_zt();
  29. }
  30. else
  31. {
  32. $this->_index();
  33. }
  34. }
  35. public function _index(){
  36. }
  37. //执行小单的流转到临时仓的队列
  38. public function _xdls(){
  39. die;
  40. echo "<pre>";
  41. //第一步生成 许昌成品库的调出单
  42. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 0 and cg_status = 0 and xs_status = 0 ",'*','id asc',0,100);
  43. $do_list = [];
  44. foreach($list as $k=>$v){
  45. $tmp_info = $this->logic_order->getInfoByPlat($v['platform'],$v['order_no']);
  46. $tmp_info['zq_u9_id'] = $v['id'];
  47. $do_list[] = $tmp_info;
  48. }
  49. $this->logic_u9xg->xdlsOneStep($do_list);
  50. die;
  51. //新加一步 查询修改调出单的审核结果
  52. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 1 and cg_status = 0 and xs_status = 0 ",'*','id asc');
  53. $this->logic_u9xg->xdlsOneExtraStep($list);
  54. //var_dump($list);
  55. //第二步 创建的采购单和销售单
  56. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 3 and dc_data_status = 1 and cg_status = 0 and xs_status = 0 ");
  57. // var_dump($list);
  58. // die;
  59. //var_dump($list);
  60. $this->logic_u9xg->xdlsTwoStep($list);
  61. //审核销售单和采购单
  62. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 3 and dc_data_status = 1 and cg_status = 1 and xs_status = 1");
  63. //var_dump($list);
  64. $this->logic_u9xg->xdlsTwoExtraStep($list);
  65. sleep(3);
  66. //第三步 查询调出单生成的调入单是否生成 如果生成了就审核 如果没生成 说明异常了 这种都是按步骤走的
  67. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 3 and cg_status = 3 and xs_status = 3 and dr_status = 0");
  68. $this->logic_u9xg->xdlsThreeStep($list);
  69. //第四步 建立香港的销售单 标准出库单有源的需要先审核 先创建销售单
  70. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 3 and cg_status = 3 and xs_status = 3 and dr_status = 3 and xs_two_status = 0 ");
  71. $do_list = [];
  72. foreach($list as $k=>$v){
  73. $tmp_info = $this->logic_order->getInfoByPlat($v['platform'],$v['order_no']);
  74. $tmp_info['zq_u9_id'] = $v['id'];
  75. $tmp_info['dc_no'] = $v['dc_no'];
  76. $tmp_info['dc_data'] = $v['dc_data'];
  77. $do_list[] = $tmp_info;
  78. }
  79. $this->logic_u9xg->xdlsFourStep($do_list);
  80. //执行第五步骤 审核销售单 并同时生成标准出货单
  81. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 3 and cg_status = 3 and xs_status = 3 and dr_status = 3 and xs_two_status = 1 and bzch_status = 0 ");
  82. if(!empty($list)){
  83. $this->logic_u9xg->xdlsFiveStep($list);
  84. }
  85. sleep(3);
  86. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 3 and cg_status = 3 and xs_status = 3 and dr_status = 3 and xs_two_status = 3 and bzch_status = 1 ");
  87. $this->logic_u9xg->xdlsSixStep($list);
  88. }
  89. public function _zt(){
  90. echo "<pre>";
  91. //第一步生成 许昌成品库的调出单
  92. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 0 and cg_status = 0 and xs_status = 0 ",'*','id asc',0,100);
  93. }
  94. }