Browse Source

银行接口调整,看不到保证金

dzxiii 3 months ago
parent
commit
a9ed3ba3b8

+ 48 - 36
ruoyi-modules/hh-mast/src/main/java/com/ruoyi/mast/bank/controller/BankDepositController.java

@@ -79,7 +79,7 @@ public class BankDepositController extends BaseController {
 
         Long[] uids = list.stream().map(BankDeposit::getPpid).toArray(Long[]::new);
 
-        if(uids.length>0){
+        if (uids.length > 0) {
             List<BidNotice> blist = remoteBidNoticeService.selectBidNoticeByUids(uids, SecurityConstants.INNER);
 
             for (int i = 0; i < list.size(); i++) {
@@ -137,30 +137,40 @@ public class BankDepositController extends BaseController {
 
     private String postBank(BankDeposit bankDeposit) {
         String host = env.getProperty("BANK.HOST") + ":" + env.getProperty("BANK.PORT");
-        HttpResponse rep = Unirest.post(host).body("<FOX>\n" +
-                "    <SIGNONMSGSRQV1>\n" +
-                "        <SONRQ>\n" +
-                "            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n" +
-                "            <CID>" + env.getProperty("BANK.CID") + "</CID>\n" +
-                "            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n" +
-                "            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n" +
-                "            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n" +
-                "            <APPID>BZJN</APPID>\n" +
-                "            <APPVER>1</APPVER>\n" +
-                "        </SONRQ>\n" +
-                "    </SIGNONMSGSRQV1>\n" +
-                "    <SECURITIES_MSGSRQV1>\n" +
-                "        <QUERYDEPOSITINNUMTRNRQ>\n" +
-                "            <TRNUID>" + bankDeposit.getTrnuid() + "</TRNUID>\n" +
-                "            <RQBODY>\n" +
-                "                <SGTID>" + bankDeposit.getSgtid() + "</SGTID>\n" +
-                "                <SGTNO>" + bankDeposit.getSgtno() + "</SGTNO>\n" +
-                "                <PRJNO>" + bankDeposit.getPrjno() + "</PRJNO>\n" +
-                "                <PLTFMCSTNO>" + bankDeposit.getPltfmcstno() + "</PLTFMCSTNO>\n" +
-                "            </RQBODY>\n" +
-                "        </QUERYDEPOSITINNUMTRNRQ>\n" +
-                "    </SECURITIES_MSGSRQV1>\n" +
-                "</FOX>").asString();
+
+        StringBuffer sb = new StringBuffer();
+        sb.append("<FOX>\n");
+        sb.append("    <SIGNONMSGSRQV1>\n");
+        sb.append("        <SONRQ>\n");
+        sb.append("            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n");
+        sb.append("            <CID>" + env.getProperty("BANK.CID") + "</CID>\n");
+        sb.append("            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n");
+        sb.append("            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n");
+        sb.append("            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n");
+        sb.append("            <APPID>BZJN</APPID>\n");
+        sb.append("            <APPVER>1</APPVER>\n");
+        sb.append("        </SONRQ>\n");
+        sb.append("    </SIGNONMSGSRQV1>\n");
+        sb.append("    <SECURITIES_MSGSRQV1>\n");
+        sb.append("        <QUERYDEPOSITINNUMTRNRQ>\n");
+        sb.append("            <TRNUID>" + bankDeposit.getTrnuid() + "</TRNUID>\n");
+        sb.append("            <RQBODY>\n");
+        sb.append("                <SGTID>" + bankDeposit.getSgtid() + "</SGTID>\n");
+        sb.append("                <SGTNO>" + bankDeposit.getSgtno() + "</SGTNO>\n");
+        sb.append("                <PRJNO>" + bankDeposit.getPrjno() + "</PRJNO>\n");
+        sb.append("                <PLTFMCSTNO>" + bankDeposit.getPltfmcstno() + "</PLTFMCSTNO>\n");
+        sb.append("            </RQBODY>\n");
+        sb.append("        </QUERYDEPOSITINNUMTRNRQ>\n");
+        sb.append("    </SECURITIES_MSGSRQV1>\n");
+        sb.append("</FOX>");
+
+        logger.info("目标主机:'{}', 查询保证金入账数量请求信息:'{}'", host, sb.toString());
+
+        HttpResponse rep = Unirest.post(host).body(sb.toString()).asString().ifSuccess(response -> {
+            logger.info("查询保证金入账数量请求成功信息:'{}'", response.getBody().toString());
+        }).ifFailure(response -> {
+            logger.info("查询保证金入账数量请求失败信息:'{}', statusCode:'{}'", response.getBody().toString(), response.getStatus());
+        });
 
         return rep.getBody().toString();
     }
@@ -178,7 +188,7 @@ public class BankDepositController extends BaseController {
 
     @InnerAuth
     @GetMapping("/getDepositByNoticeId")
-    public String getDepositByNoticeId(@RequestParam("noticeId") Long noticeId){
+    public String getDepositByNoticeId(@RequestParam("noticeId") Long noticeId) {
         System.out.println("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
         Map<String, Object> map = bankTenderpubController.getInfos(String.valueOf(noticeId));
         if (map.size() < 2) return "请检查标段发布和标段查询请求数据是否成功!";
@@ -248,10 +258,10 @@ public class BankDepositController extends BaseController {
 
     @InnerAuth
     @GetMapping("/getDepositList")
-    public List<com.ruoyi.system.api.domain.BankDepositdesc> getDepositList(){
+    public List<com.ruoyi.system.api.domain.BankDepositdesc> getDepositList() {
         List<BankDepositdesc> bankDepositdescs = bankDepositdescService.selectBankDepositdescList2(new BankDepositdesc());
         List<com.ruoyi.system.api.domain.BankDepositdesc> list = new ArrayList<>();
-        for (BankDepositdesc item : bankDepositdescs){
+        for (BankDepositdesc item : bankDepositdescs) {
             com.ruoyi.system.api.domain.BankDepositdesc t = new com.ruoyi.system.api.domain.BankDepositdesc();
             t.setDepositdescid(item.getDepositdescid());
             t.setPpid(item.getPpid());
@@ -287,7 +297,8 @@ public class BankDepositController extends BaseController {
             t.setRtnTdracctnoccycd(item.getRtnTdracctnoccycd());
             t.setRtnTdracctnm(item.getRtnTdracctnm());
             t.setRtnTdracctnobnkno(item.getRtnTdracctnobnkno());
-            t.setRtnTdracctnobnknm(item.getRtnTdracctnobnknm());;
+            t.setRtnTdracctnobnknm(item.getRtnTdracctnobnknm());
+            ;
             t.setRtnTdrnum(item.getRtnTdrnum());
             t.setRtnMrgnamt(item.getRtnMrgnamt());
             t.setRtnTdramt(item.getRtnTdramt());
@@ -307,7 +318,7 @@ public class BankDepositController extends BaseController {
 
     @InnerAuth
     @PostMapping("/updateDeposit2")
-    public int updateDeposit2(@RequestParam("id") String id){
+    public int updateDeposit2(@RequestParam("id") String id) {
         BankDepositdesc bankDepositdesc = new BankDepositdesc();
         bankDepositdesc.setDepositdescid(id);
         bankDepositdesc.setRtnAgncsvcfee(new BigDecimal(2));
@@ -316,7 +327,7 @@ public class BankDepositController extends BaseController {
 
     @InnerAuth
     @PostMapping("insertDepositReason")
-    public int insertDepositReason(@RequestBody com.ruoyi.system.api.domain.BankDepositdescr bankDepositdescr){
+    public int insertDepositReason(@RequestBody com.ruoyi.system.api.domain.BankDepositdescr bankDepositdescr) {
         BankDepositdescr t = new BankDepositdescr();
         t.setDepositdescid(bankDepositdescr.getDepositdescid());
         t.setPpid(bankDepositdescr.getPpid());
@@ -352,7 +363,8 @@ public class BankDepositController extends BaseController {
         t.setRtnTdracctnoccycd(bankDepositdescr.getRtnTdracctnoccycd());
         t.setRtnTdracctnm(bankDepositdescr.getRtnTdracctnm());
         t.setRtnTdracctnobnkno(bankDepositdescr.getRtnTdracctnobnkno());
-        t.setRtnTdracctnobnknm(bankDepositdescr.getRtnTdracctnobnknm());;
+        t.setRtnTdracctnobnknm(bankDepositdescr.getRtnTdracctnobnknm());
+        ;
         t.setRtnTdrnum(bankDepositdescr.getRtnTdrnum());
         t.setRtnMrgnamt(bankDepositdescr.getRtnMrgnamt());
         t.setRtnTdramt(bankDepositdescr.getRtnTdramt());
@@ -366,7 +378,7 @@ public class BankDepositController extends BaseController {
         t.setRtnSvcfee(bankDepositdescr.getRtnSvcfee());
         t.setRtnRemark(bankDepositdescr.getRtnRemark());
         t.setReason(bankDepositdescr.getReason());
-        if(bankDepositdescrService.selectBankDepositdescrList(t).size() == 0){
+        if (bankDepositdescrService.selectBankDepositdescrList(t).size() == 0) {
             bankDepositdescrService.insertBankDepositdescr(t);
         }
         return 1;
@@ -374,7 +386,7 @@ public class BankDepositController extends BaseController {
 
     @InnerAuth
     @GetMapping("/getDeposits")
-    public List<BankDepositdesc> getDeposits(@RequestParam("uid") Long uid,@RequestParam("account") String account){
+    public List<BankDepositdesc> getDeposits(@RequestParam("uid") Long uid, @RequestParam("account") String account) {
         BankDepositdesc bankDepositdesc = new BankDepositdesc();
         bankDepositdesc.setPpid(uid);
         bankDepositdesc.getRtnTdracctno();
@@ -386,12 +398,12 @@ public class BankDepositController extends BaseController {
     @PostMapping("/refundDeposit")
     public int refundDeposit(@RequestParam("depositdescids") String[] depositdescids) {
         System.out.println(depositdescids.length);
-        if(depositdescids.length == 0){
+        if (depositdescids.length == 0) {
             depositdescids = new String[1];
             depositdescids[0] = "1";
         }
         List<BankDepositdesc> list = bankDepositdescService.selectByDepositdescids(depositdescids);
-        if(list.isEmpty()) return 0;
+        if (list.isEmpty()) return 0;
 
         String xml = "";
 

+ 41 - 30
ruoyi-modules/hh-mast/src/main/java/com/ruoyi/mast/bank/controller/BankDepositdescController.java

@@ -69,7 +69,7 @@ public class BankDepositdescController extends BaseController {
 
         Long[] uids = list.stream().map(BankDepositdesc::getPpid).toArray(Long[]::new);
 
-        if(uids.length>0){
+        if (uids.length > 0) {
             List<BidNotice> blist = remoteBidNoticeService.selectBidNoticeByUids(uids, SecurityConstants.INNER);
 
             for (int i = 0; i < list.size(); i++) {
@@ -202,7 +202,7 @@ public class BankDepositdescController extends BaseController {
             bd.setRtnTdracctnobnknm(JsonUtils.findJson(contentlist.get(i), "TDRACCTNOBNKNM"));
             bd.setRtnTdrnum(JsonUtils.findJson(contentlist.get(i), "TDRNUM"));
 
-            bd.setRtnMrgnamt(JsonUtils.checkBigDecimal(JsonUtils.findJson(contentlist.get(i), " MRGNAMT")));
+            bd.setRtnMrgnamt(JsonUtils.checkBigDecimal(JsonUtils.findJson(contentlist.get(i), "MRGNAMT")));
 
             bd.setRtnTdramt(JsonUtils.checkBigDecimal(JsonUtils.findJson(contentlist.get(i), "TDRAMT")));
 
@@ -231,32 +231,43 @@ public class BankDepositdescController extends BaseController {
 
     private String postBank(BankDepositdesc bankDepositdesc) {
         String host = env.getProperty("BANK.HOST") + ":" + env.getProperty("BANK.PORT");
-        HttpResponse rep = Unirest.post(host).body("<FOX>\n" +
-                "    <SIGNONMSGSRQV1>\n" +
-                "        <SONRQ>\n" +
-                "            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n" +
-                "            <CID>" + env.getProperty("BANK.CID") + "</CID>\n" +
-                "            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n" +
-                "            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n" +
-                "            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n" +
-                "            <APPID>BZJD</APPID>\n" +
-                "            <APPVER>1</APPVER>\n" +
-                "        </SONRQ>\n" +
-                "    </SIGNONMSGSRQV1>\n" +
-                "    <SECURITIES_MSGSRQV1>\n" +
-                "        <QUERYDEPOSITINTRNRQ>\n" +
-                "            <TRNUID>" + bankDepositdesc.getTrnuid() + "</TRNUID>\n" +
-                "            <RQBODY>\n" +
-                "                <SGTID>" + bankDepositdesc.getSgtid() + "</SGTID>\n" +
-                "                <SGTNO>" + bankDepositdesc.getSgtno() + "</SGTNO>\n" +
-                "                <PRJNO>" + bankDepositdesc.getPrjno() + "</PRJNO>\n" +
-                "                <PLTFMCSTNO>" + bankDepositdesc.getPltfmcstno() + "</PLTFMCSTNO>\n" +
-                "                <ENTPNM>" + bankDepositdesc.getEntpnm() + "</ENTPNM>\n" +
-                "                <PGNO>" + bankDepositdesc.getPgno() + "</PGNO>\n" +
-                "            </RQBODY>\n" +
-                "        </QUERYDEPOSITINTRNRQ>\n" +
-                "    </SECURITIES_MSGSRQV1>\n" +
-                "</FOX>").asString();
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append("<FOX>\n");
+        sb.append("    <SIGNONMSGSRQV1>\n");
+        sb.append("        <SONRQ>\n");
+        sb.append("            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n");
+        sb.append("            <CID>" + env.getProperty("BANK.CID") + "</CID>\n");
+        sb.append("            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n");
+        sb.append("            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n");
+        sb.append("            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n");
+        sb.append("            <APPID>BZJD</APPID>\n");
+        sb.append("            <APPVER>1</APPVER>\n");
+        sb.append("        </SONRQ>\n");
+        sb.append("    </SIGNONMSGSRQV1>\n");
+        sb.append("    <SECURITIES_MSGSRQV1>\n");
+        sb.append("        <QUERYDEPOSITINTRNRQ>\n");
+        sb.append("            <TRNUID>" + bankDepositdesc.getTrnuid() + "</TRNUID>\n");
+        sb.append("            <RQBODY>\n");
+        sb.append("                <SGTID>" + bankDepositdesc.getSgtid() + "</SGTID>\n");
+        sb.append("                <SGTNO>" + bankDepositdesc.getSgtno() + "</SGTNO>\n");
+        sb.append("                <PRJNO>" + bankDepositdesc.getPrjno() + "</PRJNO>\n");
+        sb.append("                <PLTFMCSTNO>" + bankDepositdesc.getPltfmcstno() + "</PLTFMCSTNO>\n");
+        sb.append("                <ENTPNM>" + bankDepositdesc.getEntpnm() + "</ENTPNM>\n");
+        sb.append("                <PGNO>" + bankDepositdesc.getPgno() + "</PGNO>\n");
+        sb.append("            </RQBODY>\n");
+        sb.append("        </QUERYDEPOSITINTRNRQ>\n");
+        sb.append("    </SECURITIES_MSGSRQV1>\n");
+        sb.append("</FOX>");
+
+        logger.info("目标主机:'{}', 查询保证金入账明细请求信息:'{}'", host, sb.toString());
+
+        HttpResponse rep = Unirest.post(host).body(sb.toString()).asString().ifSuccess(response -> {
+            logger.info("查询保证金入账明细请求成功信息:'{}'", response.getBody().toString());
+        }).ifFailure(response -> {
+            logger.info("查询保证金入账明细请求失败信息:'{}', statusCode:'{}'", response.getBody().toString(), response.getStatus());
+        });
 
         return rep.getBody().toString();
     }
@@ -270,12 +281,12 @@ public class BankDepositdescController extends BaseController {
     @DeleteMapping("/{depositdescids}")
     public AjaxResult remove(@PathVariable String[] depositdescids) {
         List<BankDepositdesc> list = bankDepositdescService.selectByDepositdescids(depositdescids);
-        if(list.isEmpty()) return toAjax(0);
+        if (list.isEmpty()) return toAjax(0);
 
         String xml = "";
 
         for (int i = 0; i < list.size(); i++) {
-             xml += "<CONTENT>\n" +
+            xml += "<CONTENT>\n" +
                     "   <INDEX>" + (i + 1) + "</INDEX>\n" +
                     "   <TDRNO>" + list.get(i).getRtnTdrno() + "</TDRNO>\n" +
                     "   <REMARK>批量退还保证金" + DateUtils.getTime() + "</REMARK>\n" +

+ 39 - 28
ruoyi-modules/hh-mast/src/main/java/com/ruoyi/mast/bank/controller/BankRefundController.java

@@ -67,7 +67,7 @@ public class BankRefundController extends BaseController {
 
         Long[] uids = list.stream().map(BankRefund::getPpid).toArray(Long[]::new);
 
-        if(uids.length>0){
+        if (uids.length > 0) {
             List<BidNotice> blist = remoteBidNoticeService.selectBidNoticeByUids(uids, SecurityConstants.INNER);
 
             for (int i = 0; i < list.size(); i++) {
@@ -241,33 +241,44 @@ public class BankRefundController extends BaseController {
 
     private String postBank(BankRefund bankRefund) {
         String host = env.getProperty("BANK.HOST") + ":" + env.getProperty("BANK.PORT");
-        HttpResponse rep = Unirest.post(host).body("<FOX>\n" +
-                "    <SIGNONMSGSRQV1>\n" +
-                "        <SONRQ>\n" +
-                "            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n" +
-                "            <CID>" + env.getProperty("BANK.CID") + "</CID>\n" +
-                "            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n" +
-                "            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n" +
-                "            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n" +
-                "            <APPID>BZJQ</APPID>\n" +
-                "            <APPVER>1</APPVER>\n" +
-                "        </SONRQ>\n" +
-                "    </SIGNONMSGSRQV1>\n" +
-                "    <SECURITIES_MSGSRQV1>\n" +
-                "        <QUERYDEPOSITRFNDTRNRQ>\n" +
-                "            <TRNUID>" + bankRefund.getTrnuid() + "</TRNUID>\n" +
-                "            <RQBODY>\n" +
-                "                <SGTID>" + bankRefund.getSgtid() + "</SGTID>\n" +
-                "                <SGTNO>" + bankRefund.getSgtno() + "</SGTNO>\n" +
-                "                <PRJNO>" + bankRefund.getPrjno() + "</PRJNO>\n" +
-                "                <ENTPNM>" + bankRefund.getEntpnm() + "</ENTPNM>\n" +
-                "                <BEGDT>" + bankRefund.getBegdt() + "</BEGDT>\n" +
-                "                <ENDDT>" + bankRefund.getEnddt() + "</ENDDT>\n" +
-                "                <PGNO>" + bankRefund.getPgno() + "</PGNO>\n" +
-                "            </RQBODY>\n" +
-                "        </QUERYDEPOSITRFNDTRNRQ>\n" +
-                "    </SECURITIES_MSGSRQV1>\n" +
-                "</FOX>").asString();
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append("<FOX>\n");
+        sb.append("    <SIGNONMSGSRQV1>\n");
+        sb.append("        <SONRQ>\n");
+        sb.append("            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n");
+        sb.append("            <CID>" + env.getProperty("BANK.CID") + "</CID>\n");
+        sb.append("            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n");
+        sb.append("            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n");
+        sb.append("            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n");
+        sb.append("            <APPID>BZJQ</APPID>\n");
+        sb.append("            <APPVER>1</APPVER>\n");
+        sb.append("        </SONRQ>\n");
+        sb.append("    </SIGNONMSGSRQV1>\n");
+        sb.append("    <SECURITIES_MSGSRQV1>\n");
+        sb.append("        <QUERYDEPOSITRFNDTRNRQ>\n");
+        sb.append("            <TRNUID>" + bankRefund.getTrnuid() + "</TRNUID>\n");
+        sb.append("            <RQBODY>\n");
+        sb.append("                <SGTID>" + bankRefund.getSgtid() + "</SGTID>\n");
+        sb.append("                <SGTNO>" + bankRefund.getSgtno() + "</SGTNO>\n");
+        sb.append("                <PRJNO>" + bankRefund.getPrjno() + "</PRJNO>\n");
+        sb.append("                <ENTPNM>" + bankRefund.getEntpnm() + "</ENTPNM>\n");
+        sb.append("                <BEGDT>" + bankRefund.getBegdt() + "</BEGDT>\n");
+        sb.append("                <ENDDT>" + bankRefund.getEnddt() + "</ENDDT>\n");
+        sb.append("                <PGNO>" + bankRefund.getPgno() + "</PGNO>\n");
+        sb.append("            </RQBODY>\n");
+        sb.append("        </QUERYDEPOSITRFNDTRNRQ>\n");
+        sb.append("    </SECURITIES_MSGSRQV1>\n");
+        sb.append("</FOX>");
+
+        logger.info("目标主机:'{}', 查询保证金退款信息请求信息:'{}'", host, sb.toString());
+
+        HttpResponse rep = Unirest.post(host).body(sb.toString()).asString().ifSuccess(response -> {
+            logger.info("查询保证金退款信息请求成功信息:'{}'", response.getBody().toString());
+        }).ifFailure(response -> {
+            logger.info("查询保证金退款信息请求失败信息:'{}', statusCode:'{}'", response.getBody().toString(), response.getStatus());
+        });
 
         return rep.getBody().toString();
     }

+ 33 - 22
ruoyi-modules/hh-mast/src/main/java/com/ruoyi/mast/bank/controller/BankRefundbatController.java

@@ -68,7 +68,7 @@ public class BankRefundbatController extends BaseController {
 
         Long[] uids = list.stream().map(BankRefundbat::getPpid).toArray(Long[]::new);
 
-        if(uids.length>0){
+        if (uids.length > 0) {
             List<BidNotice> blist = remoteBidNoticeService.selectBidNoticeByUids(uids, SecurityConstants.INNER);
 
             for (int i = 0; i < list.size(); i++) {
@@ -209,27 +209,38 @@ public class BankRefundbatController extends BaseController {
 
     private String postBank(BankRefundbat bankRefundbat) {
         String host = env.getProperty("BANK.HOST") + ":" + env.getProperty("BANK.PORT");
-        HttpResponse rep = Unirest.post(host).body("<FOX>\n" +
-                "    <SIGNONMSGSRQV1>\n" +
-                "        <SONRQ>\n" +
-                "            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n" +
-                "            <CID>" + env.getProperty("BANK.CID") + "</CID>\n" +
-                "            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n" +
-                "            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n" +
-                "            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n" +
-                "            <APPID>BZJB</APPID>\n" +
-                "            <APPVER>1</APPVER>\n" +
-                "        </SONRQ>\n" +
-                "    </SIGNONMSGSRQV1>\n" +
-                "    <SECURITIES_MSGSRQV1>\n" +
-                "        <DEPOSITBATCHREFUNDTRNRQ>\n" +
-                "            <TRNUID>" + bankRefundbat.getTrnuid() + "</TRNUID>\n" +
-                "            <RQBODY>\n" + bankRefundbat.getRqbody() +
-                "                <TFROUTMD>0</TFROUTMD>\n" +
-                "            </RQBODY>\n" +
-                "        </DEPOSITBATCHREFUNDTRNRQ>\n" +
-                "    </SECURITIES_MSGSRQV1>\n" +
-                "</FOX>").asString();
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append("<FOX>\n");
+        sb.append("    <SIGNONMSGSRQV1>\n");
+        sb.append("        <SONRQ>\n");
+        sb.append("            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n");
+        sb.append("            <CID>" + env.getProperty("BANK.CID") + "</CID>\n");
+        sb.append("            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n");
+        sb.append("            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n");
+        sb.append("            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n");
+        sb.append("            <APPID>BZJB</APPID>\n");
+        sb.append("            <APPVER>1</APPVER>\n");
+        sb.append("        </SONRQ>\n");
+        sb.append("    </SIGNONMSGSRQV1>\n");
+        sb.append("    <SECURITIES_MSGSRQV1>\n");
+        sb.append("        <DEPOSITBATCHREFUNDTRNRQ>\n");
+        sb.append("            <TRNUID>" + bankRefundbat.getTrnuid() + "</TRNUID>\n");
+        sb.append("            <RQBODY>\n" + bankRefundbat.getRqbody());
+        sb.append("                <TFROUTMD>0</TFROUTMD>\n");
+        sb.append("            </RQBODY>\n");
+        sb.append("        </DEPOSITBATCHREFUNDTRNRQ>\n");
+        sb.append("    </SECURITIES_MSGSRQV1>\n");
+        sb.append("</FOX>");
+
+        logger.info("目标主机:'{}', 批量退还保证金请求信息:'{}'", host, sb.toString());
+
+        HttpResponse rep = Unirest.post(host).body(sb.toString()).asString().ifSuccess(response -> {
+            logger.info("批量退还保证金请求成功信息:'{}'", response.getBody().toString());
+        }).ifFailure(response -> {
+            logger.info("批量退还保证金请求失败信息:'{}', statusCode:'{}'", response.getBody().toString(), response.getStatus());
+        });
 
         return rep.getBody().toString();
     }

+ 54 - 43
ruoyi-modules/hh-mast/src/main/java/com/ruoyi/mast/bank/controller/BankTenderpubController.java

@@ -20,6 +20,8 @@ import com.ruoyi.system.api.RemotePlanService;
 import com.ruoyi.system.api.domain.BidNotice;
 import kong.unirest.core.HttpResponse;
 import kong.unirest.core.Unirest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.transaction.annotation.Transactional;
@@ -81,7 +83,7 @@ public class BankTenderpubController extends BaseController {
 
         Long[] uids = list.stream().map(BankTenderpub::getPpid).toArray(Long[]::new);
 
-        if(uids.length>0){
+        if (uids.length > 0) {
             List<BidNotice> blist = remoteBidNoticeService.selectBidNoticeByUids(uids, SecurityConstants.INNER);
 
             for (int i = 0; i < list.size(); i++) {
@@ -93,7 +95,6 @@ public class BankTenderpubController extends BaseController {
     }
 
 
-
     /**
      * 导出标段发布列表
      */
@@ -228,11 +229,11 @@ public class BankTenderpubController extends BaseController {
                 System.out.println(msg);
                 if (msg.isSuccess()) {
                     System.out.println("获取虚拟子账户");
-                    return account+lno;
+                    return account + lno;
                 } else {
                     return null;
                 }
-            } else{
+            } else {
                 return null;
             }
         } else {
@@ -304,7 +305,7 @@ public class BankTenderpubController extends BaseController {
      * 同步数据
      */
     // @RequiresPermissions("bank:tenderpub:edit")
-    @Log(title = "标段修改", businessType = BusinessType.UPDATE)
+    @Log(title = "标段发布", businessType = BusinessType.UPDATE)
     @PutMapping("/edit")
     public AjaxResult edit(@RequestBody BankTenderpub bankTenderpub) {
         List<BankTenderpub> list = bankTenderpubService.selectBankTenderpubList(bankTenderpub);
@@ -350,44 +351,54 @@ public class BankTenderpubController extends BaseController {
 
     private String postBank(BankTenderpub bankTenderpub) {
         String host = env.getProperty("BANK.HOST") + ":" + env.getProperty("BANK.PORT");
-        HttpResponse rep = Unirest.post(host).body("<FOX>\n" +
-                "    <SIGNONMSGSRQV1>\n" +
-                "        <SONRQ>\n" +
-                "            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n" +
-                "            <CID>" + env.getProperty("BANK.CID") + "</CID>\n" +
-                "            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n" +
-                "            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n" +
-                "            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n" +
-                "            <APPID>BDP</APPID>\n" +
-                "            <APPVER>1</APPVER>\n" +
-                "        </SONRQ>\n" +
-                "    </SIGNONMSGSRQV1>\n" +
-                "    <SECURITIES_MSGSRQV1>\n" +
-                "        <OPENTENDERTRNRQ>\n" +
-                "            <TRNUID>" + bankTenderpub.getTrnuid() + "</TRNUID>\n" +
-                "            <RQBODY>\n" +
-                "                <ACCTNO>" + bankTenderpub.getAcctno() + "</ACCTNO>\n" +
-                "                <CCYCD>01</CCYCD>\n" +
-                "                <PRJNO>" + bankTenderpub.getPrjno() + "</PRJNO>\n" +
-                "                <SGTNO>" + bankTenderpub.getSgtno() + "</SGTNO>\n" +
-                "                <SGTNM>" + bankTenderpub.getSgtnm() + "</SGTNM>\n" +
-                "                <SGTACCTGENTP>" + bankTenderpub.getSgtacctgentp() + "</SGTACCTGENTP>\n" +
-                "                <SGTTP>" + bankTenderpub.getSgttp() + "</SGTTP>\n" +
-                "                <INTACRLFLG>" + bankTenderpub.getIntacrlflg() + "</INTACRLFLG>\n" +
-                "                <SECRETTP>" + bankTenderpub.getSecrettp() + "</SECRETTP>\n" +
-                "                <TDRACCTNOVRFYFLG>" + bankTenderpub.getTdracctnovrfyflg() + "</TDRACCTNOVRFYFLG>\n" +
-                "                <ALWAFDDLNTDRFLG>" + bankTenderpub.getAlwafddlntdrflg() + "</ALWAFDDLNTDRFLG>\n" +
-                "                <BNKRFNDCFRMFLG>" + bankTenderpub.getBnkrfndcfrmflg() + "</BNKRFNDCFRMFLG>\n" +
-                "                <MRGNAMT>" + bankTenderpub.getMrgnamt() + "</MRGNAMT>\n" +
-                "                <STRTSGTDT>" + bankTenderpub.getStrtsgtdt() + "</STRTSGTDT>\n" +
-                "                <MRGNDUESTOPDT>" + bankTenderpub.getMrgnduestopdt() + "</MRGNDUESTOPDT>\n" +
-                "                <MRGNDUESTOPTM>" + bankTenderpub.getMrgnduestoptm() + "</MRGNDUESTOPTM>\n" +
-                "                <OPNTDRDT>" + bankTenderpub.getOpntdrdt() + "</OPNTDRDT>\n" +
-                "                <OPNTDRTM>" + bankTenderpub.getOpntdrtm() + "</OPNTDRTM>\n" +
-                "            </RQBODY>\n" +
-                "        </OPENTENDERTRNRQ>\n" +
-                "    </SECURITIES_MSGSRQV1>\n" +
-                "</FOX>").asString();
+
+        StringBuffer sb = new StringBuffer();
+        sb.append("<FOX>\n");
+        sb.append("    <SIGNONMSGSRQV1>\n");
+        sb.append("        <SONRQ>\n");
+        sb.append("            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n");
+        sb.append("            <CID>" + env.getProperty("BANK.CID") + "</CID>\n");
+        sb.append("            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n");
+        sb.append("            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n");
+        sb.append("            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n");
+        sb.append("            <APPID>BDP</APPID>\n");
+        sb.append("            <APPVER>1</APPVER>\n");
+        sb.append("        </SONRQ>\n");
+        sb.append("    </SIGNONMSGSRQV1>\n");
+        sb.append("    <SECURITIES_MSGSRQV1>\n");
+        sb.append("        <OPENTENDERTRNRQ>\n");
+        sb.append("            <TRNUID>" + bankTenderpub.getTrnuid() + "</TRNUID>\n");
+        sb.append("            <RQBODY>\n");
+        sb.append("                <ACCTNO>" + bankTenderpub.getAcctno() + "</ACCTNO>\n");
+        sb.append("                <CCYCD>01</CCYCD>\n");
+        sb.append("                <PRJNO>" + bankTenderpub.getPrjno() + "</PRJNO>\n");
+        sb.append("                <SGTNO>" + bankTenderpub.getSgtno() + "</SGTNO>\n");
+        sb.append("                <SGTNM>" + bankTenderpub.getSgtnm() + "</SGTNM>\n");
+        sb.append("                <SGTACCTGENTP>" + bankTenderpub.getSgtacctgentp() + "</SGTACCTGENTP>\n");
+        sb.append("                <SGTTP>" + bankTenderpub.getSgttp() + "</SGTTP>\n");
+        sb.append("                <INTACRLFLG>" + bankTenderpub.getIntacrlflg() + "</INTACRLFLG>\n");
+        sb.append("                <SECRETTP>" + bankTenderpub.getSecrettp() + "</SECRETTP>\n");
+        sb.append("                <TDRACCTNOVRFYFLG>" + bankTenderpub.getTdracctnovrfyflg() + "</TDRACCTNOVRFYFLG>\n");
+        sb.append("                <ALWAFDDLNTDRFLG>" + bankTenderpub.getAlwafddlntdrflg() + "</ALWAFDDLNTDRFLG>\n");
+        sb.append("                <BNKRFNDCFRMFLG>" + bankTenderpub.getBnkrfndcfrmflg() + "</BNKRFNDCFRMFLG>\n");
+        sb.append("                <MRGNAMT>" + bankTenderpub.getMrgnamt() + "</MRGNAMT>\n");
+        sb.append("                <STRTSGTDT>" + bankTenderpub.getStrtsgtdt() + "</STRTSGTDT>\n");
+        sb.append("                <MRGNDUESTOPDT>" + bankTenderpub.getMrgnduestopdt() + "</MRGNDUESTOPDT>\n");
+        sb.append("                <MRGNDUESTOPTM>" + bankTenderpub.getMrgnduestoptm() + "</MRGNDUESTOPTM>\n");
+        sb.append("                <OPNTDRDT>" + bankTenderpub.getOpntdrdt() + "</OPNTDRDT>\n");
+        sb.append("                <OPNTDRTM>" + bankTenderpub.getOpntdrtm() + "</OPNTDRTM>\n");
+        sb.append("            </RQBODY>\n");
+        sb.append("        </OPENTENDERTRNRQ>\n");
+        sb.append("    </SECURITIES_MSGSRQV1>\n");
+        sb.append("</FOX>");
+
+        logger.info("目标主机:'{}', 标段发布请求信息:'{}'", host, sb.toString());
+
+        HttpResponse rep = Unirest.post(host).body(sb.toString()).asString().ifSuccess(response -> {
+            logger.info("标段发布请求成功信息:'{}'", response.getBody().toString());
+        }).ifFailure(response -> {
+            logger.info("标段发布请求失败信息:'{}', statusCode:'{}'", response.getBody().toString(), response.getStatus());
+        });
 
         return rep.getBody().toString();
     }

+ 38 - 25
ruoyi-modules/hh-mast/src/main/java/com/ruoyi/mast/bank/controller/BankTenderqueryController.java

@@ -16,6 +16,8 @@ import com.ruoyi.system.api.domain.BidNotice;
 import com.ruoyi.system.api.domain.PpmProcurementPlan;
 import kong.unirest.core.HttpResponse;
 import kong.unirest.core.Unirest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -65,7 +67,7 @@ public class BankTenderqueryController extends BaseController {
 
         Long[] uids = list.stream().map(BankTenderquery::getPpid).toArray(Long[]::new);
 
-        if(uids.length>0){
+        if (uids.length > 0) {
             List<BidNotice> blist = remoteBidNoticeService.selectBidNoticeByUids(uids, SecurityConstants.INNER);
 
             for (int i = 0; i < list.size(); i++) {
@@ -124,7 +126,7 @@ public class BankTenderqueryController extends BaseController {
         return toAjax(update(bt, rtnxml));
     }
 
-    public AjaxResult addBankTenderquery(BankTenderquery bankTenderquery){
+    public AjaxResult addBankTenderquery(BankTenderquery bankTenderquery) {
 //        BankTenderquery bt = new BankTenderquery();
         // 流水号
         String TRNUID = "BDQ" + System.currentTimeMillis() + (new Random().nextInt(1000) + 1);
@@ -147,8 +149,7 @@ public class BankTenderqueryController extends BaseController {
             bankTenderqueryService.insertBankTenderquery(bankTenderquery);
             update(bankTenderquery, rtnxml);
             return AjaxResult.success(rtn);
-        }
-        else return AjaxResult.error(rtn);
+        } else return AjaxResult.error(rtn);
     }
 
     private int update(BankTenderquery bankTenderquery, String rtnxml) {
@@ -197,27 +198,39 @@ public class BankTenderqueryController extends BaseController {
     }
 
     private String postBank(BankTenderquery bankTenderquery) {
-        HttpResponse rep = Unirest.post(env.getProperty("BANK.HOST") + ":" + env.getProperty("BANK.PORT")).body("<FOX>\n" +
-                "    <SIGNONMSGSRQV1>\n" +
-                "        <SONRQ>\n" +
-                "            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n" +
-                "            <CID>" + env.getProperty("BANK.CID") + "</CID>\n" +
-                "            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n" +
-                "            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n" +
-                "            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n" +
-                "            <APPID>BDQ</APPID>\n" +
-                "            <APPVER>1</APPVER>\n" +
-                "        </SONRQ>\n" +
-                "    </SIGNONMSGSRQV1>\n" +
-                "    <SECURITIES_MSGSRQV1>\n" +
-                "        <QUERYTENDERINFOTRNRQ>\n" +
-                "            <TRNUID>" + bankTenderquery.getTrnuid() + "</TRNUID>\n" +
-                "            <RQBODY>\n" +
-                "                <SGTID>" + bankTenderquery.getSgtid() + "</SGTID>\n" +
-                "            </RQBODY>\n" +
-                "        </QUERYTENDERINFOTRNRQ>\n" +
-                "    </SECURITIES_MSGSRQV1>\n" +
-                "</FOX>").asString();
+        String host = env.getProperty("BANK.HOST") + ":" + env.getProperty("BANK.PORT");
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append("<FOX>\n");
+        sb.append("    <SIGNONMSGSRQV1>\n");
+        sb.append("        <SONRQ>\n");
+        sb.append("            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n");
+        sb.append("            <CID>" + env.getProperty("BANK.CID") + "</CID>\n");
+        sb.append("            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n");
+        sb.append("            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n");
+        sb.append("            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n");
+        sb.append("            <APPID>BDQ</APPID>\n");
+        sb.append("            <APPVER>1</APPVER>\n");
+        sb.append("        </SONRQ>\n");
+        sb.append("    </SIGNONMSGSRQV1>\n");
+        sb.append("    <SECURITIES_MSGSRQV1>\n");
+        sb.append("        <QUERYTENDERINFOTRNRQ>\n");
+        sb.append("            <TRNUID>" + bankTenderquery.getTrnuid() + "</TRNUID>\n");
+        sb.append("            <RQBODY>\n");
+        sb.append("                <SGTID>" + bankTenderquery.getSgtid() + "</SGTID>\n");
+        sb.append("            </RQBODY>\n");
+        sb.append("        </QUERYTENDERINFOTRNRQ>\n");
+        sb.append("    </SECURITIES_MSGSRQV1>\n");
+        sb.append("</FOX>");
+
+        logger.info("目标主机:'{}', 标段信息查询请求信息:'{}'", host, sb.toString());
+
+        HttpResponse rep = Unirest.post(host).body(sb.toString()).asString().ifSuccess(response -> {
+            logger.info("标段信息查询请求成功信息:'{}'", response.getBody().toString());
+        }).ifFailure(response -> {
+            logger.info("标段信息查询求失败信息:'{}', statusCode:'{}'", response.getBody().toString(), response.getStatus());
+        });
 
         return rep.getBody().toString();
     }

+ 36 - 24
ruoyi-modules/hh-mast/src/main/java/com/ruoyi/mast/bank/controller/BankUncleardepositController.java

@@ -13,6 +13,8 @@ import com.ruoyi.mast.bank.utils.JsonUtils;
 import com.ruoyi.system.api.RemotePlanService;
 import kong.unirest.core.HttpResponse;
 import kong.unirest.core.Unirest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -213,30 +215,40 @@ public class BankUncleardepositController extends BaseController {
 
     private String postBank(BankUncleardeposit bankUncleardeposit) {
         String host = env.getProperty("BANK.HOST") + ":" + env.getProperty("BANK.PORT");
-        HttpResponse rep = Unirest.post(host).body("<FOX>\n" +
-                "    <SIGNONMSGSRQV1>\n" +
-                "        <SONRQ>\n" +
-                "            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n" +
-                "            <CID>" + env.getProperty("BANK.CID") + "</CID>\n" +
-                "            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n" +
-                "            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n" +
-                "            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n" +
-                "            <APPID>BMBZJD</APPID>\n" +
-                "            <APPVER>1</APPVER>\n" +
-                "        </SONRQ>\n" +
-                "    </SIGNONMSGSRQV1>\n" +
-                "    <SECURITIES_MSGSRQV1>\n" +
-                "        <QUERYUNCLEARDEPOSITTRNRQ>\n" +
-                "            <TRNUID>" + bankUncleardeposit.getTrnuid() + "</TRNUID>\n" +
-                "            <RQBODY PAGE='" + bankUncleardeposit.getPage() + "' SIZE='100'>\n" +
-                "                <ACCTNO>" + bankUncleardeposit.getAcctno() + "</ACCTNO>\n" +
-                "                <CCYCD>" + bankUncleardeposit.getCcycd() + "</CCYCD>\n" +
-                "                <BEGDT>" + bankUncleardeposit.getBegdt() + "</BEGDT>\n" +
-                "                <ENDDT>" + bankUncleardeposit.getEnddt() + "</ENDDT>\n" +
-                "            </RQBODY>\n" +
-                "        </QUERYUNCLEARDEPOSITTRNRQ>\n" +
-                "    </SECURITIES_MSGSRQV1>\n" +
-                "</FOX>").asString();
+
+        StringBuffer sb = new StringBuffer();
+        sb.append("<FOX>\n" );
+        sb.append("    <SIGNONMSGSRQV1>\n" );
+        sb.append("        <SONRQ>\n" );
+        sb.append("            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n" );
+        sb.append("            <CID>" + env.getProperty("BANK.CID") + "</CID>\n" );
+        sb.append("            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n" );
+        sb.append("            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n" );
+        sb.append("            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n" );
+        sb.append("            <APPID>BMBZJD</APPID>\n" );
+        sb.append("            <APPVER>1</APPVER>\n" );
+        sb.append("        </SONRQ>\n" );
+        sb.append("    </SIGNONMSGSRQV1>\n" );
+        sb.append("    <SECURITIES_MSGSRQV1>\n" );
+        sb.append("        <QUERYUNCLEARDEPOSITTRNRQ>\n" );
+        sb.append("            <TRNUID>" + bankUncleardeposit.getTrnuid() + "</TRNUID>\n" );
+        sb.append("            <RQBODY PAGE='" + bankUncleardeposit.getPage() + "' SIZE='100'>\n" );
+        sb.append("                <ACCTNO>" + bankUncleardeposit.getAcctno() + "</ACCTNO>\n" );
+        sb.append("                <CCYCD>" + bankUncleardeposit.getCcycd() + "</CCYCD>\n" );
+        sb.append("                <BEGDT>" + bankUncleardeposit.getBegdt() + "</BEGDT>\n" );
+        sb.append("                <ENDDT>" + bankUncleardeposit.getEnddt() + "</ENDDT>\n" );
+        sb.append("            </RQBODY>\n" );
+        sb.append("        </QUERYUNCLEARDEPOSITTRNRQ>\n" );
+        sb.append("    </SECURITIES_MSGSRQV1>\n" );
+        sb.append("</FOX>");
+
+        logger.info("目标主机:'{}', 查询不明保证金明细请求信息:'{}'", host, sb.toString());
+
+        HttpResponse rep = Unirest.post(host).body(sb.toString()).asString().ifSuccess(response -> {
+            logger.info("查询不明保证金明细请求成功信息:'{}'", response.getBody().toString());
+        }).ifFailure(response -> {
+            logger.info("查询不明保证金明细请求失败信息:'{}', statusCode:'{}'", response.getBody().toString(), response.getStatus());
+        });
 
         return rep.getBody().toString();
     }

+ 46 - 43
ruoyi-modules/hh-mast/src/main/java/com/ruoyi/mast/bank/controller/BankUncleardepositrfndController.java

@@ -17,6 +17,8 @@ import com.ruoyi.system.api.RemotePlanService;
 import com.ruoyi.system.api.domain.BidNotice;
 import kong.unirest.core.HttpResponse;
 import kong.unirest.core.Unirest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -39,14 +41,13 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 
 /**
  * 不明保证金退款申请Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-09-03
  */
 @RestController
 @RequestMapping("/uncleardepositrfnd")
-public class BankUncleardepositrfndController extends BaseController
-{
+public class BankUncleardepositrfndController extends BaseController {
     @Autowired
     private IBankUncleardepositrfndService bankUncleardepositrfndService;
 
@@ -58,8 +59,7 @@ public class BankUncleardepositrfndController extends BaseController
      */
     // @RequiresPermissions("bank:uncleardepositrfnd:list")
     @GetMapping("/list")
-    public TableDataInfo list(BankUncleardepositrfnd bankUncleardepositrfnd)
-    {
+    public TableDataInfo list(BankUncleardepositrfnd bankUncleardepositrfnd) {
         startPage();
         List<BankUncleardepositrfnd> list = bankUncleardepositrfndService.selectBankUncleardepositrfndList(bankUncleardepositrfnd);
 
@@ -72,8 +72,7 @@ public class BankUncleardepositrfndController extends BaseController
     // @RequiresPermissions("bank:uncleardepositrfnd:export")
     @Log(title = "不明保证金退款申请", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, BankUncleardepositrfnd bankUncleardepositrfnd)
-    {
+    public void export(HttpServletResponse response, BankUncleardepositrfnd bankUncleardepositrfnd) {
         List<BankUncleardepositrfnd> list = bankUncleardepositrfndService.selectBankUncleardepositrfndList(bankUncleardepositrfnd);
         ExcelUtil<BankUncleardepositrfnd> util = new ExcelUtil<BankUncleardepositrfnd>(BankUncleardepositrfnd.class);
         util.exportExcel(response, list, "不明保证金退款申请数据");
@@ -84,8 +83,7 @@ public class BankUncleardepositrfndController extends BaseController
      */
     // @RequiresPermissions("bank:uncleardepositrfnd:query")
     @GetMapping(value = "/{uncleardepositrfndid}")
-    public AjaxResult getInfo(@PathVariable("uncleardepositrfndid") String uncleardepositrfndid)
-    {
+    public AjaxResult getInfo(@PathVariable("uncleardepositrfndid") String uncleardepositrfndid) {
         return success(bankUncleardepositrfndService.selectBankUncleardepositrfndByUncleardepositrfndid(uncleardepositrfndid));
     }
 
@@ -95,13 +93,11 @@ public class BankUncleardepositrfndController extends BaseController
     // @RequiresPermissions("bank:uncleardepositrfnd:add")
     @Log(title = "不明保证金退款申请", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody BankUncleardepositrfnd bankUncleardepositrfnd)
-    {
+    public AjaxResult add(@RequestBody BankUncleardepositrfnd bankUncleardepositrfnd) {
         return addBankUncleardepositrfnd(bankUncleardepositrfnd);
     }
 
-    public AjaxResult addBankUncleardepositrfnd(BankUncleardepositrfnd bankUncleardepositrfnd)
-    {
+    public AjaxResult addBankUncleardepositrfnd(BankUncleardepositrfnd bankUncleardepositrfnd) {
 
         // 流水号
         String TRNUID = "BMBZJB" + System.currentTimeMillis() + (new Random().nextInt(1000) + 1);
@@ -118,8 +114,7 @@ public class BankUncleardepositrfndController extends BaseController
             bankUncleardepositrfndService.insertBankUncleardepositrfnd(bankUncleardepositrfnd);
             update(bankUncleardepositrfnd, rtnxml);
             return AjaxResult.success(rtn);
-        }
-        else return AjaxResult.error(rtn);
+        } else return AjaxResult.error(rtn);
     }
 
     /**
@@ -128,8 +123,7 @@ public class BankUncleardepositrfndController extends BaseController
     // @RequiresPermissions("bank:uncleardepositrfnd:edit")
     @Log(title = "不明保证金退款申请", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody BankUncleardepositrfnd bankUncleardepositrfnd)
-    {
+    public AjaxResult edit(@RequestBody BankUncleardepositrfnd bankUncleardepositrfnd) {
         List<BankUncleardepositrfnd> list = bankUncleardepositrfndService.selectBankUncleardepositrfndList(bankUncleardepositrfnd);
         if (list.isEmpty()) return AjaxResult.error("");
         BankUncleardepositrfnd bt = list.get(0);
@@ -174,29 +168,39 @@ public class BankUncleardepositrfndController extends BaseController
 
     private String postBank(BankUncleardepositrfnd bankUncleardepositrfnd) {
         String host = env.getProperty("BANK.HOST") + ":" + env.getProperty("BANK.PORT");
-        HttpResponse rep = Unirest.post(host).body("<FOX>\n" +
-                "    <SIGNONMSGSRQV1>\n" +
-                "        <SONRQ>\n" +
-                "            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n" +
-                "            <CID>" + env.getProperty("BANK.CID") + "</CID>\n" +
-                "            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n" +
-                "            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n" +
-                "            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n" +
-                "            <APPID>BMBZJB</APPID>\n" +
-                "            <APPVER>1</APPVER>\n" +
-                "        </SONRQ>\n" +
-                "    </SIGNONMSGSRQV1>\n" +
-                "    <SECURITIES_MSGSRQV1>\n" +
-                "        <UNCLEARDEPOSITRFNDTRNRQ>\n" +
-                "            <TRNUID>" + bankUncleardepositrfnd.getTrnuid() + "</TRNUID>\n" +
-                "            <RQBODY>\n" +
-                "                <SERIALNO>" + bankUncleardepositrfnd.getSerialno() + "</SERIALNO>\n" +
-                "                <TRADEDATE>" + bankUncleardepositrfnd.getTradedate() + "</TRADEDATE>\n" +
-                "                <DESTBAILAMT>" + bankUncleardepositrfnd.getDestbailamt() + "</DESTBAILAMT>\n" +
-                "            </RQBODY>\n" +
-                "        </UNCLEARDEPOSITRFNDTRNRQ>\n" +
-                "    </SECURITIES_MSGSRQV1>\n" +
-                "</FOX>").asString();
+
+        StringBuffer sb = new StringBuffer();
+        sb.append("<FOX>\n");
+        sb.append("    <SIGNONMSGSRQV1>\n");
+        sb.append("        <SONRQ>\n");
+        sb.append("            <DTCLIENT>" + DateUtils.getTime() + "</DTCLIENT>\n");
+        sb.append("            <CID>" + env.getProperty("BANK.CID") + "</CID>\n");
+        sb.append("            <USERID>" + env.getProperty("BANK.USERID") + "</USERID>\n");
+        sb.append("            <USERPASS>" + env.getProperty("BANK.USERPASS") + "</USERPASS>\n");
+        sb.append("            <GENUSERKEY>" + env.getProperty("BANK.GENUSERKEY") + "</GENUSERKEY>\n");
+        sb.append("            <APPID>BMBZJB</APPID>\n");
+        sb.append("            <APPVER>1</APPVER>\n");
+        sb.append("        </SONRQ>\n");
+        sb.append("    </SIGNONMSGSRQV1>\n");
+        sb.append("    <SECURITIES_MSGSRQV1>\n");
+        sb.append("        <UNCLEARDEPOSITRFNDTRNRQ>\n");
+        sb.append("            <TRNUID>" + bankUncleardepositrfnd.getTrnuid() + "</TRNUID>\n");
+        sb.append("            <RQBODY>\n");
+        sb.append("                <SERIALNO>" + bankUncleardepositrfnd.getSerialno() + "</SERIALNO>\n");
+        sb.append("                <TRADEDATE>" + bankUncleardepositrfnd.getTradedate() + "</TRADEDATE>\n");
+        sb.append("                <DESTBAILAMT>" + bankUncleardepositrfnd.getDestbailamt() + "</DESTBAILAMT>\n");
+        sb.append("            </RQBODY>\n");
+        sb.append("        </UNCLEARDEPOSITRFNDTRNRQ>\n");
+        sb.append("    </SECURITIES_MSGSRQV1>\n");
+        sb.append("</FOX>");
+
+        logger.info("目标主机:'{}', 不明保证金退款申请请求信息:'{}'", host, sb.toString());
+
+        HttpResponse rep = Unirest.post(host).body(sb.toString()).asString().ifSuccess(response -> {
+            logger.info("不明保证金退款申请请求成功信息:'{}'", response.getBody().toString());
+        }).ifFailure(response -> {
+            logger.info("不明保证金退款申请请求失败信息:'{}', statusCode:'{}'", response.getBody().toString(), response.getStatus());
+        });
 
         return rep.getBody().toString();
     }
@@ -207,9 +211,8 @@ public class BankUncleardepositrfndController extends BaseController
      */
     // @RequiresPermissions("bank:uncleardepositrfnd:remove")
     @Log(title = "不明保证金退款申请", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{uncleardepositrfndids}")
-    public AjaxResult remove(@PathVariable String[] uncleardepositrfndids)
-    {
+    @DeleteMapping("/{uncleardepositrfndids}")
+    public AjaxResult remove(@PathVariable String[] uncleardepositrfndids) {
         return toAjax(bankUncleardepositrfndService.deleteBankUncleardepositrfndByUncleardepositrfndids(uncleardepositrfndids));
     }
 }

+ 6 - 8
ruoyi-modules/hh-mast/src/main/java/com/ruoyi/mast/bank/utils/JsonUtils.java

@@ -14,8 +14,6 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Collectors;
 
-import static org.json.JSONArray.*;
-
 /**
  * Json属性查询
  *
@@ -24,7 +22,7 @@ import static org.json.JSONArray.*;
 public class JsonUtils {
 
     public static ArrayList<String> Convert(String attrs) {
-        ArrayList<String> list = new ArrayList<String>(Arrays.asList(attrs.split("/")));
+        ArrayList<String> list = new ArrayList<String>(Arrays.asList(attrs.replaceAll("\\s*", "").split("/")));
         return list;
     }
 
@@ -85,12 +83,12 @@ public class JsonUtils {
         ArrayList<String> contents = new ArrayList<>();
         if (!object.has("CONTENT")) return contents;
 
-        if(object.get("CONTENT").getClass().isInstance(new JSONArray())){
+        if (object.get("CONTENT").getClass().isInstance(new JSONArray())) {
             JSONArray arr = (JSONArray) object.get("CONTENT");
             for (int i = 0; i < arr.length(); i++) {
                 contents.add(arr.get(i).toString());
             }
-        }else{
+        } else {
             JSONObject o = (JSONObject) object.get("CONTENT");
             contents.add(o.toString());
         }
@@ -148,7 +146,7 @@ public class JsonUtils {
 
         String XFERPRCCODE = JsonUtils.findXML(xml, "FOX/SECURITIES_MSGSRSV1/*/RSBODY/XFERPRCSTS/XFERPRCCODE");
         if ("0".equals(CODE) && "PAYOUT".equals(XFERPRCCODE)) return "交易成功";
-        if ("0".equals(CODE) && !"PAYOUT".equals(XFERPRCCODE)&& !"".equals(XFERPRCCODE))
+        if ("0".equals(CODE) && !"PAYOUT".equals(XFERPRCCODE) && !"".equals(XFERPRCCODE))
             return JsonUtils.findXML(xml, "FOX/SECURITIES_MSGSRSV1/*/RSBODY/XFERPRCSTS/MESSAGE");
 
         if (!"0".equals(CODE) && !"".equals(CODE))
@@ -163,9 +161,9 @@ public class JsonUtils {
         return new BigDecimal(str);
     }
 
-    public static String getBidNoticeName(long ppid, List<BidNotice> list){
+    public static String getBidNoticeName(long ppid, List<BidNotice> list) {
         List<BidNotice> blist = list.stream().filter(bidNotice -> bidNotice.getUid().equals(ppid)).collect(Collectors.toList());
-        if(blist.isEmpty())return "";
+        if (blist.isEmpty()) return "";
         return blist.get(0).getuTitle();
     }
 }