1
0

MasterWorkerTeamController.php 2.7 KB

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