|
@@ -42,6 +42,8 @@ import com.trade.service.enterprise.customer.service.EnterpriseBaseService;
|
|
|
import com.trade.service.enterprise.customer.service.EnterpriseChangeRecordBaseService;
|
|
|
import com.trade.service.enterprise.customer.service.EnterpriseRelatedPersonBaseService;
|
|
|
import com.trade.service.enterprise.customer.service.impl.EnterpriseDataConverter;
|
|
|
+import com.trade.service.message.EmailTemplate;
|
|
|
+import com.trade.service.serialNum.service.SerialNumberGenerator;
|
|
|
import com.trade.service.thirdparty.sop.dto.*;
|
|
|
import com.trade.service.thirdparty.sop.service.SOPService;
|
|
|
import com.trade.service.thirdparty.xiaotu.configuration.XiaotuConfiguration;
|
|
@@ -57,7 +59,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.math.BigDecimal;
|
|
|
import java.time.LocalDate;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -78,6 +79,10 @@ public class EnterpriseServiceImpl implements EnterpriseService {
|
|
|
private BigDecimal taxRebateServiceFeeAmount;
|
|
|
@Value("${taxRebate.serviceFee.payeeName:上海银颗科技服务有限公司}")
|
|
|
private String taxRebateServiceFeePayeeName;
|
|
|
+ @Value("${taxRebate.serviceFee.payeeName:635973777}")
|
|
|
+ private String taxRebateServiceFeePayeeAccountNo;
|
|
|
+ @Value("${taxRebate.serviceFee.payeeName:中国民生银行股份有限公司上海曹杨支行}")
|
|
|
+ private String taxRebateServiceFeePayeeBankName;
|
|
|
@Resource
|
|
|
private CustomerMessageService customerMessageService;
|
|
|
@Resource
|
|
@@ -106,6 +111,10 @@ public class EnterpriseServiceImpl implements EnterpriseService {
|
|
|
private PayableAccountsService payableAccountsService;
|
|
|
@Resource
|
|
|
private SOPService sopService;
|
|
|
+ @Resource
|
|
|
+ private SerialNumberGenerator serialNumberGenerator;
|
|
|
+ @Resource
|
|
|
+ private EmailTemplate emailTemplate;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -414,10 +423,13 @@ public class EnterpriseServiceImpl implements EnterpriseService {
|
|
|
contractFile.setSignFlowId(contractSignOutput.getFlowId());
|
|
|
contractFileService.save(contractFile);
|
|
|
// 更新退税服务协议签署状态:签署中
|
|
|
+ String taxRebateAgreementNo = serialNumberGenerator.generateTaxRebateAgreementNo(enterprise.getName());
|
|
|
enterpriseBaseService.lambdaUpdate().eq(Enterprise::getId, enterprise.getId())
|
|
|
+ .set(Enterprise::getTaxRebateAgreementNo, taxRebateAgreementNo)
|
|
|
.set(Enterprise::getTaxRebateAgreementSignStatus, DictConstants.CONTRACT_STATUS_SIGNING).update();
|
|
|
enterpriseChangeRecordBaseService.lambdaUpdate()
|
|
|
.eq(EnterpriseChangeRecord::getId, enterprise.getChangeRecordId())
|
|
|
+ .set(EnterpriseChangeRecord::getTaxRebateAgreementNo, taxRebateAgreementNo)
|
|
|
.set(EnterpriseChangeRecord::getTaxRebateAgreementSignStatus, DictConstants.CONTRACT_STATUS_SIGNING)
|
|
|
.update();
|
|
|
}
|
|
@@ -501,6 +513,8 @@ public class EnterpriseServiceImpl implements EnterpriseService {
|
|
|
contractFile.setSignedFileStorageId(signedFile2Biz.getFileId());
|
|
|
contractFileService.updateById(contractFile);
|
|
|
businessRelateFileBaseService.addBusinessRelateFiles(Collections.singletonList(businessRelateFile));
|
|
|
+ // 发送退税服务费支付通知邮件
|
|
|
+ sendTaxRebateServiceFeePayNotifyEmail(enterprise);
|
|
|
// 生成“待支付退税服务费”记录
|
|
|
ServiceFeeDto serviceFeeDto = new ServiceFeeDto();
|
|
|
serviceFeeDto.setCustomerUserId(customerUser.getId());
|
|
@@ -508,6 +522,7 @@ public class EnterpriseServiceImpl implements EnterpriseService {
|
|
|
serviceFeeDto.setPaymentCurrency("CNY");
|
|
|
serviceFeeDto.setPaymentDeadline(bizData.getSignTime().plusHours(72));
|
|
|
serviceFeeDto.setPayeeName(taxRebateServiceFeePayeeName);
|
|
|
+ serviceFeeDto.setContactFileId(signedFile2Biz.getFileId());
|
|
|
payableAccountsService.saveTaxRefundServiceFee(serviceFeeDto);
|
|
|
}
|
|
|
// 更新授权书签署状态:status
|
|
@@ -524,6 +539,23 @@ public class EnterpriseServiceImpl implements EnterpriseService {
|
|
|
.update();
|
|
|
}
|
|
|
|
|
|
+ void sendTaxRebateServiceFeePayNotifyEmail(Enterprise enterprise) {
|
|
|
+ Map<String, Object> variables = new HashMap<>();
|
|
|
+ variables.put("enterpriseName", enterprise.getName());
|
|
|
+ variables.put("payeeName", taxRebateServiceFeePayeeName);
|
|
|
+ variables.put("payeeAccountNo", taxRebateServiceFeePayeeAccountNo);
|
|
|
+ variables.put("payeeBankName", taxRebateServiceFeePayeeBankName);
|
|
|
+ variables.put("taxRebateAgreementNo", enterprise.getTaxRebateAgreementNo());
|
|
|
+ // 发送邮件
|
|
|
+ EnterpriseRelatedPerson contactPerson = enterpriseRelatedPersonBaseService
|
|
|
+ .getContactByChangeRecordId(enterprise.getChangeRecordId());
|
|
|
+ emailTemplate.sendMailTemplate(CustConstant.TAX_REBATE_SERVICE_FEE_PAY_NOTIFY_SUBJECT,
|
|
|
+ CustConstant.TAX_REBATE_SERVICE_FEE_PAY_NOTIFY_TEMPLATE, null, null, variables, null, null,
|
|
|
+ new String[] {
|
|
|
+ contactPerson.getEmail()
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 当前认证中&&暂存 或者 当前已认证&&提交,不插入变更记录、直接更新上次记录 (减少变更表记录)
|
|
|
*
|