|
|
@@ -19,6 +19,7 @@ import com.usoftchina.saas.money.service.FundtransferService;
|
|
|
import com.usoftchina.saas.page.PageRequest;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.util.Date;
|
|
|
@@ -47,11 +48,11 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
|
|
|
private BankinformationMapper bankinformationMapper;
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public DocBaseDTO insert(Fundtran fundtran) {
|
|
|
Fundtransfer fundtransfer = fundtran.getMain();
|
|
|
List<Fundtransferdetail> fundtransferdetails = fundtran.getItems();
|
|
|
|
|
|
-
|
|
|
String ft_code = fundtransfer.getFt_code();
|
|
|
|
|
|
//编号校验
|
|
|
@@ -111,6 +112,13 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
|
|
|
DocBaseDTO docBaseDTO = this.insert(fundtran);
|
|
|
Long id = docBaseDTO.getId();
|
|
|
|
|
|
+ List<String> bankName = fundtransferMapper.checkAmount(BaseContextHolder.getCompanyId(), id);
|
|
|
+ if (bankName.size() > 0){
|
|
|
+ String name = org.apache.commons.lang3.StringUtils.join(bankName, ",");
|
|
|
+ String message = BizExceptionCode.BANK_AMOUNT_NOTENOUGHS.getMessage();
|
|
|
+ throw new BizException(500, String.format(message, name));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//取从表金额更新中间表、资金账号表
|
|
|
List<Fundtransferdetail> fundtransferdetailList = fundtran.getItems();
|