|
|
@@ -84,26 +84,15 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void audit(Othte othte) {
|
|
|
+ public DocBaseDTO audit(Othte othte) {
|
|
|
Long companyId = BaseContextHolder.getCompanyId();
|
|
|
- int id = Math.toIntExact(othte.getMain().getId());
|
|
|
- Othreceipts othreceipts = othreceiptsMapper.selectByPrimaryKey(id);
|
|
|
+ Othreceipts othreceipts = othte.getMain();
|
|
|
othreceipts.setOr_status(Status.AUDITED.getDisplay());
|
|
|
othreceipts.setOr_statuscode(Status.AUDITED.name());
|
|
|
- othreceipts.setCompanyId(companyId);
|
|
|
this.changBankUntil(othte);
|
|
|
- if ( othreceipts == null || "".equals(othreceipts)){
|
|
|
- this.insert(othte);
|
|
|
- }else {
|
|
|
- othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
|
|
|
- List<Othreceiptsdetail> othreceiptsdetailList = othte.getItems();
|
|
|
- Iterator isList = othreceiptsdetailList.iterator();
|
|
|
- while (isList.hasNext()){
|
|
|
- Othreceiptsdetail fundtransferdetail = (Othreceiptsdetail) isList.next();
|
|
|
- fundtransferdetail.setOr_date(othreceipts.getOr_date());
|
|
|
- othreceiptsdetailMapper.updateByPrimaryKeySelective(fundtransferdetail);
|
|
|
- }
|
|
|
- }
|
|
|
+ DocBaseDTO docBaseDTO = this.insert(othte);
|
|
|
+ Long id = docBaseDTO.getId();
|
|
|
+ String or_code = docBaseDTO.getCode();
|
|
|
|
|
|
Double amount = banksubledgerMapper.selectThisamount(othreceipts.getOr_bankcode());
|
|
|
//取从表金额
|
|
|
@@ -117,11 +106,11 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
|
|
|
|
|
|
//计算期间金额
|
|
|
Statsinfo statsinfo = new Statsinfo();
|
|
|
- List<Integer> ymList = othreceiptsdetailMapper.selectYm(id);
|
|
|
+ List<Integer> ymList = othreceiptsdetailMapper.selectYm(Math.toIntExact(id));
|
|
|
Integer ym = ymList.indexOf(0);
|
|
|
System.out.println("ym:"+ym);
|
|
|
- statsinfo.setCompanyid(BaseContextHolder.getCompanyId());
|
|
|
- Integer yms = statsinfoMapper.select(ym, BaseContextHolder.getCompanyId());
|
|
|
+ statsinfo.setCompanyid(companyId);
|
|
|
+ Integer yms = statsinfoMapper.select(ym, companyId);
|
|
|
statsinfo.setSi_yearmonth(Double.valueOf(ym));
|
|
|
statsinfo.setSi_amount_otherrec(othreceipts.getOr_amount());
|
|
|
if (yms == null){
|
|
|
@@ -129,6 +118,7 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
|
|
|
}else {
|
|
|
statsinfoMapper.update(statsinfo);
|
|
|
}
|
|
|
+ return new DocBaseDTO(id, or_code, BillCodeSeq.OTHRECEIPTS.getCaller());
|
|
|
}
|
|
|
|
|
|
@Override
|