From 1054ecf7811989ca461910d17bf70eeda32b0c81 Mon Sep 17 00:00:00 2001 From: xyiege Date: Mon, 27 Mar 2023 22:22:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=A2=E5=8D=95=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=BC=82=E5=B8=B8=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/szwh.properties | 4 ++-- .../chjyj/szwh/service/impl/PayServiceImpl.java | 15 ++++++++++----- .../java/cn/chjyj/szwh/utils/SzwhApiUtils.java | 3 +++ .../cn/chjyj/szwh/service/PayServiceTest.java | 13 ++++++++++++- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/conf/szwh.properties b/conf/szwh.properties index 95d0155..b62b3e5 100644 --- a/conf/szwh.properties +++ b/conf/szwh.properties @@ -26,8 +26,8 @@ TIANLANG_ENTRUST_URL = http://10.14.1.248:11030 # 用户地址 #REAL_URL =http://10.24.4.14:51317 -REAL_URL = http://10.14.1.248:11030 -#REAL_URL = http://58.30.231.137:51317 +#REAL_URL = http://10.14.1.248:11030 +REAL_URL = http://58.30.231.137:51317 # 主机 HOST =http://10.24.4.156 # 中间件http://10.14.1.190:51317 diff --git a/src/main/java/cn/chjyj/szwh/service/impl/PayServiceImpl.java b/src/main/java/cn/chjyj/szwh/service/impl/PayServiceImpl.java index 46b5db9..c30ca0b 100644 --- a/src/main/java/cn/chjyj/szwh/service/impl/PayServiceImpl.java +++ b/src/main/java/cn/chjyj/szwh/service/impl/PayServiceImpl.java @@ -87,6 +87,8 @@ public class PayServiceImpl implements PayService { //商品对应的合约编号 Map ccmap = new HashMap(); // + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); + // Calendar cal = Calendar.getInstance(); //订单商品详情 List orderGoodsDetailList = orderGoodsDetailMapper.getOrderGoodsDetailByBatchCode(batchcode); @@ -101,7 +103,8 @@ public class PayServiceImpl implements PayService { int years = odgd.getTransactionCount(); cal.setTime(new Date()); cal.add(Calendar.YEAR, +years); - dateStr = cal.getTime().toString(); + dateStr=sdf.format(cal.getTime()); + //dateStr = cal.getTime().toString(); transCount = odgd.getTransactionCount(); } // @@ -122,13 +125,14 @@ public class PayServiceImpl implements PayService { // 返回的值是 buyIslicode 为键名的内容 contractcode = lkcjson.getString(buyIslicode); } + //合约关联编号,更新到订单商品详情中 + Map ogdmap = new HashMap(); + ogdmap.put("contract_code", contractcode); + orderGoodsDetailMapper.updateOrderGoodsDetail(ogdmap, odgd.getId()); } else { contractcode = odgd.getContractCode(); } - //合约关联编号,更新到订单商品详情中 - Map ogdmap = new HashMap(); - ogdmap.put("contract_code", contractcode); - orderGoodsDetailMapper.updateOrderGoodsDetail(ogdmap, odgd.getId()); + //订单商品详情id,为key, 合约编号为键值 ccmap.put(odgd.getId(), contractcode); @@ -184,6 +188,7 @@ public class PayServiceImpl implements PayService { JSONArray wsynarr = new JSONArray(syncList); //待同步过去的订单信息 String forsync = wsynarr.toJSONString(); + log.info("forsync:"+forsync); //同步订单信息 JSONObject outSyncJson = SzwhApiUtils.synchInfo(forsync); log.info(batchcode + "订单获取下载地址:" + outSyncJson); diff --git a/src/main/java/cn/chjyj/szwh/utils/SzwhApiUtils.java b/src/main/java/cn/chjyj/szwh/utils/SzwhApiUtils.java index 2a21bac..678a4cb 100644 --- a/src/main/java/cn/chjyj/szwh/utils/SzwhApiUtils.java +++ b/src/main/java/cn/chjyj/szwh/utils/SzwhApiUtils.java @@ -152,12 +152,15 @@ public class SzwhApiUtils { public static JSONObject synchInfo(String postJson){ String entHost= ProperUtils.getSzwhProp("REAL_URL");//委托系统主机 String url=entHost+"/dist/api/v1/synchInfo"; + log.info("synchost:"+url); // 使用的token String sign=SignUtils.createSign("distribute"); Map hmap = new HashMap(); hmap.put("dist_token",sign); hmap.put("Content-Type","application/json"); JSONObject json = RequestUtils.postData(url,postJson,hmap); + log.info("symap"); + log.info(JSONObject.toJSONString(hmap)); log.info("synchinfo:"+postJson+",ret:"+json); return json; } diff --git a/src/test/java/cn/chjyj/szwh/service/PayServiceTest.java b/src/test/java/cn/chjyj/szwh/service/PayServiceTest.java index 18c9868..41fc545 100644 --- a/src/test/java/cn/chjyj/szwh/service/PayServiceTest.java +++ b/src/test/java/cn/chjyj/szwh/service/PayServiceTest.java @@ -6,6 +6,7 @@ import cn.chjyj.szwh.bean.OrderGoodsDetail; import cn.chjyj.szwh.mapper.GoodsMapper; import cn.chjyj.szwh.mapper.OrderGoodsDetailMapper; import cn.chjyj.szwh.mapper.OrderMapper; +import cn.chjyj.szwh.utils.SzwhApiUtils; import cn.chjyj.szwh.utils.pay.security.AesEncryption; import com.alibaba.fastjson2.JSONObject; import org.junit.Test; @@ -96,7 +97,8 @@ public class PayServiceTest { //支付完成后的操作 @Test public void paop(){ - String bac ="1669354770578266"; + //String bac ="1678845209974478"; + String bac ="1678346098421910"; payService.payFinishOperate(bac); } @@ -106,4 +108,13 @@ public class PayServiceTest { String bac ="1669354770578266"; payService.invoiceBuyOperate(bac); } + // 下载资源文件 + public void downres(){ + String host ="http://10.14.1.248:11030"; + + String ord="1678845209974478"; + // 订单信息 + + //SzwhApiUtils.synchInfo(); + } } \ No newline at end of file