PtlNewAgreementHistoryController.java 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. package com.ydtech.modules.protocols.controller;
  2. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  3. import com.ydtech.core.page.HttpResult;
  4. import com.ydtech.core.page.PageResult;
  5. import com.ydtech.modules.base.controller.BaseController;
  6. import com.ydtech.modules.protocol.service.PtlAgreementProductCostsHistoryService;
  7. import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsNewHistory;
  8. import com.ydtech.modules.protocols.entity.po.PtlAgreementUndwrtRulesAttr;
  9. import com.ydtech.modules.protocols.entity.po.PtlAgreementUndwrtRulesNewHistory;
  10. import com.ydtech.modules.protocols.entity.vo.AgreementProductQueryVo;
  11. import com.ydtech.modules.protocols.entity.vo.AgreementUndwrtRulesQueryVo;
  12. import com.ydtech.modules.protocols.service.PtlAgreementProductCostsNewHistoryService;
  13. import com.ydtech.modules.protocols.service.PtlAgreementUndwrtRulesAttrService;
  14. import com.ydtech.modules.protocols.service.PtlAgreementUndwrtRulesNewHistoryService;
  15. import io.swagger.annotations.Api;
  16. import io.swagger.annotations.ApiOperation;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.beans.factory.annotation.Value;
  19. import org.springframework.web.bind.annotation.*;
  20. import java.util.HashMap;
  21. import java.util.List;
  22. /**
  23. * @author
  24. * @description
  25. * @createDate
  26. */
  27. @Api(tags = "协议历史查询")
  28. @RequestMapping("/plt/new/agreementhistory")
  29. @RestController
  30. public class PtlNewAgreementHistoryController extends BaseController {
  31. @Value("${agreement.shutdown}")
  32. private boolean shutdown;
  33. @Autowired
  34. private PtlAgreementProductCostsHistoryService ptlAgreementProductCostsHistoryService;
  35. @Autowired
  36. private PtlAgreementUndwrtRulesNewHistoryService ptlAgreementUndwrtRulesNewHistoryService;
  37. @Autowired
  38. private PtlAgreementProductCostsNewHistoryService ptlAgreementProductCostsNewHistoryService;
  39. @Autowired
  40. private PtlAgreementUndwrtRulesAttrService ptlAgreementUndwrtRulesAttrService;
  41. //
  42. // @PostMapping("costsHistoryPage")
  43. // @ApiOperation("分页查询协议历史记录")
  44. // public HttpResult<PageResult> costsHistoryPage(@RequestBody PtlAgreementProductQueryVo ptlAgreementProductCostsHistory) {
  45. // Page page = buildPageRequest(ptlAgreementProductCostsHistory.getPageDto());
  46. // Page<PtlAgreementProductCostsHistory> ptlAgreementProductCostsHistoryPage = ptlAgreementProductCostsHistoryService.pageHistory(page,ptlAgreementProductCostsHistory);
  47. // return HttpResult.ok(buildPageResponse(ptlAgreementProductCostsHistoryPage));
  48. // }
  49. @PostMapping("agreementHistoryPage")
  50. @ApiOperation("分页查询产品费用历史记录")
  51. public HttpResult<PageResult> agreementHistoryPage(@RequestBody AgreementProductQueryVo agreementProductQueryVo) {
  52. List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList = ptlAgreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
  53. Page<PtlAgreementProductCostsNewHistory> ptlAgreementPage = ptlAgreementProductCostsNewHistoryService.pageHistory(agreementProductQueryVo, undwrtRulesAttrList);
  54. return HttpResult.ok(buildPageResponse(ptlAgreementPage));
  55. }
  56. @GetMapping("/getCostDetail/{batchNo}")
  57. @ApiOperation("产品费用历史记录详情")
  58. public HttpResult<HashMap<String, Object>> getCostDetail(@PathVariable String batchNo) {
  59. HashMap<String, Object> costsNewHistory = ptlAgreementProductCostsNewHistoryService.getCostHistoryDetail(batchNo);
  60. return HttpResult.ok(costsNewHistory);
  61. }
  62. @GetMapping("/costComparison/{batchNo}")
  63. @ApiOperation("产品费用历史记录比对")
  64. public HttpResult<HashMap<String, Object>> costComparison(@PathVariable String batchNo) {
  65. HashMap<String, Object> costsNewHistory = ptlAgreementProductCostsNewHistoryService.costComparison(batchNo);
  66. return HttpResult.ok(costsNewHistory);
  67. }
  68. @PostMapping("rulesHistoryPage")
  69. @ApiOperation("分页查询承保规则历史记录")
  70. public HttpResult<PageResult> rulesHistoryPage(@RequestBody AgreementUndwrtRulesQueryVo agreementUndwrtRulesQueryVo) {
  71. List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList = ptlAgreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
  72. Page<PtlAgreementUndwrtRulesNewHistory> ptlAgreementUndwrtRulesPage = ptlAgreementUndwrtRulesNewHistoryService.pageHistory(agreementUndwrtRulesQueryVo, undwrtRulesAttrList);
  73. return HttpResult.ok(buildPageResponse(ptlAgreementUndwrtRulesPage));
  74. }
  75. @GetMapping("/getRulesDetail/{batchNo}")
  76. @ApiOperation("承包规则历史记录详情")
  77. public HttpResult<HashMap<String, Object>> getRulesDetail(@PathVariable String batchNo) {
  78. HashMap<String, Object> rulesNewHistory = ptlAgreementUndwrtRulesNewHistoryService.getRulesHistoryDetail(batchNo);
  79. return HttpResult.ok(rulesNewHistory);
  80. }
  81. @GetMapping("/rulesComparison/{batchNo}")
  82. @ApiOperation("承包规则历史记录比对")
  83. public HttpResult<HashMap<String, Object>> rulesComparison(@PathVariable String batchNo) {
  84. HashMap<String, Object> rulesNewHistory = ptlAgreementUndwrtRulesNewHistoryService.rulesComparison(batchNo);
  85. return HttpResult.ok(rulesNewHistory);
  86. }
  87. }