|
|
@@ -64,13 +64,20 @@ public class InstallmentServiceImpl implements InstallmentService{
|
|
|
throw new IllegalOperatorException("此订单状态不为待付款,不可设置分期");
|
|
|
|
|
|
InstallmentStore installmentStore = installmentStoreDao.findByEnuuAndEnable(SystemSession.getUser().getEnterprise().getUu(), (short) 1);
|
|
|
-// if (installmentStore == null)
|
|
|
-// throw new IllegalOperatorException("当前企业没有设置分期功能权限,如有需要请联系客服");
|
|
|
+ if (installmentStore == null)
|
|
|
+ throw new IllegalOperatorException("当前企业没有设置分期功能权限,如有需要请联系客服");
|
|
|
|
|
|
List<BankInfo> bankInfos = bankInfoService.getEnterpriseBankInfoContainsStatus(Type.SUP.value(), Status.ALLOW.value());
|
|
|
if (CollectionUtils.isEmpty(bankInfos))
|
|
|
throw new IllegalOperatorException("当前企业没有设置收款账户,请在 结算中心--收款账户信息 管理您的收款账户信息");
|
|
|
|
|
|
+ // 如果之前具有分期信息,删除分期信息
|
|
|
+ if (purchase.getInstallmentId() != null) {
|
|
|
+ Installment oldInstallment = installmentDao.findOne(purchase.getInstallmentId());
|
|
|
+ if (oldInstallment != null)
|
|
|
+ installmentDao.delete(oldInstallment.getId());
|
|
|
+ }
|
|
|
+
|
|
|
List<InstallmentDetail> installmentDetails = installment.getInstallmentDetails();
|
|
|
if (CollectionUtils.isEmpty(installmentDetails))
|
|
|
throw new IllegalOperatorException("分期详情为空,请您设置分期详情");
|