ソースを参照

更新合同审核流程,增加开票状态更新任务

gmcs 2 ヶ月 前
コミット
9c4cf392a5

+ 2 - 0
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/RemoteBidTenderService.java

@@ -56,4 +56,6 @@ public interface RemoteBidTenderService {
     @PostMapping("/tender/refundStopBid")
     public int refundStopBid(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 
+    @PostMapping("/tender/changeInvoice")
+    public int changeInvoice(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 }

+ 5 - 0
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteBidTenderFallbackFactory.java

@@ -87,6 +87,11 @@ public class RemoteBidTenderFallbackFactory implements FallbackFactory<RemoteBid
             public int refundStopBid(String source) {
                 return 0;
             }
+
+            @Override
+            public int changeInvoice(String source) {
+                return 0;
+            }
         };
     }
 }

+ 5 - 1
ruoyi-modules/hh-bidding/src/main/java/com/hh/bidding/controller/BidContractController.java

@@ -114,7 +114,11 @@ public class BidContractController extends BaseController
 
             BidWinner bidWinner = new BidWinner();
             bidWinner.setWid(bidContract.getWid());
-            bidWinner.setStatus(3L);
+            BidWinner bidWinner0 = bidWinnerService.selectBidWinnerByWid(bidContract.getWid());
+            if(bidWinner0.getStatus() == 2){
+                bidWinner.setStatus(3L);
+            }
+            // TODO 加个定时,将合同审核通过的中标人信息,status 从2 改成 3
             int i = bidWinnerService.updateBidWinner(bidWinner);
             if(i == 0){
                 throw new Exception("修改失败");

+ 22 - 0
ruoyi-modules/hh-bidding/src/main/java/com/hh/bidding/controller/BidTenderController.java

@@ -100,6 +100,9 @@ public class BidTenderController extends BaseController {
     @Autowired
     private IBidWinningResultsService bidWinningResultsService;
 
+    @Autowired
+    private IBidContractService bidContractService;
+
     public String getOwnerdepts() {
         List<Long> ids = remoteUserService.getDeptIds(SecurityUtils.getLoginUser().getUserid(), 1, "CHILDREN_COMPANY", SecurityConstants.INNER);
         return StringUtils.join(ids,',');
@@ -1058,6 +1061,25 @@ public class BidTenderController extends BaseController {
         return i;
     }
 
+    // 合同通过后的开票信息更新
+    @InnerAuth
+    @Transactional
+    @PostMapping("/changeInvoice")
+    public int changeInvoice(){
+        BidContract bidContract = new BidContract();
+        bidContract.setExamine(4L);
+        List<BidContract> bidContracts = bidContractService.selectBidContractList(bidContract);
+        for(BidContract item : bidContracts){
+            Long wid = item.getWid();
+            BidWinner bidWinner = bidWinnerService.selectBidWinnerByWid(wid);
+            if(bidWinner.getStatus() == 2){
+                bidWinner.setStatus(3L);
+                int i = bidWinnerService.updateBidWinner(bidWinner);
+            }
+        }
+        return 0;
+    }
+
     // 查询可终止项目
     @GetMapping("/selectTenderByState")
     public TableDataInfo selectTenderByState(BidTender bidTender) {

+ 1 - 1
ruoyi-modules/hh-bidding/src/main/resources/mapper/BidContractMapper.xml

@@ -105,7 +105,7 @@
             <if test="sName != null"> and w.s_name LIKE CONCAT('%', #{sName}, '%')</if>
             <if test="examine != null"> and a.examine = #{examine}</if>
             <if test="examine == 4"> and w.status = 3</if>
-            <if test="examine != 4"> and w.status = 2</if>
+            <if test="examine != 4"> and(w.status = 2 or w.status = 1)</if>
             and r.gs_approve_state = 3
             and r.gs_state = 1
             and r.gs_res_date &lt;= now()

+ 1 - 2
ruoyi-modules/hh-mast/src/main/java/com/ruoyi/mast/bank/controller/BankTenderqueryController.java

@@ -179,8 +179,7 @@ public class BankTenderqueryController extends BaseController {
         bt.setRtnTdracctnovrfyflg(JsonUtils.findXML(rtnxml, "FOX/SECURITIES_MSGSRSV1/QUERYTENDERINFOTRNRS/RSBODY/TDRACCTNOVRFYFLG"));
         bt.setRtnAlwafddlntdrflg(JsonUtils.findXML(rtnxml, "FOX/SECURITIES_MSGSRSV1/QUERYTENDERINFOTRNRS/RSBODY/ALWAFDDLNTDRFLG"));
         bt.setRtnBnkrfndcfrmflg(JsonUtils.findXML(rtnxml, "FOX/SECURITIES_MSGSRSV1/QUERYTENDERINFOTRNRS/RSBODY/BNKRFNDCFRMFLG"));
-        bt.setRtnMrgnamt(BigDecimal.valueOf(Long.parseLong(JsonUtils.findXML(rtnxml, "FOX/SECURITIES_MSGSRSV1/QUERYTENDERINFOTRNRS/RSBODY/MRGNAMT"))));
-
+        bt.setRtnMrgnamt(JsonUtils.checkBigDecimal(JsonUtils.findXML(rtnxml, "FOX/SECURITIES_MSGSRSV1/QUERYTENDERINFOTRNRS/RSBODY/MRGNAMT")));
         bt.setRtnStrtsgtdt(JsonUtils.findXML(rtnxml, "FOX/SECURITIES_MSGSRSV1/QUERYTENDERINFOTRNRS/RSBODY/STRTSGTDT"));
         bt.setRtnMrgnduestopdt(JsonUtils.findXML(rtnxml, "FOX/SECURITIES_MSGSRSV1/QUERYTENDERINFOTRNRS/RSBODY/MRGNDUESTOPDT"));
         bt.setRtnMrgnduestoptm(JsonUtils.findXML(rtnxml, "FOX/SECURITIES_MSGSRSV1/QUERYTENDERINFOTRNRS/RSBODY/MRGNDUESTOPTM"));

+ 4 - 0
ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/task/RyTask.java

@@ -90,4 +90,8 @@ public class RyTask
     public void getRefundsAll(){
         remoteTenderpubService.getRefundsAll(SecurityConstants.INNER);
     }
+
+    public void changeInvoice(){
+        remoteBidTenderService.changeInvoice(SecurityConstants.INNER);
+    }
 }