MasterWorkerTeamController.php 2.8 KB

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