FinancialReceivablesController.java 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. package com.ydtech.modules.admin.controller.financialReceivables;
  2. import com.ydtech.core.page.HttpResult;
  3. import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllMonthVo;
  4. import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllVo;
  5. import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryMonthVo;
  6. import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
  7. import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
  8. import com.ydtech.modules.admin.utils.KztGetDeptUtils;
  9. import com.ydtech.modules.fnc.service.InsPlyIncomeService;
  10. import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
  11. import io.swagger.annotations.Api;
  12. import io.swagger.annotations.ApiModelProperty;
  13. import org.apache.commons.lang3.ObjectUtils;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.web.bind.annotation.PostMapping;
  16. import org.springframework.web.bind.annotation.RequestBody;
  17. import org.springframework.web.bind.annotation.RequestMapping;
  18. import org.springframework.web.bind.annotation.RestController;
  19. import javax.servlet.http.HttpServletRequest;
  20. import java.util.ArrayList;
  21. import java.util.HashMap;
  22. import java.util.List;
  23. import java.util.Map;
  24. /**
  25. * @version
  26. * @author: hxl
  27. * @Date: 2024/7/31 15:33
  28. * @Description: 财务应收
  29. */
  30. @Api(tags = "财务应收")
  31. @RequestMapping("/financialReceivables")
  32. @RestController
  33. public class FinancialReceivablesController {
  34. @Autowired
  35. private InsPlyIncomeService insPlyIncomeService;
  36. /**
  37. * @version
  38. * @author: hxl
  39. * @Date: 2024/8/1 9:20
  40. * @Description: 获取平台(私有协议 、平台)
  41. */
  42. @PostMapping("/queryDateByType")
  43. @ApiModelProperty(value = "获取平台私有数据列表")
  44. public HttpResult<FinancialReceivablesAllVo> queryDateByType(@RequestBody FinancialReceivablesQueryVo financialReceivablesQueryVo, HttpServletRequest httpServerRequest) {
  45. KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
  46. KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
  47. if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
  48. if("1".equals(kztGetDeptUtilsDto.getType())){
  49. financialReceivablesQueryVo.setDeptIds(kztGetDeptUtilsDto.getIds());
  50. } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
  51. financialReceivablesQueryVo.setUserIds(kztGetDeptUtilsDto.getIds());
  52. }
  53. }
  54. return HttpResult.ok(insPlyIncomeService.queryDateByType(financialReceivablesQueryVo));
  55. }
  56. /**
  57. * @version
  58. * @author: whp
  59. * @Date: 2024/8/7 9:20
  60. * @Description: 私有 车险
  61. */
  62. @PostMapping("/queryPrivateCar")
  63. @ApiModelProperty(value = "私有车险列表")
  64. public HttpResult<FinancialReceivablesAllVo> queryPrivateCar(@RequestBody FinancialReceivablesQueryVo financialReceivablesQueryVo) {
  65. return HttpResult.ok(insPlyIncomeService.queryPrivateCar(financialReceivablesQueryVo));
  66. }
  67. @PostMapping("/queryDateByTypeByMonth")
  68. @ApiModelProperty(value = "获取详情列表")
  69. public HttpResult<FinancialReceivablesAllMonthVo> queryDateByTypeByMonth(@RequestBody FinancialReceivablesQueryMonthVo financialReceivablesQueryVo) {
  70. return HttpResult.ok(insPlyIncomeService.queryDateByTypeByMonth(financialReceivablesQueryVo));
  71. }
  72. /**
  73. *
  74. * @param insPlyIncomeVo
  75. * @return 返回私有 平台 应收 已收 未收
  76. */
  77. @PostMapping("/totalReceivables")
  78. @ApiModelProperty(value = "平台 私有 应收未收 金额")
  79. public HttpResult<ArrayList<Map<String,Object>>> totalReceivables(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
  80. return insPlyIncomeService.totalReceivables(insPlyIncomeVo);
  81. }
  82. /**
  83. *
  84. * @param insPlyIncomeVo
  85. * @return 返回私有 1 到 12 月 应收 已收
  86. */
  87. @PostMapping("/monthTotalReceivables")
  88. @ApiModelProperty(value = "私有平台 已收未收金额")
  89. public HttpResult<List<HashMap<String,Object>>> monthTotalReceivables(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
  90. return insPlyIncomeService.monthTotalReceivables(insPlyIncomeVo);
  91. }
  92. }