|
|
@@ -10,6 +10,7 @@ import com.usoftchina.saas.commons.exception.BizExceptionCode;
|
|
|
import com.usoftchina.saas.commons.po.BillCodeSeq;
|
|
|
import com.usoftchina.saas.commons.po.Status;
|
|
|
import com.usoftchina.saas.context.BaseContextHolder;
|
|
|
+import com.usoftchina.saas.document.mapper.BankinformationMapper;
|
|
|
import com.usoftchina.saas.exception.BizException;
|
|
|
import com.usoftchina.saas.money.mapper.BanksubledgerMapper;
|
|
|
import com.usoftchina.saas.money.mapper.OthreceiptsMapper;
|
|
|
@@ -39,6 +40,8 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
|
|
|
private MaxnumberService maxnumberService;
|
|
|
@Autowired
|
|
|
private BanksubledgerMapper banksubledgerMapper;
|
|
|
+ @Autowired
|
|
|
+ private BankinformationMapper bankinformationMapper;
|
|
|
|
|
|
@Override
|
|
|
public DocBaseDTO insert(Othte othte) {
|
|
|
@@ -72,7 +75,7 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
|
|
|
othreceiptsdetail1.setOrd_orid(Math.toIntExact(id));
|
|
|
othreceiptsdetail1.setCompanyId(BaseContextHolder.getCompanyId());
|
|
|
if (othreceiptsdetail1.getId() > 0 ){
|
|
|
- othreceiptsdetailMapper.updateByPrimaryKey(othreceiptsdetail1);
|
|
|
+ othreceiptsdetailMapper.updateByPrimaryKeySelective(othreceiptsdetail1);
|
|
|
}else {
|
|
|
othreceiptsdetailMapper.insertSelective(othreceiptsdetail1);
|
|
|
}
|
|
|
@@ -94,6 +97,16 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
|
|
|
}else {
|
|
|
othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
|
|
|
}
|
|
|
+
|
|
|
+ Double amount = bankinformationMapper.selectThisamount(othreceipts.getOr_bankcode());
|
|
|
+ //取从表金额
|
|
|
+ List<Othreceiptsdetail> othreceiptsdetailList = othte.getItems();
|
|
|
+ Iterator isList = othreceiptsdetailList.iterator();
|
|
|
+ while (isList.hasNext()){
|
|
|
+ Othreceiptsdetail othreceiptsdetail = (Othreceiptsdetail) isList.next();
|
|
|
+ bankinformationMapper.updateBankcode(amount, othreceiptsdetail.getOrd_nowbalance(),
|
|
|
+ othreceipts.getOr_bankcode(), "+");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -107,6 +120,17 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
|
|
|
//删除中间表
|
|
|
othreceipts = othreceiptsMapper.selectByPrimaryKey(id);
|
|
|
banksubledgerMapper.deleteByPrimaryKey(othreceipts.getOr_code(), "其他收入单");
|
|
|
+
|
|
|
+ //更新资金
|
|
|
+ Double amount = bankinformationMapper.selectThisamount(othreceipts.getOr_bankcode());
|
|
|
+ List<Othreceiptsdetail> othreceiptsdetailList = othreceiptsdetailMapper.selectByPrimaryKey(id);
|
|
|
+ Iterator isList = othreceiptsdetailList.iterator();
|
|
|
+ while (isList.hasNext()){
|
|
|
+ Othreceiptsdetail othreceiptsdetail = (Othreceiptsdetail) isList.next();
|
|
|
+ bankinformationMapper.updateBankcode(amount, othreceiptsdetail.getOrd_nowbalance(),
|
|
|
+ othreceipts.getOr_bankcode(), "-");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -163,7 +187,8 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
|
|
|
othreceipts.setOr_statuscode(Status.AUDITED.name());
|
|
|
Othte othte = this.select(Math.toIntExact(othreceipts.getId()));
|
|
|
this.changBankUntil(othte);
|
|
|
- othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
|
|
|
+ this.insert(othte);
|
|
|
+// othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
|
|
|
}
|
|
|
}
|
|
|
|