Commit db723be1 authored by yanghao's avatar yanghao

task: #952 3.客户列表,新增一列【最新报价单】,显示当前客户关联的最晚创建时间的报价单,可穿越到报价单详情

parent 4c1bf40a
......@@ -522,6 +522,9 @@ public class CustomerController {
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
// 设置报价单号和报价id
setCustomerLastOffer(respVO);
}
}
return success(respVOPageResult);
......@@ -558,6 +561,9 @@ public class CustomerController {
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
// 设置报价单号和报价id
setCustomerLastOffer(respVO);
}
}
return success(respVOPageResult);
......@@ -580,6 +586,9 @@ public class CustomerController {
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
// 设置报价单号和报价id
setCustomerLastOffer(respVO);
}
}
return success(respVOPageResult);
......@@ -602,6 +611,9 @@ public class CustomerController {
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
// 设置报价单号和报价id
setCustomerLastOffer(respVO);
}
}
return success(respVOPageResult);
......@@ -715,6 +727,9 @@ public class CustomerController {
if (Objects.nonNull(customerFollowupDO)) {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
// 设置报价单号和报价id
setCustomerLastOffer(respVO);
}
}
return success(respVOPageResult);
......@@ -807,18 +822,22 @@ public class CustomerController {
respVO.setFollowupBackVO(CustomerFollowupConvert.INSTANCE.convert(customerFollowupDO));
}
// 设置报价单号和报价id
OfferDO lastOfferDO = offerMapper.selectOne(new LambdaQueryWrapper<OfferDO>().eq(OfferDO::getRelationId, respVO.getId())
.orderByDesc(OfferDO::getCreateTime).last("limit 1"));
if (lastOfferDO != null) {
respVO.setOfferId(lastOfferDO.getOfferId());
respVO.setOfferNumber(lastOfferDO.getNumber());
}
setCustomerLastOffer(respVO);
}
}
return success(respVOPageResult);
}
private void setCustomerLastOffer(CustomerRespVO respVO) {
// 设置报价单号和报价id
OfferDO lastOfferDO = offerMapper.selectOne(new LambdaQueryWrapper<OfferDO>().eq(OfferDO::getRelationId, respVO.getId())
.orderByDesc(OfferDO::getCreateTime).last("limit 1"));
if (lastOfferDO != null) {
respVO.setOfferId(lastOfferDO.getOfferId());
respVO.setOfferNumber(lastOfferDO.getNumber());
}
}
@GetMapping("/deptPage")
@ApiOperation("获得部门客户")
@PreAuthorize("@ss.hasAnyPermissions('ecw:customer:query', 'ecw:customer:dep-query')")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment