|
|
@@ -151,21 +151,27 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
|
|
|
// }
|
|
|
Double spending = bankinformation.getBk_spending() == null ? new Double(0) : bankinformation.getBk_spending();
|
|
|
Double incomme = bankinformation.getBk_income() == null ? new Double(0) : bankinformation.getBk_income();
|
|
|
- bankinformation.setBk_thisamount(beginamount + incomme - spending - bk_amount);
|
|
|
- bankinformation.setBk_income(incomme);
|
|
|
- bankinformation.setBk_spending(spending + bk_amount);
|
|
|
+ Bankinformation newbankinformation = new Bankinformation();
|
|
|
+ newbankinformation.setBk_thisamount(beginamount + incomme - (spending + bk_amount));
|
|
|
+ newbankinformation.setBk_income(incomme);
|
|
|
+ newbankinformation.setBk_spending(spending + bk_amount);
|
|
|
+ newbankinformation.setId(bankinformation.getId());
|
|
|
+ newbankinformation.setCompanyId(BaseContextHolder.getCompanyId());
|
|
|
+ bankinformationMapper.updateByPrimaryKeySelective(newbankinformation);
|
|
|
|
|
|
//收款方
|
|
|
Bankinformation inbankinformation = bankinformationMapper.selectByPrimaryKey(bk_inid);
|
|
|
Double inbeginamount = inbankinformation.getBk_beginamount()== null ? new Double(0) : inbankinformation.getBk_beginamount();
|
|
|
Double inspending = inbankinformation.getBk_spending() == null ? new Double(0) : inbankinformation.getBk_spending();
|
|
|
Double inincomme = inbankinformation.getBk_income() == null ? new Double(0) : inbankinformation.getBk_income();
|
|
|
- inbankinformation.setBk_thisamount(inbeginamount + inincomme - inspending + bk_amount);
|
|
|
- inbankinformation.setBk_income(inincomme + bk_amount);
|
|
|
- inbankinformation.setBk_spending(inspending);
|
|
|
+ Bankinformation newinbankinformation = new Bankinformation();
|
|
|
+ newinbankinformation.setBk_thisamount(inbeginamount + (inincomme + bk_amount) - inspending );
|
|
|
+ newinbankinformation.setBk_income(inincomme + bk_amount);
|
|
|
+ newinbankinformation.setBk_spending(inspending);
|
|
|
+ newinbankinformation.setId(inbankinformation.getId());
|
|
|
+ newinbankinformation.setCompanyId(BaseContextHolder.getCompanyId());
|
|
|
+ bankinformationMapper.updateByPrimaryKeySelective(newinbankinformation);
|
|
|
|
|
|
- bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
|
|
|
- bankinformationMapper.updateByPrimaryKeySelective(inbankinformation);
|
|
|
}
|
|
|
DocBaseDTO baseDTO = getBaseDTOById(id);
|
|
|
//日志记录
|
|
|
@@ -187,7 +193,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
|
|
|
|
|
|
//资金
|
|
|
//取从表金额
|
|
|
- List<Fundtransferdetail> fundtransferdetailList = fundtransferdetailMapper.selectByPrimaryKey(id);
|
|
|
+ List<Fundtransferdetail> fundtransferdetailList = fundtransferdetailMapper.selectByPrimaryKey(id, Math.toIntExact(BaseContextHolder.getCompanyId()));
|
|
|
Iterator isList = fundtransferdetailList.iterator();
|
|
|
while (isList.hasNext()){
|
|
|
Fundtransferdetail fundtransferdetail = (Fundtransferdetail) isList.next();
|
|
|
@@ -208,21 +214,27 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
|
|
|
Double beginamount = bankinformation.getBk_beginamount()== null ? new Double(0) : bankinformation.getBk_beginamount();
|
|
|
Double spending = bankinformation.getBk_spending() == null ? new Double(0) : bankinformation.getBk_spending();
|
|
|
Double incomme = bankinformation.getBk_income() == null ? new Double(0) : bankinformation.getBk_income();
|
|
|
- bankinformation.setBk_thisamount(beginamount + incomme - spending + bk_amount);
|
|
|
- bankinformation.setBk_income(incomme);
|
|
|
- bankinformation.setBk_spending(spending - bk_amount);
|
|
|
+ Bankinformation newbankinformation = new Bankinformation();
|
|
|
+ newbankinformation.setBk_thisamount(beginamount + incomme - (spending - bk_amount));
|
|
|
+ newbankinformation.setBk_income(incomme);
|
|
|
+ newbankinformation.setBk_spending(spending - bk_amount);
|
|
|
+ newbankinformation.setId(Long.valueOf(bk_id));
|
|
|
+ newbankinformation.setCompanyId(BaseContextHolder.getCompanyId());
|
|
|
|
|
|
//收款方
|
|
|
Bankinformation inbankinformation = bankinformationMapper.selectByPrimaryKey(bk_inid);
|
|
|
Double inbeginamount = inbankinformation.getBk_beginamount()== null ? new Double(0) : inbankinformation.getBk_beginamount();
|
|
|
Double inspending = inbankinformation.getBk_spending() == null ? new Double(0) : inbankinformation.getBk_spending();
|
|
|
Double inincomme = inbankinformation.getBk_income() == null ? new Double(0) : inbankinformation.getBk_income();
|
|
|
- inbankinformation.setBk_thisamount(inbeginamount + inincomme - inspending - bk_amount);
|
|
|
- inbankinformation.setBk_income(inincomme - bk_amount);
|
|
|
- inbankinformation.setBk_spending(inspending);
|
|
|
-
|
|
|
- bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
|
|
|
- bankinformationMapper.updateByPrimaryKeySelective(inbankinformation);
|
|
|
+ Bankinformation newinbankinformation = new Bankinformation();
|
|
|
+ newinbankinformation.setBk_thisamount(inbeginamount + (inincomme-bk_amount) - inspending );
|
|
|
+ newinbankinformation.setBk_income(inincomme-bk_amount);
|
|
|
+ newinbankinformation.setBk_spending(inspending);
|
|
|
+ newinbankinformation.setId(Long.valueOf(bk_inid));
|
|
|
+ newinbankinformation.setCompanyId(BaseContextHolder.getCompanyId());
|
|
|
+
|
|
|
+ bankinformationMapper.updateByPrimaryKeySelective(newbankinformation);
|
|
|
+ bankinformationMapper.updateByPrimaryKeySelective(newinbankinformation);
|
|
|
}
|
|
|
|
|
|
DocBaseDTO baseDTO = getBaseDTOById(Long.valueOf(id));
|
|
|
@@ -286,7 +298,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
|
|
|
public Fundtran select(int id) {
|
|
|
Fundtran fundtran = new Fundtran();
|
|
|
fundtran.setMain(fundtransferMapper.selectByPrimaryKey(id));
|
|
|
- fundtran.setItems(fundtransferdetailMapper.selectByPrimaryKey(id));
|
|
|
+ fundtran.setItems(fundtransferdetailMapper.selectByPrimaryKey(id, Math.toIntExact(BaseContextHolder.getCompanyId())));
|
|
|
return fundtran;
|
|
|
}
|
|
|
|