|
|
@@ -29,6 +29,7 @@ import cn.com.taiji.iaw.dto.issue.order.*; |
|
|
|
import cn.com.taiji.iaw.manager.AbstractIawManager; |
|
|
|
import cn.com.taiji.iaw.repo.jpa.request.issue.IssueOrderaPageRequest; |
|
|
|
import cn.com.taiji.iaw.repo.jpa.request.issue.IssueOrdermPageRequest; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@@ -225,6 +226,7 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd |
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public void agreeProtocol(AgreeProtocolReqDTO reqDto) throws ManagerException { |
|
|
|
IssueOrderinfo order = checkOrder(reqDto.getOrderNo()); |
|
|
@@ -232,6 +234,15 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd |
|
|
|
order.setProtocol(reqDto.getProtocol().toString()); |
|
|
|
order.setUpdateTime(LocalDateTime.now()); |
|
|
|
issueOrderinfoRepo.merge(order); |
|
|
|
|
|
|
|
//存储协议编号 |
|
|
|
IssueOrderinfoExt ext = issueOrderinfoExtRepo.findByOrderNo(order.getOrderNo()); |
|
|
|
List<IssueAgreement> agreements = issueAgreementRepo.findByReleaseId(order.getProductId()); |
|
|
|
List<String> ids = agreements.stream().map(IssueAgreement::getId).collect(Collectors.toList()); |
|
|
|
List<IssueAgreementAddress> agreementAddresses = issueAgreementAddressRepo.findByRefIdAndStatusList(ids, EnableStatus.ENABLE); |
|
|
|
List<String> agreementAddressesIds = agreementAddresses.stream().map(IssueAgreementAddress::getId).collect(Collectors.toList()); |
|
|
|
ext.setAgreements(String.join(StrUtil.COMMA, agreementAddressesIds)); |
|
|
|
issueOrderinfoExtRepo.merge(ext); |
|
|
|
sysPersistOperateLog(OperateType.ORDER_AGREEPROTOCOL, order.getId(), reqDto.getOrderSource(), findOpenIdByToken(reqDto.getAccessToken()), "同意协议"); |
|
|
|
} |
|
|
|
|