MasterWorkerTeamController.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. namespace app\workerapi\controller;
  3. use app\common\logic\MasterWorkerExamineLogic;
  4. use app\common\model\dict\DictData;
  5. use app\workerapi\lists\MasterWorkerLists;
  6. use app\workerapi\lists\ServiceWorkLists;
  7. use app\workerapi\lists\TeamServiceWorkLists;
  8. use app\workerapi\logic\LoginLogic;
  9. use app\workerapi\logic\MasterWorkerInfoLogic;
  10. use app\workerapi\logic\MasterWorkerLogic;
  11. use app\workerapi\logic\MasterWorkerTeamLogic;
  12. use app\workerapi\validate\BankAccountValidate;
  13. use app\workerapi\validate\MasterWokerInfoValidate;
  14. use app\workerapi\validate\MasterWokerTeamValidate;
  15. use app\workerapi\validate\MasterWokerValidate;
  16. class MasterWorkerTeamController extends BaseApiController
  17. {
  18. public array $notNeedLogin = [''];
  19. /**
  20. * 获取团队信息
  21. * @return \think\response\Json
  22. */
  23. public function getTeamInfo()
  24. {
  25. $result = MasterWorkerTeamLogic::getDetail($this->userId);
  26. return $this->data($result);
  27. }
  28. /**
  29. * 团队成员列表展示和分配
  30. * @return \think\response\Json
  31. */
  32. public function getMemberList()
  33. {
  34. return $this->dataLists(new MasterWorkerLists());
  35. }
  36. /**
  37. * 添加团队成员
  38. * @return \think\response\Json
  39. */
  40. public function addTeamMember()
  41. {
  42. $params = (new MasterWokerTeamValidate())->post()->goCheck('add');
  43. /*$res = LoginLogic::confirmMobile($params);
  44. if(!$res){
  45. return $this->fail(LoginLogic::getError());
  46. }*/
  47. $result = MasterWorkerTeamLogic::addTeamMember($params,$this->userId);
  48. if($result === false){
  49. return $this->fail(MasterWorkerTeamLogic::getError());
  50. }
  51. return $this->success('', [], 1, 1);
  52. }
  53. /**
  54. * 分配工单给团队成员
  55. * @return \think\response\Json
  56. */
  57. public function allocation()
  58. {
  59. $params = (new MasterWokerTeamValidate())->post()->goCheck('allocation');
  60. $result = MasterWorkerTeamLogic::allocation($params,$this->userInfo);
  61. if($result === false){
  62. return $this->fail(MasterWorkerTeamLogic::getError());
  63. }
  64. return $this->success('', [], 1, 1);
  65. }
  66. /**
  67. * 团队工单状态统计
  68. * @return \think\response\Json
  69. */
  70. public function getTeamWorkCount()
  71. {
  72. $result = MasterWorkerTeamLogic::MemberWorkStatistics($this->userInfo);
  73. $day_data = MasterWorkerTeamLogic::TeamOrderStatistics($this->userInfo);
  74. return $this->data(['work_status_data'=>$result,'day_data'=>$day_data]);
  75. }
  76. /**
  77. * 团队工单查询
  78. * @return \think\response\Json
  79. */
  80. public function getTeamWorkLists()
  81. {
  82. return $this->dataLists(new TeamServiceWorkLists());
  83. }
  84. /**
  85. * 日历团队工单查询
  86. * @return \think\response\Json
  87. */
  88. public function getCalendarTeamOrder()
  89. {
  90. return $this->data(MasterWorkerTeamLogic::TeamOrderStatistics($this->userInfo,62));
  91. }
  92. }