|
|
|
@ -2,15 +2,29 @@ package com.qniao.dam.application.service.eso; |
|
|
|
|
|
|
|
import com.qniao.dam.domain.aggregate.eso.EntrustServiceOrderAggregate; |
|
|
|
import com.qniao.dam.domain.aggregate.eso.entity.EntrustServiceOrder; |
|
|
|
import com.qniao.dam.domian.aggregate.eso.constant.EntrustServicePaymentStatusEnum; |
|
|
|
import com.qniao.dam.domian.aggregate.eso.constant.EntrustServiceStatusEnum; |
|
|
|
import com.qniao.dam.query.eso.EntrustServiceOrderQueryService; |
|
|
|
import com.qniao.dam.query.matchmakermarriage.MatchmakerMarriageInformationQueryService; |
|
|
|
import com.qniao.das.domian.aggregate.matchmakermarriage.MatchmakerMarriageInformation; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class EntrustServiceOrderApplicationService { |
|
|
|
|
|
|
|
@Resource |
|
|
|
private EntrustServiceOrderAggregate entrustServiceOrderAggregate; |
|
|
|
@Resource |
|
|
|
private EntrustServiceOrderQueryService entrustServiceOrderQueryService; |
|
|
|
@Resource |
|
|
|
private MatchmakerMarriageInformationQueryService matchmakerMarriageInformationQueryService; |
|
|
|
|
|
|
|
@Value("${default_marriage_bounty_matchmaker_id}") |
|
|
|
private Long defaultMatchmakerId; |
|
|
|
|
|
|
|
public void create(EntrustServiceOrder entrustServiceOrder) { |
|
|
|
entrustServiceOrderAggregate.create(entrustServiceOrder); |
|
|
|
@ -21,6 +35,21 @@ public class EntrustServiceOrderApplicationService { |
|
|
|
} |
|
|
|
|
|
|
|
public void delete(Long id) { |
|
|
|
entrustServiceOrderAggregate.delete(id); |
|
|
|
entrustServiceOrderAggregate.delete(id); |
|
|
|
} |
|
|
|
|
|
|
|
public void save(Long associateOrderId) { |
|
|
|
EntrustServiceOrder entrustServiceOrder = entrustServiceOrderQueryService.queryByAssociateOrderId(associateOrderId); |
|
|
|
entrustServiceOrder.setPaidAmount(entrustServiceOrder.getRewardAmount()); |
|
|
|
entrustServiceOrder.setStatus(EntrustServiceStatusEnum.PENDING_ACCEPT); |
|
|
|
entrustServiceOrder.setPaymentStatus(EntrustServicePaymentStatusEnum.PAID); |
|
|
|
//服务红娘配置 |
|
|
|
MatchmakerMarriageInformation matchmakerMarriageInformation = matchmakerMarriageInformationQueryService.queryByRecommend(entrustServiceOrder.getTargetUserId()); |
|
|
|
if (Objects.nonNull(matchmakerMarriageInformation)) { |
|
|
|
entrustServiceOrder.setMatchmakerId(matchmakerMarriageInformation.getMatchmakerId()); |
|
|
|
} else { |
|
|
|
entrustServiceOrder.setMatchmakerId(defaultMatchmakerId); |
|
|
|
} |
|
|
|
entrustServiceOrderAggregate.edit(entrustServiceOrder); |
|
|
|
} |
|
|
|
} |