|
|
@@ -3,7 +3,9 @@ package cn.com.taiji.managew.manager.issueOrder; |
|
|
|
import cn.com.taiji.common.manager.ManagerException; |
|
|
|
import cn.com.taiji.common.manager.net.http.ServiceHandleException; |
|
|
|
import cn.com.taiji.common.model.dao.Pagination; |
|
|
|
import cn.com.taiji.core.entity.ass.AssAgencyConfig; |
|
|
|
import cn.com.taiji.core.entity.basic.QtkAgency; |
|
|
|
import cn.com.taiji.core.entity.basic.QtkCardInfo; |
|
|
|
import cn.com.taiji.core.entity.basic.QtkServiceHall; |
|
|
|
import cn.com.taiji.core.entity.dict.basic.CardType; |
|
|
|
import cn.com.taiji.core.entity.dict.basic.SourceType; |
|
|
@@ -17,7 +19,9 @@ import cn.com.taiji.core.entity.issue.*; |
|
|
|
import cn.com.taiji.core.entity.user.Staff; |
|
|
|
import cn.com.taiji.core.manager.tools.minio.MinioUtil; |
|
|
|
import cn.com.taiji.core.model.comm.protocol.ias.order.*; |
|
|
|
import cn.com.taiji.core.repo.jpa.ass.AssAgencyConfigRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.basic.QtkAgencyRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.basic.QtkCardInfoRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.basic.QtkServicehallRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.invw.InvwCardDetailsRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.invw.InvwObuDetailsRepo; |
|
|
@@ -39,6 +43,7 @@ import java.time.LocalDateTime; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Author:ChenChao |
|
|
@@ -78,6 +83,14 @@ public class IssueOrderQueryManageImpl extends AbstractManagewManager implements |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private MinioUtil minioUtil; |
|
|
|
@Autowired |
|
|
|
private IssueOrderPayRepo issueOrderPayRepo; |
|
|
|
@Autowired |
|
|
|
private IssueProductPayRepo issueProductPayRepo; |
|
|
|
@Autowired |
|
|
|
private AssAgencyConfigRepo assAgencyConfigRepo; |
|
|
|
@Autowired |
|
|
|
private QtkCardInfoRepo qtkCardInfoRepo; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Pagination page(OrderPageReqDTO reqDto) { |
|
|
@@ -144,10 +157,21 @@ public class IssueOrderQueryManageImpl extends AbstractManagewManager implements |
|
|
|
//协议列表 |
|
|
|
List<IssueAgreementAddress> agreementsList = setAgreementsList(orderinfoExt); |
|
|
|
resDTO.setAgreementsList(agreementsList); |
|
|
|
//付款信息 |
|
|
|
List<PayModel> payModelList = setPayModel(issueOrderinfo); |
|
|
|
resDTO.setPayInfo(payModelList); |
|
|
|
//签约信息 |
|
|
|
SignInfoModel signInfoModel = setSignModel(issueOrderinfo); |
|
|
|
resDTO.setSignInfo(signInfoModel); |
|
|
|
//激活信息 |
|
|
|
ActiveInfoModel activeInfoModel = setActiveModel(issueOrderinfo); |
|
|
|
resDTO.setActiveInfo(activeInfoModel); |
|
|
|
return resDTO; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//订单基础信息 |
|
|
|
private @NotNull OrderInfoModel setOrderModel(IssueOrderinfo issueOrderinfo) { |
|
|
|
OrderInfoModel infoModel = copyProperties(issueOrderinfo, new OrderInfoModel()); |
|
|
@@ -298,6 +322,64 @@ public class IssueOrderQueryManageImpl extends AbstractManagewManager implements |
|
|
|
return agreementsList; |
|
|
|
} |
|
|
|
|
|
|
|
//付款信息 |
|
|
|
private List<PayModel> setPayModel(IssueOrderinfo issueOrderinfo) { |
|
|
|
List<IssueOrderPay> orderPays = issueOrderPayRepo.findByOrderNo(issueOrderinfo.getOrderNo()); |
|
|
|
return orderPays.stream().map(pay -> { |
|
|
|
PayModel payModel = new PayModel(); |
|
|
|
payModel.setPayOrderNo(pay.getPayOrderNo()); |
|
|
|
payModel.setPayStatus(pay.getPayStatus()); |
|
|
|
payModel.setPayTime(pay.getPayTime()); |
|
|
|
payModel.setFee(pay.getFee()); |
|
|
|
payModel.setPayType(pay.getPayType()); |
|
|
|
payModel.setExternalOrderNo(pay.getExternalOrderNo()); |
|
|
|
payModel.setRefundOrderNo(pay.getRefundOrderNo()); |
|
|
|
payModel.setRefundAmount(pay.getRefundAmount()); |
|
|
|
payModel.setRefundTime(pay.getRefundTime()); |
|
|
|
return payModel; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//签约信息 |
|
|
|
private SignInfoModel setSignModel(IssueOrderinfo issueOrderinfo) { |
|
|
|
//没有签约时间表示未签约,不必往下走 |
|
|
|
if (issueOrderinfo.getAgreementEnableTime() == null) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
SignInfoModel signInfoModel = new SignInfoModel(); |
|
|
|
signInfoModel.setAgreementEnableTime(issueOrderinfo.getAgreementEnableTime()); |
|
|
|
AssAgencyConfig agencyConfig = assAgencyConfigRepo.findByAgencyId(issueOrderinfo.getAgencyId()); |
|
|
|
//渠道自己签约不可知其签约方式 |
|
|
|
if (agencyConfig.getQtSign()) { |
|
|
|
signInfoModel.setSignPerson("黔通"); |
|
|
|
List<IssueProductPay> issueProductPayList = issueProductPayRepo.findByFeeCategoryAndReleaseId(FeeCategory.PASS, issueOrderinfo.getProductId()); |
|
|
|
if (!isEmpty(issueProductPayList)) { |
|
|
|
IssueProductPay issueProductPay = issueProductPayList.get(0); |
|
|
|
signInfoModel.setSignWay(issueProductPay.getChargeMethod()); |
|
|
|
} |
|
|
|
}else { |
|
|
|
signInfoModel.setSignPerson("渠道"); |
|
|
|
} |
|
|
|
return signInfoModel; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//激活信息 |
|
|
|
private ActiveInfoModel setActiveModel(IssueOrderinfo issueOrderinfo) { |
|
|
|
//没有签约时间表示未激活,不必往下走 |
|
|
|
if (issueOrderinfo.getActivationTime() == null) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
ActiveInfoModel activeInfoModel = new ActiveInfoModel(); |
|
|
|
activeInfoModel.setActivationTime(issueOrderinfo.getActivationTime()); |
|
|
|
activeInfoModel.setCardId(issueOrderinfo.getCardId()); |
|
|
|
activeInfoModel.setObuId(issueOrderinfo.getObuId()); |
|
|
|
QtkCardInfo cardInfo = qtkCardInfoRepo.findByCardId(issueOrderinfo.getCardId()); |
|
|
|
activeInfoModel.setWarrantyDate(cardInfo.getWarrantyDate()); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void orderCancel(OrderCancelRequestDTO reqDto) throws ManagerException { |
|
|
|
IssueOrderinfo order = checkOrder(reqDto.getOrderNo()); |