MasterWorkerController.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\controller\master_worker;
  15. use app\adminapi\controller\BaseAdminController;
  16. use app\adminapi\lists\master_worker\MasterWorkerLists;
  17. use app\adminapi\lists\master_worker\MoneyAnalysis;
  18. use app\adminapi\lists\master_worker\MasterWorkerOnlineLists;
  19. use app\adminapi\lists\master_worker\MasterWorkerStopLists;
  20. use app\adminapi\logic\master_worker\MasterWorkerLogic;
  21. use app\adminapi\validate\master_worker\MasterWorkerValidate;
  22. use app\adminapi\lists\master_worker\MasterWorkerScheduleLists;
  23. /**
  24. * MasterWorker控制器
  25. * Class MasterWorkerController
  26. * @package app\adminapi\controller\master_worker
  27. */
  28. class MasterWorkerController extends BaseAdminController
  29. {
  30. /**
  31. * @notes 获取列表
  32. * @return \think\response\Json
  33. * @author likeadmin
  34. * @date 2024/07/10 18:17
  35. */
  36. public function lists()
  37. {
  38. return $this->dataLists(new MasterWorkerLists());
  39. }
  40. /**
  41. * @notes 在线工程师列表
  42. * @return \think\response\Json
  43. * @author likeadmin
  44. * @date 2024/07/10 18:17
  45. */
  46. public function onlineLists()
  47. {
  48. return $this->dataLists(new MasterWorkerOnlineLists());
  49. }
  50. /**
  51. * @notes 添加
  52. * @return \think\response\Json
  53. * @author likeadmin
  54. * @date 2024/07/10 18:17
  55. */
  56. public function add()
  57. {
  58. $params = (new MasterWorkerValidate())->post()->goCheck('add');
  59. $result = MasterWorkerLogic::add($params);
  60. if (true === $result) {
  61. return $this->success('添加成功', [], 1, 1);
  62. }
  63. return $this->fail(MasterWorkerLogic::getError());
  64. }
  65. /**
  66. * @notes 编辑
  67. * @return \think\response\Json
  68. * @author likeadmin
  69. * @date 2024/07/10 18:17
  70. */
  71. public function edit()
  72. {
  73. $params = (new MasterWorkerValidate())->post()->goCheck('edit');
  74. $result = MasterWorkerLogic::edit($params);
  75. if (true === $result) {
  76. return $this->success('编辑成功', [], 1, 1);
  77. }
  78. return $this->fail(MasterWorkerLogic::getError());
  79. }
  80. /**
  81. * @notes 删除
  82. * @return \think\response\Json
  83. * @author likeadmin
  84. * @date 2024/07/10 18:17
  85. */
  86. public function delete()
  87. {
  88. $params = (new MasterWorkerValidate())->post()->goCheck('delete');
  89. MasterWorkerLogic::delete($params);
  90. return $this->success('删除成功', [], 1, 1);
  91. }
  92. /**
  93. * @notes 获取详情
  94. * @return \think\response\Json
  95. * @author likeadmin
  96. * @date 2024/07/10 18:17
  97. */
  98. public function detail()
  99. {
  100. $params = (new MasterWorkerValidate())->goCheck('detail');
  101. $result = MasterWorkerLogic::detail($params);
  102. return $this->data($result);
  103. }
  104. /**
  105. * 获取加盐密码
  106. * @return \think\response\Json
  107. */
  108. public function saltToPassword()
  109. {
  110. $params = (new MasterWorkerValidate())->get()->goCheck('saltToPassword');
  111. $result = MasterWorkerLogic::saltToPassword($params);
  112. if (false === $result) {
  113. return $this->fail(MasterWorkerLogic::getError());
  114. }
  115. return $this->data($result);
  116. }
  117. /**
  118. * @notes 工程师余额数据分析
  119. * @return \think\response\Json
  120. */
  121. public function moneyAnalysis()
  122. {
  123. return $this->dataLists(new MoneyAnalysis());
  124. }
  125. public function getAllWorkers()
  126. {
  127. $params = (new MasterWorkerValidate())->get();
  128. return $this->data(MasterWorkerLogic::getAllWorkers($params));
  129. }
  130. /**
  131. * @notes 长期合作工程师停单
  132. * @return \think\response\Json
  133. */
  134. public function stop()
  135. {
  136. $params = (new MasterWorkerValidate())->post()->goCheck('stop');
  137. $result = MasterWorkerLogic::stop($params,$this->adminInfo);
  138. if (true === $result) {
  139. return $this->success('停单成功', [], 1, 1);
  140. }
  141. return $this->fail(MasterWorkerLogic::getError());
  142. }
  143. /**
  144. * @notes 长期合作工程师停单记录列表
  145. * @return \think\response\Json
  146. */
  147. public function stopLists()
  148. {
  149. return $this->dataLists(new MasterWorkerStopLists());
  150. }
  151. /**
  152. * @notes 长期合作工程师排班列表
  153. * @return \think\response\Json
  154. */
  155. public function scheduleLists()
  156. {
  157. return $this->dataLists(new MasterWorkerScheduleLists());
  158. }
  159. /**
  160. * @notes 设置备注
  161. * @return \think\response\Json
  162. * @author likeadmin
  163. * @date 2024/07/10 18:17
  164. */
  165. public function setRemark()
  166. {
  167. $params = (new MasterWorkerValidate())->post()->goCheck('remark');
  168. $result = MasterWorkerLogic::setRemark($params);
  169. if (true === $result) {
  170. return $this->success('设置成功', [], 1, 1);
  171. }
  172. return $this->fail(MasterWorkerLogic::getError());
  173. }
  174. /**
  175. * @notes 设置特殊技能
  176. * @return \think\response\Json
  177. * @author likeadmin
  178. * @date 2024/07/10 18:17
  179. */
  180. public function setSkill()
  181. {
  182. $params = (new MasterWorkerValidate())->post()->goCheck('skill');
  183. $result = MasterWorkerLogic::setSkill($params);
  184. if (true === $result) {
  185. return $this->success('设置成功', [], 1, 1);
  186. }
  187. return $this->fail(MasterWorkerLogic::getError());
  188. }
  189. /**
  190. * @notes 工程师质保金缴费二维码
  191. * @return \think\response\Json
  192. */
  193. public function retentionMoneyOrder()
  194. {
  195. $params = request()->post();
  196. $result = MasterWorkerLogic::retentionMoneyOrder($params);
  197. if (false === $result) {
  198. return $this->fail(MasterWorkerLogic::getError());
  199. }
  200. return $this->success('', $result, 1, 1);
  201. }
  202. /**
  203. * @notes 工程师质保金退费申请
  204. * @return \think\response\Json
  205. */
  206. public function retentionMoneyRefund()
  207. {
  208. $params = request()->post();
  209. $result = MasterWorkerLogic::retentionMoneyRefund($params);
  210. if (false === $result) {
  211. return $this->fail(MasterWorkerLogic::getError());
  212. }
  213. return $this->success('', $result, 1, 1);
  214. }
  215. }