Commit 95c115a4 authored by zhengyi's avatar zhengyi

提供获取报价单编号接口和客户关联的报价单下拉框接口

parent 2f910c29
......@@ -188,4 +188,13 @@ public interface OfferService extends IService<OfferDO> {
* @param result 处理结果说明
*/
void addOfferLog(Long offerId, String number, Long customerId, Integer followUpMethod, String userId, String result);
/**
* 跟进客户查询其关联的报价单
*
* @param customerId 客户id
* @param searchKey 关键字搜索
* @return
*/
List<OfferRespVO> getCustomerOfferSelect(Long customerId, String searchKey);
}
......@@ -927,12 +927,12 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
}
// 查询该订单是否有绑定报价单
OfferDO offer = offerMapper.selectOne(new LambdaQueryWrapper<OfferDO>().eq(OfferDO::getOfferId, orderDO.getOrderId()).last("limit 1"));
if (Objects.nonNull(offer)){
if (Objects.nonNull(offer)) {
throw exception(ORDER_BOUND_OFFER);
}
//如果订单关联上报价单
if(orderDO!=null && offerDO.getOfferId()!=null){
this.checkOrderSalesman(orderDO,offerDO.getOfferId()) ;
if (orderDO != null && offerDO.getOfferId() != null) {
this.checkOrderSalesman(orderDO, offerDO.getOfferId());
}
} else {
......@@ -960,12 +960,13 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
/**
* 赢单处理报价单时,再次判断业绩归属
*
* @param orderDO
* @param offerId
*/
private void checkOrderSalesman(OrderDO orderDO, Long offerId) {
orderService.checkOrderSalesman(orderDO,offerId,null,null,null,null);
orderService.updateOrderCustomerAndSalesmanId(orderDO.getCustomerId()!=null?orderDO.getCustomerId():0,orderDO.getSalesmanId()!=null?orderDO.getSalesmanId():0,orderDO.getOrderId()) ;
orderService.checkOrderSalesman(orderDO, offerId, null, null, null, null);
orderService.updateOrderCustomerAndSalesmanId(orderDO.getCustomerId() != null ? orderDO.getCustomerId() : 0, orderDO.getSalesmanId() != null ? orderDO.getSalesmanId() : 0, orderDO.getOrderId());
}
private OrderDO generateOrder(OfferDO offerDO, OfferResultVO offerResultVO) {
......@@ -1533,4 +1534,12 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
}
return JSONObject.parseObject(offerDO.getEstCost(), EstCostVO.class);
}
@Override
public List<OfferRespVO> getCustomerOfferSelect(Long customerId, String searchKey) {
List<OfferDO> offerDOList = offerMapper.selectList(new LambdaQueryWrapper<OfferDO>().eq(OfferDO::getRelationId, customerId)
.like(StringUtils.isNotBlank(searchKey), OfferDO::getNumber, searchKey)
.orderByDesc(OfferDO::getOrderId).last("limit 10"));
return OfferConvert.INSTANCE.convertList(offerDOList);
}
}
......@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.sale.dal.dataobject.offer.OfferDO;
import cn.iocoder.yudao.module.sale.vo.offer.*;
import cn.iocoder.yudao.module.sale.vo.offerApproval.OfferApprovalBackInfoVO;
import cn.iocoder.yudao.module.system.api.permission.RoleApi;
......@@ -164,6 +165,15 @@ public class OfferController {
}
@GetMapping("/getNumber/{offerId}")
@ApiOperation("获得报价单编号")
@ApiImplicitParam(name = "offerId", value = "报价单ID", required = true, example = "1024", dataTypeClass = Long.class)
public CommonResult<String> getOfferNumber(@PathVariable("offerId") Long offerId) {
OfferDO offer = offerService.getOffer(offerId);
return success(offer.getNumber());
}
@GetMapping("/page")
@ApiOperation("获得报价单管理分页")
// @PreAuthorize("@ss.hasPermission('ecw:offer:query')")
......@@ -271,6 +281,18 @@ public class OfferController {
return success(respVOList);
}
@GetMapping("/customer/select")
@ApiOperation(value = "获得客户关联的报价单列表下拉框数据", notes = "获取客户关联的报价单列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "customerId", value = "客户id", required = true, example = "1024", dataTypeClass = Long.class),
@ApiImplicitParam(name = "searchKey", value = "关键字搜索(当前只支出报价单编号模糊匹配)", required = false, example = "1024", dataTypeClass = String.class),
})
public CommonResult<List<OfferRespVO>> getCustomerOfferSelect(@RequestParam("customerId") Long customerId, @RequestParam(value = "searchKey", required = false) String searchKey) {
// 核查订单关联报价单异常
List<OfferRespVO> respVOList = offerService.getCustomerOfferSelect(customerId,searchKey);
return success(respVOList);
}
@PutMapping("/association")
@ApiOperation(value = "订单关联报价单", notes = "订单关联报价单")
@ApiImplicitParams({
......
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