Queueu9.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. else
  27. {
  28. $this->_index();
  29. }
  30. }
  31. public function _index(){
  32. //新加一步 查询修改调出单的审核结果
  33. echo "<pre>";
  34. $list = $this->zzquque_u9->find_all("type = 10 and order_no = 'QQS-50228-020'");
  35. $this->logic_u9xg->xdlsOneExtraStep($list);
  36. //执行第一步的参数
  37. // $list = $this->zzquque_u9->find_all();
  38. // $do_list = [];
  39. // foreach($list as $k=>$v){
  40. // $tmp_info = $this->logic_order->getInfoByType($v['platform'],$v['order_no']);
  41. // $tmp_info['zq_u9_id'] = $v['id'];
  42. // $do_list[] = $tmp_info;
  43. // }
  44. // $this->logic_u9xg->xdlsOneStep($do_list);
  45. //执行第二步的参数
  46. // $list = $this->zzquque_u9->find_all("dc_status = 1 and xs_status = 1 and cg_status = 1 and type = 10 and update_time <=".(time() - 300));
  47. // $this->logic_u9xg->xdlsTwoStep($list);
  48. //执行第三部参数
  49. // $list = $this->zzquque_u9->find_all();
  50. // $this->logic_u9xg->xdlsThreeStep($list);
  51. //执行第四部的参数 生成销售单
  52. // $list = $this->zzquque_u9->find_all();
  53. // $do_list = [];
  54. // foreach($list as $k=>$v){
  55. // $tmp_info = $this->logic_order->getInfoByType($v['platform'],$v['order_no']);
  56. // $tmp_info['zq_u9_id'] = $v['id'];
  57. // $do_list[] = $tmp_info;
  58. // }
  59. // $this->logic_u9xg->xdlsFourStep($do_list);
  60. //执行第五步骤 审核销售单 并同时生成标准出货单
  61. // $list = $this->zzquque_u9->find_all(" xs_two_no = 'SO2502280045' ");
  62. // $this->logic_u9xg->xdlsFivestep($list);
  63. // $list = $this->zzquque_u9->find_all("");
  64. // $this->logic_u9xg->xdlsSixStep($list);
  65. //exit('No direct script access allowed index'."<br/>");
  66. }
  67. //执行小单的流转到临时仓的队列
  68. public function _xdls(){
  69. die;
  70. //第一步生成 许昌成品库的调出单
  71. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 0 and cg_status = 0 and xs_status = 0 ",'*','id asc',0,5);
  72. $do_list = [];
  73. foreach($list as $k=>$v){
  74. $tmp_info = $this->logic_order->getInfoByPlat($v['platform'],$v['order_no']);
  75. $tmp_info['zq_u9_id'] = $v['id'];
  76. $do_list[] = $tmp_info;
  77. }
  78. $this->logic_u9xg->xdlsOneStep($do_list);
  79. sleep(3);
  80. //新加一步 查询修改调出单的审核结果
  81. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 1 and cg_status = 0 and xs_status = 0 ",'*','id asc',0,5);
  82. $this->logic_u9xg->xdlsOneExtraStep($list);
  83. //第二步 提交审核第一步的采购单和销售单
  84. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 3 and cg_status = 1 and xs_status = 1 ");
  85. $this->logic_u9xg->xdlsTwoStep($list);
  86. //第三步 查询调出单生成的调入单是否生成 如果生成了就审核 如果没生成 说明异常了 这种都是按步骤走的
  87. $list = $this->zzquque_u9->find_all("type = 10 and dc_status = 3 and cg_status = 3 and xs_status = 3 and dr_status = 0");
  88. $this->logic_u9xg->xdlsThreeStep($list);
  89. //第四步 建立香港的销售单 标准出库单有源的需要先审核 先创建销售单
  90. $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 ");
  91. $do_list = [];
  92. foreach($list as $k=>$v){
  93. $tmp_info = $this->logic_order->getInfoByPlat($v['platform'],$v['order_no']);
  94. $tmp_info['zq_u9_id'] = $v['id'];
  95. $tmp_info['dc_no'] = $v['dc_no'];
  96. $do_list[] = $tmp_info;
  97. }
  98. $this->logic_u9xg->xdlsFourStep($do_list);
  99. //执行第五步骤 审核销售单 并同时生成标准出货单
  100. $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 ");
  101. if(!empty($list)){
  102. $this->logic_u9xg->xdlsFiveStep($list);
  103. }
  104. sleep(3);
  105. $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 ");
  106. $this->logic_u9xg->xdlsSixStep($list);
  107. }
  108. }