Browse Source

1.资金模块直接审核报错问题

heqinwei 7 years ago
parent
commit
ff00037b48
15 changed files with 51 additions and 84 deletions
  1. 2 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/FundtransferController.java
  2. 2 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/OthreceiptsController.java
  3. 2 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/OthspengdingsController.java
  4. 2 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/PaybalanceController.java
  5. 2 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/RecbalanceContorller.java
  6. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/FundtransferService.java
  7. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/OthreceiptsService.java
  8. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/OthspendingsService.java
  9. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/PaybalanceService.java
  10. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/RecbalanceService.java
  11. 6 15
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  12. 9 19
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  13. 7 16
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  14. 7 10
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  15. 7 9
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java

+ 2 - 2
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/FundtransferController.java

@@ -80,8 +80,8 @@ public class FundtransferController {
     @Transactional
     @RequestMapping("/audit")
     public Result audit(@RequestBody Fundtran body){
-        fundtransferService.audit(body);
-        return Result.success();
+        DocBaseDTO docBaseDTO = fundtransferService.audit(body);
+        return Result.success(docBaseDTO);
     }
 
     @Transactional

+ 2 - 2
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/OthreceiptsController.java

@@ -59,8 +59,8 @@ public class OthreceiptsController {
     @Transactional
     @RequestMapping("/audit")
     public Result audit(@RequestBody Othte body){
-        othreceiptsService.audit(body);
-        return Result.success();
+        DocBaseDTO docBaseDTO = othreceiptsService.audit(body);
+        return Result.success(docBaseDTO);
     }
 
     @Transactional

+ 2 - 2
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/OthspengdingsController.java

@@ -62,8 +62,8 @@ public class OthspengdingsController {
     @Transactional
     @RequestMapping("/audit")
     public Result audit(@RequestBody Othsp body){
-        othspendingsService.audit(body);
-        return Result.success();
+        DocBaseDTO docBaseDTO = othspendingsService.audit(body);
+        return Result.success(docBaseDTO);
     }
 
     @Transactional

+ 2 - 2
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/PaybalanceController.java

@@ -65,8 +65,8 @@ public class PaybalanceController {
     @Transactional
     @RequestMapping("/audit")
     public Result audit(@RequestBody Pay body){
-        paybalanceService.audit(body);
-        return Result.success();
+        DocBaseDTO docBaseDTO = paybalanceService.audit(body);
+        return Result.success(docBaseDTO);
     }
 
     @Transactional

+ 2 - 2
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/RecbalanceContorller.java

@@ -66,8 +66,8 @@ public class RecbalanceContorller {
     @Transactional
     @RequestMapping("/audit")
     public Result audit(@RequestBody Rec body){
-        recbalanceService.audit(body);
-        return Result.success();
+        DocBaseDTO docBaseDTO = recbalanceService.audit(body);
+        return Result.success(docBaseDTO);
     }
 
     @Transactional

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/FundtransferService.java

@@ -15,7 +15,7 @@ import com.usoftchina.saas.page.PageRequest;
 public interface FundtransferService {
     DocBaseDTO insert(Fundtran fundtran);
 
-    void audit(Fundtran fundtran);
+    DocBaseDTO audit(Fundtran fundtran);
 
     void unAudit(int id);
 

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/OthreceiptsService.java

@@ -17,7 +17,7 @@ import com.usoftchina.saas.page.PageRequest;
 public interface OthreceiptsService {
     DocBaseDTO insert(Othte othte);
 
-    void audit(Othte othte);
+    DocBaseDTO audit(Othte othte);
 
     void unAudit(int id);
 

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/OthspendingsService.java

@@ -26,7 +26,7 @@ public interface OthspendingsService {
 
     PageInfo<Othspendings> selectList(PageRequest page, ListReqDTO reqDTO);
 
-    void audit(Othsp othsp);
+    DocBaseDTO audit(Othsp othsp);
 
     void unAudit(int id);
 

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/PaybalanceService.java

@@ -16,7 +16,7 @@ import com.usoftchina.saas.page.PageRequest;
 public interface PaybalanceService {
     DocBaseDTO insert(Pay pay);
 
-    void audit(Pay pay);
+    DocBaseDTO audit(Pay pay);
 
     void unAudit(int id);
 

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/RecbalanceService.java

@@ -24,7 +24,7 @@ public interface RecbalanceService {
 
     void deleteItems(int id);
 
-    void audit(Rec rec);
+    DocBaseDTO audit(Rec rec);
 
 
     void unAudit(Long id);

+ 6 - 15
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java

@@ -80,26 +80,16 @@ public class FundtransferServiceImpl implements FundtransferService {
     }
 
     @Override
-    public void audit(Fundtran fundtran) {
+    public DocBaseDTO audit(Fundtran fundtran) {
         Long companyId = BaseContextHolder.getCompanyId();
-        int id = Math.toIntExact(fundtran.getMain().getId());
-        Fundtransfer fundtransfer = fundtransferMapper.selectByPrimaryKey(id);
+        Fundtransfer fundtransfer = fundtran.getMain();
         fundtransfer.setFt_status(Status.AUDITED.getDisplay());
         fundtransfer.setFt_statuscode(Status.AUDITED.name());
         fundtransfer.setCompanyId(companyId);
         this.changBankUntil(fundtran);
-        if ( fundtransfer == null || "".equals(fundtransfer)){
-            this.insert(fundtran);
-        }else {
-            fundtransferMapper.updateByPrimaryKeySelective(fundtransfer);
-            List<Fundtransferdetail> fundtransferdetailList = fundtran.getItems();
-            Iterator isList = fundtransferdetailList.iterator();
-            while (isList.hasNext()){
-                Fundtransferdetail fundtransferdetail = (Fundtransferdetail) isList.next();
-                fundtransferdetail.setFt_date(fundtransfer.getFt_date());
-                fundtransferdetailMapper.updateByPrimaryKeySelective(fundtransferdetail);
-            }
-        }
+        DocBaseDTO docBaseDTO = this.insert(fundtran);
+        Long id = docBaseDTO.getId();
+        String ft_code = docBaseDTO.getCode();
 
         //取从表金额更新中间表、资金账号表
         List<Fundtransferdetail> fundtransferdetailList = fundtran.getItems();
@@ -128,6 +118,7 @@ public class FundtransferServiceImpl implements FundtransferService {
             paybalanceMapper.updateBankAmount(thisamount, bk_id);
             paybalanceMapper.updateBankAmount(bk_inamount + fundtransferdetail.getFtd_nowbalance(), bk_inid);
         }
+        return new DocBaseDTO(id, ft_code, BillCodeSeq.FUNDTRANSFER.getCaller());
     }
 
     @Override

+ 9 - 19
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java

@@ -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

+ 7 - 16
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java

@@ -116,26 +116,16 @@ public class OthspendingsServiceImpl implements OthspendingsService {
     }
 
     @Override
-    public void audit(Othsp othsp) {
+    public DocBaseDTO audit(Othsp othsp) {
         Long companyId = BaseContextHolder.getCompanyId();
-        int id = Math.toIntExact(othsp.getMain().getId());
-        Othspendings othspendings = othspendingsMapper.selectByPrimaryKey(id);
+        Othspendings othspendings = othsp.getMain();
         othspendings.setOs_status(Status.AUDITED.getDisplay());
         othspendings.setOs_statuscode(Status.AUDITED.name());
         othspendings.setCompanyId(companyId);
         this.changBankUntil(othsp);
-        if ( othspendings == null || "".equals(othspendings)){
-            this.insert(othsp);
-        }else {
-            othspendingsMapper.updateByPrimaryKeySelective(othspendings);
-            List<Othspendingsdetail> othspendingsdetailList = othsp.getItems();
-            Iterator isList = othspendingsdetailList.iterator();
-            while (isList.hasNext()){
-                Othspendingsdetail othspendingsdetail = (Othspendingsdetail) isList.next();
-                othspendingsdetail.setOs_date(othspendings.getOs_date());
-                othspendingsdetailMapper.updateByPrimaryKeySelective(othspendingsdetail);
-            }
-        }
+        DocBaseDTO docBaseDTO = this.insert(othsp);
+        Long id = docBaseDTO.getId();
+        String os_code = docBaseDTO.getCode();
 
         Double amount = banksubledgerMapper.selectThisamount(othspendings.getOs_bankcode());
         //取从表金额
@@ -149,7 +139,7 @@ public class OthspendingsServiceImpl implements OthspendingsService {
 
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
-        List<Integer> ymList = othspendingsdetailMapper.selectYm(id);
+        List<Integer> ymList = othspendingsdetailMapper.selectYm(Math.toIntExact(id));
         Integer ym = ymList.indexOf(0);
         System.out.println("ym:"+ym);
         statsinfo.setCompanyid(BaseContextHolder.getCompanyId());
@@ -161,6 +151,7 @@ public class OthspendingsServiceImpl implements OthspendingsService {
         }else {
             statsinfoMapper.update(statsinfo);
         }
+        return new DocBaseDTO(id, os_code, BillCodeSeq.OTHSPENDINGS.getCaller());
     }
 
     @Override

+ 7 - 10
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java

@@ -163,10 +163,9 @@ public class PaybalanceServiceImpl implements PaybalanceService {
     }
 
     @Override
-    public void audit(Pay pay) {
+    public DocBaseDTO audit(Pay pay) {
         Long companyId = BaseContextHolder.getCompanyId();
-        int id = Math.toIntExact(pay.getMain().getId());
-        Paybalance paybalance = paybalanceMapper.selectByPrimaryKey(Long.valueOf(id));
+        Paybalance paybalance = pay.getMain();
         paybalance.setPb_status(Status.AUDITED.getDisplay());
         paybalance.setPb_statuscode(Status.AUDITED.name());
         paybalance.setCompanyId(companyId);
@@ -177,12 +176,9 @@ public class PaybalanceServiceImpl implements PaybalanceService {
             subledgerMapper.updateByPrimaryKeySelective(subledger);
         }
         this.changBankUntil(pay);
-        System.out.println("新增");
-        if ( paybalance == null || "".equals(paybalance)){
-            this.insert(pay);
-        }else {
-            paybalanceMapper.updateByPrimaryKeySelective(paybalance);
-        }
+        DocBaseDTO docBaseDTO = this.insert(pay);
+        Long id = docBaseDTO.getId();
+        String pb_code = docBaseDTO.getCode();
 
         Paybalance updatePay = new Paybalance();
         List<Paybalancedet> paybalancedet = pay.getItems1();
@@ -247,7 +243,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
 
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
-        List<Integer> ymList = paybalancedetMapper.selectYm(id);
+        List<Integer> ymList = paybalancedetMapper.selectYm(Math.toIntExact(id));
         Integer ym = ymList.indexOf(0);
         System.out.println("ym:"+ym);
         statsinfo.setCompanyid(BaseContextHolder.getCompanyId());
@@ -259,6 +255,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         }else {
             statsinfoMapper.update(statsinfo);
         }
+        return new DocBaseDTO(id, pb_code, BillCodeSeq.PAYBALANCE.getCaller());
     }
 
     @Override

+ 7 - 9
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java

@@ -190,10 +190,9 @@ public class RecbalanceServiceImpl implements RecbalanceService {
     }
 
     @Override
-    public void audit(Rec rec) {
+    public DocBaseDTO audit(Rec rec) {
         Long companyId = BaseContextHolder.getCompanyId();
-        Integer id = Math.toIntExact(rec.getMain().getId());
-        Recbalance recbalance = recbalanceMapper.selectByPrimaryKey(id);
+        Recbalance recbalance = rec.getMain();
         recbalance.setRb_status(Status.AUDITED.getDisplay());
         recbalance.setRb_statuscode(Status.AUDITED.name());
         recbalance.setCompanyId(companyId);
@@ -204,11 +203,9 @@ public class RecbalanceServiceImpl implements RecbalanceService {
             subledgerMapper.updateByPrimaryKeySelective(subledger);
         }
         this.changBankUntil(rec);
-        if ( recbalance == null || "".equals(recbalance)){
-            this.insert(rec);
-        }else {
-            recbalanceMapper.updateByPrimaryKeySelective(recbalance);
-        }
+        DocBaseDTO docBaseDTO = this.insert(rec);
+        Long id = docBaseDTO.getId();
+        String pu_code = docBaseDTO.getCode();
 
         Recbalance updateRay = new Recbalance();
         List<Recbalancedet> recbalancedet = rec.getItems1();
@@ -274,7 +271,7 @@ public class RecbalanceServiceImpl implements RecbalanceService {
 
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
-        List<Integer> ymList = recbalancedetMapper.selectYm(id);
+        List<Integer> ymList = recbalancedetMapper.selectYm(Math.toIntExact(id));
         Integer ym = ymList.indexOf(0);
         System.out.println("ym:"+ym);
         statsinfo.setCompanyid(BaseContextHolder.getCompanyId());
@@ -286,6 +283,7 @@ public class RecbalanceServiceImpl implements RecbalanceService {
         }else {
             statsinfoMapper.update(statsinfo);
         }
+        return new DocBaseDTO(id, pu_code, BillCodeSeq.RECBALANCE.getCaller());
     }
 
     @Override