MasterWorkerTeamController.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. return $this->data($result);
  74. }
  75. /**
  76. * 团队工单查询
  77. * @return \think\response\Json
  78. */
  79. public function getTeamWorkLists()
  80. {
  81. return $this->dataLists(new TeamServiceWorkLists());
  82. }
  83. }