DataCentreController.java 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. package com.sqx.modules.datacentre.controller;
  2. import com.sqx.common.utils.Result;
  3. import com.sqx.modules.app.entity.RechargeRecord;
  4. import com.sqx.modules.app.service.RechargeRecordService;
  5. import com.sqx.modules.app.service.UserMoneyService;
  6. import com.sqx.modules.coupon.entity.TbCouponUser;
  7. import com.sqx.modules.coupon.service.TbCouponService;
  8. import com.sqx.modules.coupon.service.TbCouponUserService;
  9. import com.sqx.modules.datacentre.query.DataCenterQuery;
  10. import com.sqx.modules.datacentre.query.ShopCenterQuery;
  11. import com.sqx.modules.datacentre.service.DataCentreService;
  12. import com.sqx.modules.errand.service.ErrandComplaintService;
  13. import com.sqx.modules.integral.dao.UserIntegralDetailsDao;
  14. import com.sqx.modules.integral.service.UserIntegralDetailsService;
  15. import com.sqx.modules.order.service.AppOrderService;
  16. import io.swagger.annotations.Api;
  17. import io.swagger.annotations.ApiOperation;
  18. import org.springframework.beans.factory.annotation.Autowired;
  19. import org.springframework.web.bind.annotation.*;
  20. import javax.validation.Valid;
  21. import java.math.BigDecimal;
  22. @RestController
  23. @Api(value = "数据中心-管理端", tags = {"数据中心-管理端"})
  24. @RequestMapping(value = "/admin/dataCentre")
  25. public class DataCentreController {
  26. @Autowired
  27. private DataCentreService dataCentreService;
  28. @Autowired
  29. private AppOrderService appOrderService;
  30. @Autowired
  31. private TbCouponUserService tbCouponUserService;
  32. @Autowired
  33. private UserIntegralDetailsService userIntegralDetailsService;
  34. @Autowired
  35. private UserMoneyService userMoneyService;
  36. @Autowired
  37. private ErrandComplaintService errandComplaintService;
  38. @Autowired
  39. private RechargeRecordService rechargeRecordService;
  40. @ApiOperation("数据中心")
  41. @GetMapping(value = "/dataCentre")
  42. public Result dataCentre() {
  43. return dataCentreService.dataCentre();
  44. }
  45. @ApiOperation("任务分析")
  46. @GetMapping(value = "selectOrderData")
  47. public Result selectOrderData(DataCenterQuery query) {
  48. return dataCentreService.selectOrderData(query);
  49. }
  50. @ApiOperation("任务详情分析")
  51. @GetMapping(value = "/selectOrderAnalyze")
  52. public Result selectPayOrderAnalyze(DataCenterQuery query) {
  53. return dataCentreService.selectPayOrderAnalyze(query);
  54. }
  55. @ApiOperation("条件筛选所有用户")
  56. @GetMapping(value = "selectAllUser")
  57. public Result selectAllUser(Integer page, Integer limit, String userName, String phone) {
  58. return dataCentreService.selectAllUser(page, limit, userName, phone);
  59. }
  60. @ApiOperation("根据userId查询")
  61. @GetMapping(value = "selectUserById")
  62. public Result selectUserById(Long userId) {
  63. return dataCentreService.selectUserById(userId);
  64. }
  65. @ApiOperation("给用户账户修改余额")
  66. @GetMapping(value = "addUserMoney")
  67. public Result addUserMoney(Long userId, BigDecimal money, Integer type, String account, String remark) {
  68. return userMoneyService.addUserMoney(userId, money, type, account, remark);
  69. }
  70. //修改充值记录备注
  71. @ApiOperation("修改充值记录备注")
  72. @GetMapping(value = "updateRecordById")
  73. public Result updateRecordById(Integer id, String remark) {
  74. RechargeRecord rr = rechargeRecordService.selectRechargeRecordById(id);
  75. if (rr == null) {
  76. return Result.error("记录无效,备注添加失败");
  77. }
  78. rr.setRemark(remark);
  79. return rechargeRecordService.updateRechargeRecord(rr);
  80. }
  81. //分页数据
  82. @ApiOperation("充值记录分页数据")
  83. @GetMapping("getRecordList")
  84. public Result getRecordList(Integer page, Integer limit, String orderNo, String phone) {
  85. return rechargeRecordService.selectRechargeRecordList(page, limit, orderNo, phone);
  86. }
  87. @ApiOperation("修改用户保证金")
  88. @GetMapping(value = "updateCashDeposit")
  89. public Result updateCashDeposit(Long userId, BigDecimal money, Integer type) {
  90. return userMoneyService.updateCashDeposit(userId, money, type);
  91. }
  92. @ApiOperation("给骑手修改余额")
  93. @GetMapping(value = "updateUserBalance")
  94. public Result updateUserBalance(Long userId, BigDecimal money, Integer type) {
  95. return userMoneyService.updateUserBalance(userId, money, type);
  96. }
  97. @ApiOperation("查看该用户下单信息(下单数、下单金额)")
  98. @GetMapping(value = "selectOrderByUserId")
  99. public Result selectOrderByUserId(Long userId, String date, String dateType) {
  100. return appOrderService.selectOrderByUserId(userId, date, dateType);
  101. }
  102. @ApiOperation("查看该用户下单详情")
  103. @GetMapping(value = "selectOrderDetails")
  104. public Result selectOrderDetails(Integer page, Integer limit, Long userId) {
  105. return appOrderService.selectOrderDetails(page, limit, userId);
  106. }
  107. @ApiOperation("查看用户拥有的优惠券")
  108. @GetMapping(value = "selectCouponByUserId")
  109. public Result selectCouponByUserId(Integer page, Integer limit, Long userId, Integer status, String phone, String shopName, Long shopId, Integer shopFlag/*是否平台券 1是 2否 0 全部 */) {
  110. return tbCouponUserService.selectCouponByUserId(page, limit, userId, status, phone, shopName, shopId, shopFlag);
  111. }
  112. @ApiOperation("查看积分明细")
  113. @GetMapping(value = "/selectSignIn")
  114. public Result selectSignIn(Integer page, Integer limit, Long userId) {
  115. return userIntegralDetailsService.selectSignIn(page, limit, userId);
  116. }
  117. @ApiOperation("财务中心-充值统计")
  118. @GetMapping(value = "selectTopUpStatistics")
  119. public Result selectTopUpStatistics(String date, String dateType) {
  120. return dataCentreService.selectTopUpStatistics(date, dateType);
  121. }
  122. @ApiOperation("查看所有实名认证待审核用户")
  123. @GetMapping(value = "findAllCertification")
  124. public Result findAllCertification(Integer page, Integer limit, String userName, String phone, String checkCertification) {
  125. return dataCentreService.findAllCertification(page, limit, userName, phone, checkCertification);
  126. }
  127. @ApiOperation("实名认证审核")
  128. @PostMapping("checkCertification")
  129. public Result checkCertification(Long userId, String checkCertification, String checkCertificationMessage) {
  130. return dataCentreService.checkCertification(userId, checkCertification, checkCertificationMessage);
  131. }
  132. @ApiOperation("查看用户实名认证信息")
  133. @GetMapping(value = "findCertification")
  134. public Result findCertification(Long userId) {
  135. return dataCentreService.findCertification(userId);
  136. }
  137. @ApiOperation("接单排行榜")
  138. @GetMapping(value = "rankingList")
  139. public Result rankingList(Integer page, Integer limit, String address, String date, String dateType) {
  140. return dataCentreService.rankingList(page, limit, address, date, dateType);
  141. }
  142. @ApiOperation("门店统计")
  143. @GetMapping(value = "selectShopCenter")
  144. public Result selectShopCenter(@Valid ShopCenterQuery query) {
  145. return dataCentreService.selectShopCenter(query);
  146. }
  147. @ApiOperation("用户统计")
  148. @GetMapping(value = "selectUserCenter")
  149. public Result selectUserCenter(DataCenterQuery query) {
  150. return dataCentreService.selectUserCenter(query);
  151. }
  152. @GetMapping(value = "selectUserFeedback")
  153. @ApiOperation("查看意见反馈")
  154. public Result selectUserFeedback(String userEmail, Integer page, Integer limit) {
  155. return dataCentreService.selectUserFeedback(userEmail, page, limit);
  156. }
  157. @ApiOperation("获取该用户所有派单任务")
  158. @GetMapping(value = "findUserAddIndent")
  159. public Result findUserAddIndent(Long userId, Integer page, Integer limit) {
  160. return dataCentreService.findUserAddIndent(userId, page, limit);
  161. }
  162. @ApiOperation("获取该用户所有接单任务")
  163. @GetMapping(value = "findUserReceivingIndent")
  164. public Result findUserReceivingIndent(Long userId, Integer page, Integer limit) {
  165. return dataCentreService.findUserReceivingIndent(userId, page, limit);
  166. }
  167. @ApiOperation("查看充值明细")
  168. @GetMapping(value = "findTopUpMoney")
  169. public Result findTopUpMoney(Long userId, Integer page, Integer limit, String startTime, String endTime) {
  170. return dataCentreService.findTopUpMoney(userId, page, limit, startTime, endTime);
  171. }
  172. @ApiOperation("查看提现记录")
  173. @GetMapping(value = "findWithdrawMoney")
  174. public Result findWithdrawMoney(Long userId, Integer page, Integer limit) {
  175. return dataCentreService.findWithdrawMoney(userId, page, limit);
  176. }
  177. //查看全部骑手申诉(条件查询)
  178. @ApiOperation("查看全部骑手申诉")
  179. @GetMapping(value = "findAllAppeal")
  180. public Result findAllAppeal(Integer page, Integer limit, Long userId, Integer illegalId, Integer complaintState, String indentNumber) {
  181. return errandComplaintService.findAllAppeal(page, limit, userId, illegalId, complaintState, indentNumber);
  182. }
  183. @ApiOperation("同城跑腿收入统计")
  184. @GetMapping(value = "findplatformMoney")
  185. public Result findplatformMoney(String dateType, String date) {
  186. return dataCentreService.findplatformMoney(dateType, date);
  187. }
  188. @ApiOperation("外卖点餐收入统计")
  189. @GetMapping(value = "tcwmplatformMoney")
  190. private Result tcwmplatformMoney(String date, String dateType) {
  191. return dataCentreService.tcwmplatformMoney(date, dateType);
  192. }
  193. @ApiOperation("保证金管理")
  194. @GetMapping(value = "selectCashDeposit")
  195. public Result selectCashDeposit(String phone, Integer type, Integer page, Integer limit, Long userId) {
  196. return dataCentreService.selectCashDeposit(phone, type, page, limit, userId);
  197. }
  198. /* @ApiOperation("用户中心 用户列表")
  199. @GetMapping(value = "findAllUser")
  200. public Result findAllUser(Integer page, Integer limit, String phone, Integer userType, String platform, String nickName, String invitationCode){
  201. return dataCentreService.findAllUser(page, limit, phone, userType, platform, nickName, invitationCode);
  202. }*/
  203. @ApiOperation("查看反馈列表")
  204. @GetMapping(value = "selectFeedbackList")
  205. public Result selectFeedbackList(Integer page, Integer limit, Integer feedbackType) {
  206. return dataCentreService.selectFeedbackList(page, limit, feedbackType);
  207. }
  208. /*==========================================================*/
  209. @ApiOperation("管理端赠送用户会员")
  210. @PostMapping(value = "presenterVip")
  211. public Result presenterVip(Long userId) {
  212. return dataCentreService.presenterVip(userId);
  213. }
  214. }