package com.ydtech.modules.protocols.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ydtech.core.page.HttpResult; import com.ydtech.core.page.PageResult; import com.ydtech.modules.base.controller.BaseController; import com.ydtech.modules.protocol.service.PtlAgreementProductCostsHistoryService; import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsNewHistory; import com.ydtech.modules.protocols.entity.po.PtlAgreementUndwrtRulesAttr; import com.ydtech.modules.protocols.entity.po.PtlAgreementUndwrtRulesNewHistory; import com.ydtech.modules.protocols.entity.vo.AgreementProductQueryVo; import com.ydtech.modules.protocols.entity.vo.AgreementUndwrtRulesQueryVo; import com.ydtech.modules.protocols.service.PtlAgreementProductCostsNewHistoryService; import com.ydtech.modules.protocols.service.PtlAgreementUndwrtRulesAttrService; import com.ydtech.modules.protocols.service.PtlAgreementUndwrtRulesNewHistoryService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import java.util.HashMap; import java.util.List; /** * @author * @description * @createDate */ @Api(tags = "协议历史查询") @RequestMapping("/plt/new/agreementhistory") @RestController public class PtlNewAgreementHistoryController extends BaseController { @Value("${agreement.shutdown}") private boolean shutdown; @Autowired private PtlAgreementProductCostsHistoryService ptlAgreementProductCostsHistoryService; @Autowired private PtlAgreementUndwrtRulesNewHistoryService ptlAgreementUndwrtRulesNewHistoryService; @Autowired private PtlAgreementProductCostsNewHistoryService ptlAgreementProductCostsNewHistoryService; @Autowired private PtlAgreementUndwrtRulesAttrService ptlAgreementUndwrtRulesAttrService; // // @PostMapping("costsHistoryPage") // @ApiOperation("分页查询协议历史记录") // public HttpResult costsHistoryPage(@RequestBody PtlAgreementProductQueryVo ptlAgreementProductCostsHistory) { // Page page = buildPageRequest(ptlAgreementProductCostsHistory.getPageDto()); // Page ptlAgreementProductCostsHistoryPage = ptlAgreementProductCostsHistoryService.pageHistory(page,ptlAgreementProductCostsHistory); // return HttpResult.ok(buildPageResponse(ptlAgreementProductCostsHistoryPage)); // } @PostMapping("agreementHistoryPage") @ApiOperation("分页查询产品费用历史记录") public HttpResult agreementHistoryPage(@RequestBody AgreementProductQueryVo agreementProductQueryVo) { List undwrtRulesAttrList = ptlAgreementUndwrtRulesAttrService.getUndwrtRulesAttrList(); Page ptlAgreementPage = ptlAgreementProductCostsNewHistoryService.pageHistory(agreementProductQueryVo, undwrtRulesAttrList); return HttpResult.ok(buildPageResponse(ptlAgreementPage)); } @GetMapping("/getCostDetail/{batchNo}") @ApiOperation("产品费用历史记录详情") public HttpResult> getCostDetail(@PathVariable String batchNo) { HashMap costsNewHistory = ptlAgreementProductCostsNewHistoryService.getCostHistoryDetail(batchNo); return HttpResult.ok(costsNewHistory); } @GetMapping("/costComparison/{batchNo}") @ApiOperation("产品费用历史记录比对") public HttpResult> costComparison(@PathVariable String batchNo) { HashMap costsNewHistory = ptlAgreementProductCostsNewHistoryService.costComparison(batchNo); return HttpResult.ok(costsNewHistory); } @PostMapping("rulesHistoryPage") @ApiOperation("分页查询承保规则历史记录") public HttpResult rulesHistoryPage(@RequestBody AgreementUndwrtRulesQueryVo agreementUndwrtRulesQueryVo) { List undwrtRulesAttrList = ptlAgreementUndwrtRulesAttrService.getUndwrtRulesAttrList(); Page ptlAgreementUndwrtRulesPage = ptlAgreementUndwrtRulesNewHistoryService.pageHistory(agreementUndwrtRulesQueryVo, undwrtRulesAttrList); return HttpResult.ok(buildPageResponse(ptlAgreementUndwrtRulesPage)); } @GetMapping("/getRulesDetail/{batchNo}") @ApiOperation("承包规则历史记录详情") public HttpResult> getRulesDetail(@PathVariable String batchNo) { HashMap rulesNewHistory = ptlAgreementUndwrtRulesNewHistoryService.getRulesHistoryDetail(batchNo); return HttpResult.ok(rulesNewHistory); } @GetMapping("/rulesComparison/{batchNo}") @ApiOperation("承包规则历史记录比对") public HttpResult> rulesComparison(@PathVariable String batchNo) { HashMap rulesNewHistory = ptlAgreementUndwrtRulesNewHistoryService.rulesComparison(batchNo); return HttpResult.ok(rulesNewHistory); } }