Commit a45fd369 authored by lanbaoming's avatar lanbaoming

Merge branch 'release'

parents 3197e2d0 d09f1dd4
...@@ -19,4 +19,9 @@ public class OfferAssociationOrderEvent { ...@@ -19,4 +19,9 @@ public class OfferAssociationOrderEvent {
* 订单编号 * 订单编号
*/ */
private String orderNo; private String orderNo;
/**
* 操作人
*/
private String operator;
} }
...@@ -349,7 +349,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -349,7 +349,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 如果报价单id不为空,则表示此订单关联报价单 // 如果报价单id不为空,则表示此订单关联报价单
if (Objects.nonNull(createReqVO.getOfferId()) && createReqVO.getOfferId() > 0L) { if (Objects.nonNull(createReqVO.getOfferId()) && createReqVO.getOfferId() > 0L) {
applicationContext.publishEvent(new OfferAssociationOrderEvent(createReqVO.getOfferId(), order.getOrderId(), order.getOrderNo())); applicationContext.publishEvent(new OfferAssociationOrderEvent(createReqVO.getOfferId(), order.getOrderId(), order.getOrderNo(), order.getCreator()));
} }
try { try {
if (memberUserDO != null && null != createReqVO.getUserId()) { if (memberUserDO != null && null != createReqVO.getUserId()) {
...@@ -1389,7 +1389,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1389,7 +1389,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 如果报价单id不为空,则表示此订单关联报价单 // 如果报价单id不为空,则表示此订单关联报价单
if (Objects.nonNull(updateReqVO.getOfferId()) && updateReqVO.getOfferId() > 0L) { if (Objects.nonNull(updateReqVO.getOfferId()) && updateReqVO.getOfferId() > 0L) {
applicationContext.publishEvent(new OfferAssociationOrderEvent(updateReqVO.getOfferId(), updateObj.getOrderId(), updateObj.getOrderNo())); applicationContext.publishEvent(new OfferAssociationOrderEvent(updateReqVO.getOfferId(), updateObj.getOrderId(), updateObj.getOrderNo(), updater));
} }
// 更新特需 // 更新特需
this.saveOrUpdateSpecialNeed(updateObj.getOrderId(), updateObj.getPackageType(), updateObj.getPackageRemarks(), updater, now); this.saveOrUpdateSpecialNeed(updateObj.getOrderId(), updateObj.getPackageType(), updateObj.getPackageRemarks(), updater, now);
......
...@@ -10,6 +10,7 @@ import lombok.AllArgsConstructor; ...@@ -10,6 +10,7 @@ import lombok.AllArgsConstructor;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.Objects; import java.util.Objects;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
...@@ -34,10 +35,10 @@ public class OfferAssociationOrderListener { ...@@ -34,10 +35,10 @@ public class OfferAssociationOrderListener {
@EventListener(OfferAssociationOrderEvent.class) @EventListener(OfferAssociationOrderEvent.class)
public void OfferUpdateOrderNumber(OfferAssociationOrderEvent event) { public void OfferUpdateOrderNumber(OfferAssociationOrderEvent event) {
OfferDO offerDO = offerService.getOffer(event.getOfferId()); OfferDO offerDO = offerService.getOffer(event.getOfferId());
if (Objects.isNull(offerDO)){ if (Objects.isNull(offerDO)) {
throw exception(OFFER_NOT_EXISTS); throw exception(OFFER_NOT_EXISTS);
} }
if (offerDO.getStatus() == 1 ){ if (offerDO.getStatus() == 1) {
throw exception(OFFER_STATUS_ERROR); throw exception(OFFER_STATUS_ERROR);
} }
if (Objects.nonNull(offerDO.getOrderId()) && offerDO.getOrderId() > 0L) { if (Objects.nonNull(offerDO.getOrderId()) && offerDO.getOrderId() > 0L) {
...@@ -47,6 +48,10 @@ public class OfferAssociationOrderListener { ...@@ -47,6 +48,10 @@ public class OfferAssociationOrderListener {
} }
offerDO.setOrderNo(event.getOrderNo()); offerDO.setOrderNo(event.getOrderNo());
offerDO.setOrderId(event.getOrderId()); offerDO.setOrderId(event.getOrderId());
offerDO.setStatus(4);
offerDO.setUpdater(event.getOperator());
offerDO.setUpdateTime(new Date());
offerService.updateById(offerDO); offerService.updateById(offerDO);
offerService.addOfferLog(offerDO.getOfferId(), offerDO.getNumber(), offerDO.getRelationId(), 6, event.getOperator(), "报价单赢单");
} }
} }
...@@ -175,4 +175,17 @@ public interface OfferService extends IService<OfferDO> { ...@@ -175,4 +175,17 @@ public interface OfferService extends IService<OfferDO> {
void associationOfferAndOrder(Long offerId, Long orderId); void associationOfferAndOrder(Long offerId, Long orderId);
EstCostVO getOfferCostByOrderId(Long orderId); EstCostVO getOfferCostByOrderId(Long orderId);
/**
* 报价单操作日志添加
*
* @param offerId 报价单ID
* @param number 报价单号
* @param customerId 客户ID
* @param followUpMethod 方式 1:新建报价 2 修改报价 3特价申请 4电话 5网络 6报价结束
* @param userId 操作用户ID(业务员ID)
* @param result 处理结果说明
*/
void addOfferLog(Long offerId, String number, Long customerId, Integer followUpMethod, String userId, String result);
} }
...@@ -291,7 +291,7 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl ...@@ -291,7 +291,7 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
* @param userId 操作用户ID(业务员ID) * @param userId 操作用户ID(业务员ID)
* @param result 处理结果说明 * @param result 处理结果说明
*/ */
private void addOfferLog(Long offerId, String number, Long customerId, Integer followUpMethod, String userId, String result) { public void addOfferLog(Long offerId, String number, Long customerId, Integer followUpMethod, String userId, String result) {
String contacts = ""; String contacts = "";
if (null != customerId) { if (null != customerId) {
// TODO 查询客户信息 // TODO 查询客户信息
......
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